Selecting a region in an image

조회 수: 4 (최근 30일)
NS
NS 2011년 7월 8일
Hi all,
I want to be able to select a part of an image and store it in MATLAB. Can anyone tell me how I can do that.
I want to be able to load it and select the circle and store its circumference. Can I do this in MATLAB?
Thanks.
NS

답변 (2개)

Image Analyst
Image Analyst 2011년 7월 9일
It's pretty easy. Look at my color segmentation demos for how to pick out colors, and BlobsDemo for how to find perimeter and area. Basically it's this 1) separate the color channels into red, green, and blue. 3 lines.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
2) do logical operations on them to get just the red circle. 1 line.
3) call bwlabel or bwconncomp. 1 line.
[labeledImage numberOfBlobs] = bwlabel(binaryImage, 8);
4) call regionprops. 1 line.
blobMeasurements = regionprops(labeledImage, originalImage, 'Perimeter');
So in 6 lines you should have it. Write back if you still can't get it.
  댓글 수: 2
NS
NS 2011년 7월 9일
Thank you for the reply image analyst. But please refer to my conversation with Nathan in the comments above. I am working with digital image contrast images of biological cells. I want to be able to edge detect the nuclear membrane and the cellular membrane. I have also given a link to show what my image looks like. Can you help me in this?
Image Analyst
Image Analyst 2011년 7월 9일
Those kind of images are always tough. You could try thresholding and then using imclose to close the gaps. Then bwlabel and regionprops to find circular shapes. Or you could try hough() to try to find the circles directly. Unless you have thousands of images your best bet might be to manually locate them with imellipse.

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


Sean de Wolski
Sean de Wolski 2011년 7월 8일
There is a demo for this in the documentation for the Image Processing Toolbox.
  댓글 수: 7
NS
NS 2011년 7월 8일
http://www.jpk.com/dic-image.media.812c5ecacd5a6f8386c39649cb0cd3bbv1.jpg This image is similar to one I work with. I am able to get the outer perimeter of the cell using imageJ and MATLAB. I want to be able to get the nuclear perimeter as well.
Nathan Greco
Nathan Greco 2011년 7월 8일
Hm. That is pretty hard to discern "automatically" through code. Perhaps just manually selecting the image (using ginput with curve fitting, perhaps?) would suffice.

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

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by