How can I detect the object in this noisy image?

조회 수: 13 (최근 30일)
L'O.G. . 2023년 5월 10일
댓글: L'O.G. . 2023년 5월 10일
I'm trying to process images like the attached. In this case, there should be an object near the center of the image around test(7,6). The object is roughly elliptical with a major axis of around 6 or 7 pixels. The bright pixels around test(11,6) are from something else that I want to ignore. What is the best way of going about this?
-I tried both global and local thresholding to binarize the image, without success. I think noise is the issue.
-I also tried using a structuring element as a disk and then a morphological technique to locate the object, but that didn't work.
-I think filtering might be the best option. Is there a good filter for this task? imfilter looks promising, but I don't know how the kernel is chosen.

답변 (2개)

Image Analyst
Image Analyst 2023년 5월 10일
Why can't you just threshold?
mask = grayImage > 35;
Beyond that I'm not sure what you want to do. There are functions to throw out blobs touching the edge of the image, or to extract blobs of a certain size range, or to extract a specified number of the larger blobs.
The main problem seems to be poor resolution, though noise is a problem too.
  댓글 수: 3
L'O.G. 2023년 5월 10일
Thank you so much. So just one more thing to clarify: given the roughly elliptical shape of the central blob, would you recommend a disk structuring element for the tophat filter? I was trying that out similar to the procedure you outlined without much success.

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

Brandon Armstrong
Brandon Armstrong 2023년 5월 10일
I'm not sure how many images like this you have or how consistent your intensity values are. For the image you attached, I would create a binary mask with a manual threshold and then filter based on region size to get rid of the smaller object.
Check out MathWorks Image Processing for Engineering and Science on Coursera to learn many techniques for segmenting and analyzing images.
load test
Create a mask and choose a manual threshold to set everythign to zero.
mask = ones(size(test), "logical");
mask(test <= 36) = 0;
filteredMask = bwpropfilt(mask, "Area", [6, inf]);
Use the mask to zero out pixels not under the mask
newImage = test;
newImage(~filteredMask) = 0;
  댓글 수: 2
Brandon Armstrong
Brandon Armstrong 2023년 5월 10일
It's going to be tough given the resolution and how close the objects are. There is not much of a decrease in intensity in the one or two pixels separating the areas you want. The suggestion from @Image Analyst sounds like the best thing to try.
If you have a lot of images, you can create a function that works on one or two test images and then apply it to all the images and see the results using the Image Batch Processor.

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


Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기




Community Treasure Hunt

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

Start Hunting!

Translated by