[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: IDLanROI Confusion
davidf@dfanning.com (David Fanning) writes:
> Folks,
>
> Alright. I admit it. I don't get it. :-(
>
> I want to use the IDLanROI object to calculate
> the perimeter, centroid, and area of a region of interest.
> But I'm not sure the values can be trusted. Here is an
> example.
...
> Here are the results. 15% error in the perimeter is pretty large!
>
> Calculated Perimeter: 362.61017
> Expected Perimeter: 314.159
> Discrepancy in Perimeter (percent): 115.42240%
>
> Calculated Area: 7691.5000
> Expected Area: 7853.98
> Discrepancy in Area (percent): 97.931216%
>
> Calculated Centroid: 199.50135 200.25225
> Expected Centroid: 200 200
>
> Am I doing something wrong, or should I believe these numbers?
> The same exercise with a square region produced accurate numbers.
>
> My expected ROI's are not squares or circles, but they are
> much closer to circles than squares.
What do you mean, they aren't squares or circles? If it isn't a
circle then you won't get a perfect match to the theory, right?
More than likely the region of interest becomes pixelated into square
pixels. It's pretty clear to me that this will give a greater
perimeter than a true circle since there are more horizontal and
vertical segments than are required.
What happens if you make the circle much much bigger? I think then
the answers will converge to what you expect.
Craig
--
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------