How can I automate the recognition and sizing/position of rectangular shapes with low contrast against background?

1 view (last 30 days)
The problem:
I have included three example images, where each image contains multiple somewhat rectangular objects on a nonuniform background. My main problem is determining how to selectively remove the background or enhance the objects. The objects have similar average intensity values compared to the background, though their edges are bright (and often irregular). In the end, I need a program that can identify each object (or most of them), and determine the length, width, and center of mass for each object in the image.
Things I have tried:
I have tried a combination of dilate/erode cycles on black and white images obtained from intensity thresholding or edge detection, but the thresholds either remove too much of the object edges or too little of the background. I have also tried texture segmentation using entropyfilt or stdfilt, but again the objects and background have similar intensities. The function activecontour seems like it would be promising, but I can't get rid of the background enough to make it find an object. This is my first go at image analysis, so I am not familiar with some of the potentially useful functions out there.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!