How can I find the sum of the area in a specified region in the image according to the pixel intensity value?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Suppose two lines with theta angle are drawn from the point (1,1) in an image. Let's consider two arcs with radii of r1 and r2, which have the origin point (1,1) and intersect these lines. I want to find the sum of the area between the four of them in terms of pixels. However, arcs or lines are dividing some squares. I want to add the remaining value in the field to the total. For example, if 1/3 of a pixel is in the area and the pixel value is 120, I want to add 30 to the total. Which method should I use?
First of all, thank you for your comments. The indices of the matrix defined for an image are actually the midpoint of a pixel that we can think of as that square. The subject is a bit complicated, I don't want to go into too much detail. I can show the attached picture as an example. Let's assume that each pixel writes the intensity values inside. We will use this as a field. If we consider each pixel as a square, I need the sum of the area between two lines and two arcs in the picture. The area for the split pixels needs to be recalculated at the same rate. So I need to sum the areas of pixels multiplied by their intensities, not just the area of the pixels in between. Thank you for your interest.

1 Kommentar
Antworten (1)
Image Analyst
am 7 Mär. 2023
I would get the list of (x,y) coordinates for each arc, then call poly2mask. Then call nnz or bwarea or regionprops or polyarea
7 Kommentare
Siehe auch
Kategorien
Find more on Image Processing and Computer Vision in Help Center and File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!