Re: extract ROI from contours with sub-pixel accuracy [message #84298 is a reply to message #81535] |
Fri, 17 May 2013 23:39  |
suruchi
Messages: 13 Registered: September 2012
|
Junior Member |
|
|
On Wednesday, September 26, 2012 10:58:00 AM UTC+5:30, suruchi wrote:
> Hello
>
> I have been able to extract ROIs from contour, but if i count the no of pixels it also includes pixels which are not fully covered in the contour.. hence for my set of images i have evolving contours.. but pixel count does not change because of this. Is there is way i can account for the pixel fraction covered in contour.. and take that information for my ROI area calculation..?
>
> I don't wish to use 'perimeter area' since perspective correction is to be applied in the area calculation..using distance of pixels from the center of image.
>
> Can i 'extract ROIs' too with sub-pixel information..?
I found a solution for this.. so would like to share:
first the fractional number of pixels covered within the contour or within roi object (say 'oroi') vertices can be calculated using:
Result = oroi->IDLanROI::ComputeGeometry(AREA=ar)
So here 'ar' gives the geometric area= total fractional number of pixels covered.
Secondly to know exactly the fractional area of each pixel covered by contour is through JD Smiths's "POLYFILLAA" (http://tir.astro.utoledo.edu/jdsmith/code/idl.php).
|
|
|