<jupyter_start><jupyter_text>Den første grammatiske avhandlingen<jupyter_code>import numpy as np
import scipy

import skimage.io as skio
import skimage.draw as skdr
import skimage.feature as skf
import skimage.filters as skfi
import skimage.transform as sktr
import skimage.morphology as skmp
from skimage import img_as_uint, img_as_int
from matplotlib import pyplot as plt


import warnings
warnings.simplefilter("ignore")

%matplotlib inline<jupyter_output><empty_output><jupyter_text>First page of the first grammatical treatise in the Codex Wormianus<jupyter_code>image = skio.imread("siden1denfoerstegrammatiskeavhandlingen.png", as_grey=True)
skio.imshow(image)
skio.show()
skio.imshow(image[20:75, 100:250])
skio.show()
ca_image = np.uint8(skf.canny(image))*255
skio.imshow(ca_image[20:75, 100:250])
skio.show()
ca_image = np.uint8(skf.canny(image))*255
thresh = skfi.threshold_otsu(ca_image)
th_image = ca_image > thresh
sk_image = skmp.skeletonize(th_image[20:75, 100:250])
skio.imshow(sk_image)
skio.show()

thresh = skfi.threshold_otsu(image)
th_image = image > thresh
skio.imshow(th_image[20:75, 100:250])
skio.show()
thresh = skfi.threshold_mean(image)
th_image = image > thresh
skio.imshow(th_image[20:75, 100:250])
skio.show()
fig, ax = skfi.try_all_threshold(image, figsize=(10, 8), verbose=False)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1137370753323486, 'fraction_numerical': 0.04579025110782865, 'mean_word_length': 7.685897435897436, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '542496', 'license': 'MIT', 'n_tokens_mistral': 581, 'n_tokens_neox': 528, 'n_words': 106, 'path': 'grammatiske_avhandlingen.ipynb', 'repo_name': 'clemsciences/old_norse_notebook', 'size': '1354'}