Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mahotas as mh | |
import networkx as nx | |
import numpy as np | |
def C8skeleton_to_graph(skeletonC8): | |
#images processing: extraction of branchedpoints, end-points, edges | |
ep = endPoints(skeletonC8) | |
bp = branchedPoints(skeletonC8, showSE = False) | |
## Label branched-points | |
l_bp,_ = mh.label(bp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageDraw, ImageFont | |
import mahotas as mh | |
def makeLetterImage(character, size): | |
image = Image.new("RGBA", (600,150), (255,255,255)) | |
draw = ImageDraw.Draw(image) | |
font = ImageFont.truetype("verdana.ttf", size) | |
draw.text((5, 0), character, (0,0,0), font=font) | |
img_resized = np.array(image.resize((300,75), Image.ANTIALIAS)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ResizeImages(ImList): | |
'''Find the largest width and height of images belonging to a list. | |
Return a list of images of same width/height | |
''' | |
maxwidth=0 | |
maxheight=0 | |
if len(np.shape(ImList[0]))==3: | |
components = np.shape(ImList[0])[2] | |
imtype = ImList[0].dtype | |
for i in range(len(ImList)): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.