RTV_DOIT to EVF [message #85838] |
Thu, 12 September 2013 15:24  |
ilya85parshakov
Messages: 2 Registered: September 2013
|
Junior Member |
|
|
I'm trying to automatically create training areas for the SVM classifier in ENVI.
I have a raster image that shows where training areas should be - something like a mask.
Then I use ENVI_DOIT to create a vector file from this file:
ENVI_DOIT, 'RTV_DOIT', DIMS=dims, FID=fid, /IN_MEMORY, OUT_NAME=out_name, L_NAME=l_name, POS=0, VALUES=0
This gives me a vector file that is not in the EVF format, so I cannot open it in IDL. And it doesn't generate a file ID for the created file (no r_fid functionality).
My next step would be to use envi_evf_define_init and envi_evf_define_add_record to add the vector data. After that I need to convert the evf file into ROIs somehow....
Question 1: How do you read whatever ENVI_DOIT produces?
Question 2: Is there an easier way to do SVM classification, maybe without generating vector files?
|
|
|
|
Re: RTV_DOIT to EVF [message #85906 is a reply to message #85904] |
Tue, 17 September 2013 05:56  |
Josh Sixsmith
Messages: 13 Registered: December 2012
|
Junior Member |
|
|
On Tuesday, 17 September 2013 07:30:53 UTC+10, ilya85p...@gmail.com wrote:
> In other words, is it possible to save RTV_DOIT output to disk as an evf file?
I'm pretty sure that evf is the only format that the RTV_DOIT procedure outputs to disk. Your call to this procedure may not actually be correct, which maybe causing your evf file to not be generated correctly.
From your example:
ENVI_DOIT, 'RTV_DOIT', DIMS=dims, FID=fid, /IN_MEMORY, OUT_NAME=out_name, L_NAME=l_name, POS=0, VALUES=0
Only the value of zero in your raster will be converted to vector. The keywords in_memory, outname, l_name, pos & values all need to be arrays of the same length.
So for your case only the value of zero is wanted for conversion to vector:
pos =[0]
values=[0]
in_memory=lonarr(0)
out_name = ['test_zero_value.evf']
l_name = ['zero_class']
That is probably what you're after.
Cheers
Josh
|
|
|