Finding the edges of an ellipse in an image

조회 수: 4 (최근 30일)
AP
AP 2015년 9월 16일
댓글: Image Analyst 2015년 9월 16일
I have an binary image as shown below.
As can be seen in the image there is an edge which looks like an arc of an ellipse, as illustrated below. The red pixels are marked manually by myself for illustrations purposes.
My final goal is to fit an ellipse to the pixels that are colored in red in the above picture. This fitted ellipse is shown in below.
Could someone kindly tell me how I can get the pixels that are marked as red in the second image using MATLAB image processing? I will then use them for an elliptical fitting and I know how to fit the red pixels to an ellipse. At this moment, I want to find a way to get the red pixels.

답변 (2개)

Matt J
Matt J 2015년 9월 16일

Image Analyst
Image Analyst 2015년 9월 16일
For your particular image it's easy. Just take the blue channel and red channels and threshold them to find the red, then draw lines straight down. See my tutorial on color segmentation in RGB color space "SimpleColorDetection" in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
For the general case, see this paper: http://www.ecse.rpi.edu/homepages/qji/Papers/ellipse_det_icpr02.pdf and code it up. It doesn't look too hard.
  댓글 수: 1
Image Analyst
Image Analyst 2015년 9월 16일
If you still don't know how to create a mask from the individual channels
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
and how to use find() to find the top most row, then post your original image, not some low quality JPG screenshot of it plus axes and tick marks and labels.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by