0
$\begingroup$

how to detect bifurcation, trifurcation, and crossover from the branch point with OpenCV when the input like this

enter image description here

Expect output :

enter image description here

I'm trying to use binary_hit_or_miss but I don't know how to display the detected area

import io
import numpy as np    
from PIL import Image
from scipy import ndimage
from IPython.display import display # to display images

image_string = open('image/skeleton/21_bloodvessel.png', 'rb').read()
img = Image.open(io.BytesIO(image_string))
arr = np.asarray(img)

structure1 = [
    [0,1,0],
    [0,1,1],
    [0,0,0]
]
np_array=ndimage.binary_hit_or_miss(arr, structure1=structure1).astype(np.int)
np_array=Image.fromarray(np_array)
im = display(np_array)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.