T. Ahmed
T. Ahmed

Reputation: 11

Object extraction after Canny

I have found out edges by using canny edge algorithm in OpenCV Java. I need to extract the spinal cord from this image.

Can you please suggest the next steps to extract the spinal cord only from this image?

This is the original image:

Upvotes: 1

Views: 835

Answers (2)

Samer
Samer

Reputation: 1980

This is tricky, there are so many variables here. However, if all images of spine are of the same size, you can do matching, Opencv has function to do template matching: matching

I would also consider using Hough transform to detect rectangles/squares since the Spine is clearly composed of several rectangles Hough

Upvotes: 1

Hassan Al Bourji
Hassan Al Bourji

Reputation: 195

to extract a specific object from an image you have to find the contours in the canny image first. You can use findContours() to get all contours in the image. This link shows a tutorial on how to do this: http://bytefish.de/blog/extracting_contours_with_opencv/ This tutorial shows a C++ code but java opencv is just an api mapping C++ functions to java.

Next step is to do some calculations about the width and hight ratios of the contours and then you can extract them from your image.

This is not an easy task to do. Research hard to figure out some stuff related to ratios of width and height of the spine.

Upvotes: 1

Related Questions