15 Nov 2011 10:44 AM |
|
Hi,
Is there any possibility to use report area of ROIs in batch mode. I mean in scripting form because I could not find it or measurement report in Roi Tools.
|
|
|
|
Deleted User New Member
Posts:  
16 Nov 2011 07:50 AM |
|
You can get the area of a polygon ROI from both interactive ENVI and using batch scripting. To do it from the interactive interface, in the ROI Tool dialog, you can select one or more ROIs, then choose Options > Report Area of ROIs.
To get the area of polygon ROIs in batch scripting, you would use the routine ENVI_GET_ROI_INFORMATION, with the NPTS keyword. NPTS will return the number of pixels in the ROI. Then you can use the size of the pixels in the image to calculate the area of the ROI. Before calling ENVI_GET_ROI_INFORMATION, you will need to retrieve the ROI ID for your ROI of interest, using the ENVI_GET_ROI_IDS routine.
I hope that helps.
Peg
|
|
|
|
Deleted User New Member
Posts:  
16 Nov 2011 09:47 AM |
|
Thanks Peg for this comment but in fact if I want to calculate the area of the object which dose is not projected for example in Lat/Lon format, it can is simple as you explained but if we have an object projected in Eg Lat/Lon we can not use no of pixels ino pixel spacing that is why I want to use Report Area of ROIs in batch mode because this tools calculate the area on a projected system. like map_2point.pro.
So I am searching for a routin to calculate the area of roi file which projected in Lat/Lon for example and in interactive ENVI it is possible by Report Area of ROIs but what about batch programminig.
I am waiting. thanks
|
|
|
|
Deleted User New Member
Posts:  
16 Nov 2011 10:44 AM |
|
I'm sorry, but I don't follow your explanation. If you have an image in a particular projection, and you know the size of the pixels in the units of that projection, then you should be able to calculate the area of your ROI, given the number of pixels in it. Have I missed something?
- Peg
|
|
|
|
Deleted User New Member
Posts:  
17 Nov 2011 06:45 AM |
|
Yes it is correct but in a case that pixel spacing dose not change. but for example in sar images we have change in pixel spacing so it dose not work for calculating area just base on pixel spacing. we have the size of the pixel for example 75 meters but this is a value for flat image not projected image. when we project the image we have the area on spherical surface and we have change in pixel spacing as well. I have test the area calculated by pixel spacing and the envi result obtained form ENVI and compare them with NEST and .... the result which I have got from pixel spacing into no of pixel of the roi is completely different with the ENVI and NEST one. so...............
|
|
|
|
Deleted User New Member
Posts:  
17 Nov 2011 10:33 AM |
|
Ah, I see. The image is not in a map projection. It is a SAR image in slant range, or something like that, right? In that case, I don't know of any way for you to calculate the area of a polygon ROI programmatically. I'm sorry that I don't have a suggestion for you.
- Peg
|
|
|
|
Deleted User New Member
Posts:  
18 Nov 2011 08:51 AM |
|
So Peg
I have a question. What is your idea about calling '''''' report area of Roi''''' which is available in ENVI in batch programming. is there any routine that can be used to call this '''''' report area of Roi''''' in batch mode. because I have test and compare the result with the other softwares and found the result of '''''' report area of Roi''''' reliable so what do you think ? or the same tools availabel in EVF processing which calculates the area and lenghts of vector file. so ....... :)
|
|
|
|
Deleted User New Member
Posts:  
18 Nov 2011 09:47 AM |
|
No, I'm sorry, the tool in the ROI Tool dialog that reports the area of the ROI is not available for ENVI batch programming.
I am surprised that it gives you good results, actually. If your imagery is not in a map projection, and the pixels are not equal in size, I wouldn't think that it would give you good results. My understanding was that it used the pixel size in the header of the image to calculate the size of the ROI, just as I suggested to you.
- Peg
|
|
|
|
Deleted User New Member
Posts:  
18 Nov 2011 10:43 AM |
|
YES. You are right it is using the pixel size and now I have found the different. So as you have said. the result is not accurate.
Thank Peg.
|
|
|
|
Deleted User New Member
Posts:  
22 Nov 2011 07:24 AM |
|
Sorry, no I don't have any tips for calculating the perimeter of an ROI file. It seems like that would be a lot harder than area, because you'd have to keep track of how the pixels fit together.
- Peg
|
|
|
|