Re: diferent results in program and envi [message #55093] |
Wed, 01 August 2007 13:05 |
Jeff N.
Messages: 120 Registered: April 2005
|
Senior Member |
|
|
On Aug 1, 2:09 pm, "skymaxw...@gmail.com" <skymaxw...@gmail.com>
wrote:
> first question is closed ;)
> now it's works
>
> second question about getting pixel size in program still active :(
>
>> Second question, yes you are right
>> i define pixel size in my program from ENVI GUI
>> how get pixel size WITHOUT ENVI GUI ?
I've clearly missed something fundamental here, b/c I really just
don't get how you're able to come up with a value for a pixel size if
you're using the ENVI GUI, but you can't come up with that value if
you're writing a program. So I'm going to bow out of this one and let
smarter people than me jump in :)
Jeff
|
|
|
Re: diferent results in program and envi [message #55094 is a reply to message #55093] |
Wed, 01 August 2007 12:24  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
skymaxwell@gmail.com wrote:
> first question is closed ;)
> now it's works
>
> second question about getting pixel size in program still active :(
>
>
>
>> Second question, yes you are right
>> i define pixel size in my program from ENVI GUI
>> how get pixel size WITHOUT ENVI GUI ?
Well, if your image is georeferenced, you can do
pixSizeX = (max(coord X) - min(coord X)) / nb of Pixels in the X direction
...if your image is not georeferenced, you would have to find it by
other means... the best one is probably the metadata of your image /
sensor! ... otherwise, to ESTIMATE it, you would need to identify two
features on your image and you would have to know their exact coordinate
or at least the distance between the 2 features. ... then you need to
find the number of pixels in the X and Y direction between the two
features... make sure to consider fractions of pixels! ... and you apply
the same idea as if your image was georeferenced..
Hope that helps!
Jean
|
|
|
|
Re: diferent results in program and envi [message #55100 is a reply to message #55095] |
Wed, 01 August 2007 08:44  |
skymaxwell@gmail.com
Messages: 127 Registered: January 2007
|
Senior Member |
|
|
for example, for one image i have
in ENVI - resulting image size 13888 x 8884
in my program - 18057 x 6833
i think that in ENVI image more correct, it's more detailed as
original non georeferenced image
Second question, yes you are right
i define pixel size in my program from ENVI GUI
how get pixel size WITHOUT ENVI GUI ?
|
|
|
Re: diferent results in program and envi [message #55103 is a reply to message #55100] |
Wed, 01 August 2007 08:04  |
Jeff N.
Messages: 120 Registered: April 2005
|
Senior Member |
|
|
On Aug 1, 4:58 am, "skymaxw...@gmail.com" <skymaxw...@gmail.com>
wrote:
> Hello. I have some images and some GCP for each. I georeferenced some
> of them by ENVI.
> now i want to do this by program. But my results are different. Why ?
> Here is fragment of my source code
>
> ;;;;;;;;;;;;;;;;;;
> ...
> pts0=[[geo_points[0,0],geo_points[1,0],0.0,0.0],$
> [geo_points[0,1],geo_points[1,1],ns-1,0.0],$
> [geo_points[0,2],geo_points[1,2],0.0,nl-1],$
> [geo_points[0,3],geo_points[1,3],ns-1,nl-1],$
> print,'pts0'
> print,pts0
>
> ;units=ENVI_TRANSLATE_PROJECTION_UNITS('Degrees')
> proj=ENVI_PROJ_CREATE(/GEOGRAPHIC)
> pixel_size=[0.00011710,0.00009006]
> ;proj=ENVI_PROJ_CREATE(/UTM,ZONE=UTM_Zone,DATUM='WGS-84')
>
> ENVI_DOIT,'ENVI_REGISTER_DOIT',$
> W_FID=fid,$
> W_POS=pos,$
> W_DIMS=dims,$
> METHOD=5,$
> PIXEL_SIZE=pixel_size,$
> PTS=pts0,$
> PROJ=proj,$
> R_FID=r_fid,$
> OUT_NAME='D:\pts0',$
> OUT_BNAME='my transform'
> ;;;;;;;;;;;;;;;;;;;;;;;;;
>
> and another question how define pixel size by my program?
>
> Thanks
How are the results different? How do you know which answer is the
right one? (in other words: what if you're doing it wrong by hand?)
And aren't you defining a pixel size in the code you just posted? Or
are you asking how to calculate it I guess?
Jeff
|
|
|