- Read about inpolygon. You will get all the indices of the points lying inside this reactange. Then you can count them.
- Use interp2, you will get only those pixels....and then count.
- You already have the indcies of rectangel, so from the image extract this chunk using indexing and then you can count your pixels. (This method is easy, try out this)
Count values on an image inside a rectangle
1 次查看(过去 30 天)
显示 更早的评论
I have a picture with uint16 grayscale intensities. I want to define 4 points (as corner points of a rectangle) and put this rectangle somwhere on top of my picture. This shouldn't be a problem. But then i want to sum up all the grayscale intensity values of the underlying image inside this rectangle. How can i do this?
0 个评论
回答(1 个)
KSSV
2020-11-4
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!