Detecting a rectangular reference panel in the image
7 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
Image Analyst
2022-5-10
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 个评论
Image Analyst
2022-5-10
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.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!