Detecting a rectangular reference panel in the image

7 views (last 30 days)
I am trying to calibrate some hyperspectral images of a farm field. As part of the process, I need to detect the reference reflectance panel in the RGB image that I construct from three hyperspectral bands:
I need to extract the rectangular panel (which is composed of four smaller rectangles). I am wondering what would be the best way to achieve this? I tried the color thresholding technique but since the thresholds might vary from one image to another, I couldn't get a universal answer.

Accepted Answer

Image Analyst
Image Analyst on 10 May 2022
Why would the threshold change? Do you have gray background? If all your backgrounds are colored, I'd just convert to HSV, then threshold the S channel at about 0.25 to get the gray stuff. Take the largest blob, or the blob at the center (if that is where it always is). Then get the histogram of the rectangle to find the 4 intensity levels if you need them. Shouldn't be hard at all. Show me the code from the Color Thresholder app that you exported.
  3 Comments
Image Analyst
Image Analyst on 10 May 2022
I didn't try it but if you just want to get the largest blob, use bwareafilt(). If it's not the largest, then maybe it has the highest solidity so ask regionprops for Solidity, which will be 1 for convex objects, like a rectangle, and less than 1 for irregularly-shaped regions.
Mohammad Gohardoust
Mohammad Gohardoust on 12 May 2022
Thanks for your suggestions. Since a fixed threshold for S channel did not work for all images that I had, I ended up with applying a range of thresholds and screening the area, solidity, and perimeter to filter out panels.

Sign in to comment.

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!