| Hi, I am using ENVI/IDL language to batch classify images via K-means method.
In this process, I need to mask out zero values in images.
When I run my codes, it shows me this error message:
ENVI retrieve data: An error has occurred during processing.
Error: "POINT_LUN: negative position argument not allowed. Position: -1600, Unit: 106, File: d:\mask3."
Here is my code:
e=envi()
outfile='d:\test2class.img'
infile='d:\test2' ; test image file
envi_open_file,  infile, r_fid=infid
mfile='d:\mask3' ; mask file
envi_open_file,  mfile, r_fid=mfid
 
envi_file_query,infid,dims=dims,nb=nb ; dims=[400,400] nb=6
 
envi_doit,'class_doit', $
       fid=infid, $
       dims=dims, $
       pos=lindgen(nb), $ 
       method=7, $ 
       num_classes=5, $
       iterations=1, $
       change_thresh=0.05, $
       m_fid=mfid, $
       out_name=outfile
I found that when I was adding the mask file (m_fid=mfid) into the function "class_doit" the above mentioned error occurred.
My ENVI version is 5.0.
Anyone knows why?
Thanks in advance. |