Identify specific rectangular shape in image and measure distance
Show older comments
I'd like to be able to identify a specific rectangle within my image, because I would then like to meake a measurement from the edge of the image to the upper boundary of this rectangle.
I will have several images of the same object containing the rectangle from several differnet imaging systems. The orientation and position of the object should always be very close to as it appears in these examples, but it will be aligned by hand so there may be some small differences.
My image looks like this, and I am after the long thin horizontal band in the center of the image:

Ultimately, I want to make the measurement in yellow- from the top of the image to the top of the horizontal rectangle in the center of the image drawn in red.

I am having trouble segmenting out the rectangle- I don't have much expereince and have tried some simple thresholding and morphology but have not been succressful. I've attached a couple different example images. Perhaps I need to look into some sort of edge detection? If the object is grossly misaligned, the measurement is useless anyway, so perhps an inital crop could work. Thaniks for any help or insights.
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


