Quantcast

RPC vs LandsatModel

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RPC vs LandsatModel

Phil
Hi

Let me start off with I'm am no GIS expert... OK with that said, what is the difference between using the RPC and the ossimLandsatModel? And can the landsatModel be used to do orthorectification, if so then how?

I am trying to orthorectify Landsat scenes but I don't know what gives the best results. I currently have an complete program that uses ossim to generate RPC values from GCPs and then does the orthorectification. This seems to work fine.

Now I am experimenting with the ossimLandsatModel, I have successfully got the model going with the following:

-> ossimKeywordlist kwl;
->
-> ossimRefPtr<ossimFfL7> header = new ossimFfL7("L71173065_06520020707_HRF.FST");
-> // header.get()->getErrorStatusString() displays OSSIM_OK, so I'm assuming everything worked fine
-> // I also verified the header data vs the input FAST format header and it all matches
->
-> // this loads creates the model as far as i know
-> ossimRefPtr<ossimLandSatModel> landsatModel = new ossimLandSatModel(*header.get());
->
-> //now save the kwl and write it to some *.geom file
-> landsatModel->saveState(kwl);
-> kwl.write(outputFile);

This gives me the following file: "L71173065_06520020707_B50.geom"

Then I use "ossim-orthoigen L71173065_06520020707_B50.TIF output.TIF" to create the orhorectified image.

Now when I compare the input "L71173065_06520020707_B50.TIF" to the output "output.TIF" there is no difference at all, each and every pixel is the same (same image size as well).

Is there something that I am missing when using the ossimLandatModel???

Thx very much in advance
-Phil


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

Garrett Potts
Hello Phil:

Try using a different output projection.  I can't remember but the view may default to the input projection so your command line usage set the input view to the output view and nothing got changed:

try this to see if there is a scale difference:

ossim-orthoigen --geo <input> <output>

the --geo says to default the view to a "true geographic"  where the origin of the projector is at 0,0.  This should cause your image to stretch as you move up the latitude.

Take care

Garrett



On May 17, 2011, at 7:28 AM, Phil wrote:

> Hi
>
> Let me start off with I'm am no GIS expert... OK with that said, what is the
> difference between using the RPC and the ossimLandsatModel? And can the
> landsatModel be used to do orthorectification, if so then how?
>
> I am trying to orthorectify Landsat scenes but I don't know what gives the
> best results. I currently have an complete program that uses ossim to
> generate RPC values from GCPs and then does the orthorectification. This
> seems to work fine.
>
> Now I am experimenting with the ossimLandsatModel, I have successfully got
> the model going with the following:
>
> -> ossimKeywordlist kwl;
> ->
> -> ossimRefPtr<ossimFfL7> header = new
> ossimFfL7("L71173065_06520020707_HRF.FST");
> -> // header.get()->getErrorStatusString() displays OSSIM_OK, so I'm
> assuming everything worked fine
> -> // I also verified the header data vs the input FAST format header and it
> all matches
> ->
> -> // this loads creates the model as far as i know
> -> ossimRefPtr<ossimLandSatModel> landsatModel = new
> ossimLandSatModel(*header.get());
> ->
> -> //now save the kwl and write it to some *.geom file
> -> landsatModel->saveState(kwl);
> -> kwl.write(outputFile);
>
> This gives me the following file: "L71173065_06520020707_B50.geom"
>
> Then I use "ossim-orthoigen L71173065_06520020707_B50.TIF output.TIF" to
> create the orhorectified image.
>
> Now when I compare the input "L71173065_06520020707_B50.TIF" to the output
> "output.TIF" there is no difference at all, each and every pixel is the same
> (same image size as well).
>
> Is there something that I am missing when using the ossimLandatModel???
>
> Thx very much in advance
> -Phil
>
>
>
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/RPC-vs-LandsatModel-tp6372705p6372705.html
> Sent from the Ossim-developer mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Achieve unprecedented app performance and reliability
> What every C/C++ and Fortran developer should know.
> Learn how Intel has extended the reach of its next-generation tools
> to help boost performance applications - inlcuding clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> www.ossim.org
> Ossim-developer mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/ossim-developer


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

oscarkramer
In reply to this post by Phil

Phil,

 

I’m forwarding your data here to the group…

 

The LS model orthoigen output geom file indicates EPSG:32631 projection (UTM). You must have told it that either explicitely or implicitely. In any case, the pixels corresponding to that output image should definitely be different than the raw landsat image – unless the “raw” landsat image was already map projected to that same UTM projection.

 

As Garrett pointed out, if you don’t specify an output projection to orthoigen, it will use the same projection as the input (assuming the input itself is map projected) otherwise it will use a geographic projection (EPSG:4326). So, given that the output is UTM, and presuming you didn’t specify that to orthoigen, I would have to conclude that your LS image is already in a UTM projection. However, the landsat_model_input.geom you sent me is indeed a sensor model geometry (not a map projection), so I am confused. Something is missing.

 

The landsat_model_ossim_info you sent is on the input landsat image? Because that indicates UTM as well. I suspect you are not picking up the LS model in the code. Make sure your input LS geom file (the one with the sensor model params) has the same file name as the image but with .geom extension, and that it is located in the same dir as the image.

 

Oscar

 

 

From: Philip Bouwer [mailto:[hidden email]]
Sent: Tuesday, May 17, 2011 10:43
To: Oscar L. Kramer
Subject: Re: [OSSIM] RPC vs LandsatModel

 

Hi Oscar

 

Thank you for the quick reply. 

 

Here are the files you requested, I do not know what to look for in these files, the one thing that I do know is the result image obtained from using the GCPs are closer to the an actual orthorectified image, and the using the landsatModel does nothing to the input.

 

I have attached files for both the ossimLandsatModel and for the RPCProjection with GCPs, 

 

Where 

1.:       input.geom is from the input.TIF

2.:       output.geom is obtained from "ossim-orthoigen --writer-prop create_external_geometry=1 ..."

3.:       ossimInfo is obtained from "ossim-info –p output.tif"

 

Thank you very much

 

-phil

 

On Tue, May 17, 2011 at 4:21 PM, Oscar L. Kramer <[hidden email]> wrote:

Hi Phil,

 

Can you run the following on your orthoigen product?

 

                ossim-info –p test.tif

 

Also add the following option to your orthoigen command line:

 

                ossim-orthoigen --writer-prop create_external_geometry=1 ...

 

and take a look at the geometry file. Send us both the ossim-info output and the geometry file.

 

 

Oscar L. Kramer

Senior Software Engineer

<a href="tel:703.462.1881" target="_blank">703.462.1881

[hidden email]

  

 

 

From: Philip Bouwer [mailto:[hidden email]]
Sent: Tuesday, May 17, 2011 09:35
To: Oscar L. Kramer
Subject: Re: [OSSIM] RPC vs LandsatModel

 

Hi Oscar 

 

I am so happy you replied, since most of the landsat model code was written by you. The comparison I'm doing is a binary diff, I'm working in Linux and I extract the raw binary data using "gdal_translate -of ENVI", using this creates a raw file of pixel data as well as header files, that way i can separate the image pixel data from the metadata. Using the raw pixel data I compare these to the input data and they are exactly the same (like nothing was done to the input image). 

 

Could you please have a look at the code piece attached and tell me if I'm doing it right (is a small file).

 

Thank you

-phil

 

 

 

On Tue, May 17, 2011 at 2:37 PM, Oscar L. Kramer <[hidden email]> wrote:

How are you comparing the two images? Using Imagelinker or Iview? I'm wondering if the viewer you are using is orthorectifying as well (as Imagelinker would do). In that case you wouldn't see a difference since both are displayed in the same projection.

Oscar


-----Original Message-----
From: Phil [mailto:[hidden email]]
Sent: Tuesday, May 17, 2011 07:29
To: [hidden email]
Subject: [OSSIM] RPC vs LandsatModel

Hi

Let me start off with I'm am no GIS expert... OK with that said, what is the
difference between using the RPC and the ossimLandsatModel? And can the
landsatModel be used to do orthorectification, if so then how?

I am trying to orthorectify Landsat scenes but I don't know what gives the
best results. I currently have an complete program that uses ossim to
generate RPC values from GCPs and then does the orthorectification. This
seems to work fine.

Now I am experimenting with the ossimLandsatModel, I have successfully got
the model going with the following:

-> ossimKeywordlist kwl;
->
-> ossimRefPtr<ossimFfL7> header = new
ossimFfL7("L71173065_06520020707_HRF.FST");
-> // header.get()->getErrorStatusString() displays OSSIM_OK, so I'm
assuming everything worked fine
-> // I also verified the header data vs the input FAST format header and it
all matches
->
-> // this loads creates the model as far as i know
-> ossimRefPtr<ossimLandSatModel> landsatModel = new
ossimLandSatModel(*header.get());
->
-> //now save the kwl and write it to some *.geom file
-> landsatModel->saveState(kwl);
-> kwl.write(outputFile);

This gives me the following file: "L71173065_06520020707_B50.geom"

Then I use "ossim-orthoigen L71173065_06520020707_B50.TIF output.TIF" to
create the orhorectified image.

Now when I compare the input "L71173065_06520020707_B50.TIF" to the output
"output.TIF" there is no difference at all, each and every pixel is the same
(same image size as well).

Is there something that I am missing when using the ossimLandatModel???

Thx very much in advance
-Phil




--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/RPC-vs-LandsatModel-tp6372705p6372705.html
Sent from the Ossim-developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

 

 


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

landsat_model____input.geom (3K) Download Attachment
landsat_model____ossimInfo (2K) Download Attachment
landsat_model____output.geom (994 bytes) Download Attachment
ossimRpcSolver_GCPs____input.geom (8K) Download Attachment
ossimRpcSolver_GCPs____ossimInfo (2K) Download Attachment
ossimRpcSolver_GCPs____output.geom (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

Phil
Hi Oscar

Thank you for the replies.

The input image is in UTM, the output must be in UTM as well. What I'm trying to do is orthorectify LS images. The input images are already at L1G (geometrically correct), I need to create a piece of software that can read in these L1G products and procude L1T (terrain corrected) images. I have already got the RPC methods working. Can the ossimLandsatModel be used to orthorectify these images???

Can you please tell me what you would do to get to L1T products if you had the following inputs:

1. Complete SRTM DEM set of data
2. Matching GCPs for any scene
    I have a chip library that covers almost all landsat scenes for UTM projection, I build a chip2image correlation system, based on the USGS LPGS system. This produces excellent GCPs.
3. I have loads of Landsat scenes in L1G, UTM projection. 
    Just as a side note, the chip lib is in UTM thus the input scenes need to be in UTM for the correlation to work.

Now from the above I want L1T products, the system I coded thus far can produce L1T using the ossimRPCsolver in either RPCProjection or RPCModel. I was wondering if it is possible to produce L1T using the ossimLandsatModel. The one thing I noted is the ossimLandsatModel parses the L1G metadata, and I see no way to include GCPs. I am assuming the ossim-orthoigen will automatically load the DEM, but the *.geom files associated with the input images are the only place where GCP data can be added (in a sense).

Am I missing something some where???

As Garret said when using the --geo with the ossim-orthoigen the output is different but I need the output to be in UTM, this brings me to another question. Can the input scene data used by ossim-orthoigen be in UTM or must it be in some other projection?

I hope I am not asking too many from you now, and I hope I am not vague.

Thx very very much
-Phil


On Wed, May 18, 2011 at 2:53 PM, oscarkramer [via OSGeo.org] <[hidden email]> wrote:

Phil,

 

I’m forwarding your data here to the group…

 

The LS model orthoigen output geom file indicates EPSG:32631 projection (UTM). You must have told it that either explicitely or implicitely. In any case, the pixels corresponding to that output image should definitely be different than the raw landsat image – unless the “raw” landsat image was already map projected to that same UTM projection.

 

As Garrett pointed out, if you don’t specify an output projection to orthoigen, it will use the same projection as the input (assuming the input itself is map projected) otherwise it will use a geographic projection (EPSG:4326). So, given that the output is UTM, and presuming you didn’t specify that to orthoigen, I would have to conclude that your LS image is already in a UTM projection. However, the landsat_model_input.geom you sent me is indeed a sensor model geometry (not a map projection), so I am confused. Something is missing.

 

The landsat_model_ossim_info you sent is on the input landsat image? Because that indicates UTM as well. I suspect you are not picking up the LS model in the code. Make sure your input LS geom file (the one with the sensor model params) has the same file name as the image but with .geom extension, and that it is located in the same dir as the image.

 

Oscar

 

 

From: Philip Bouwer [mailto:[hidden email]]

Sent: Tuesday, May 17, 2011 10:43
To: Oscar L. Kramer
Subject: Re: [OSSIM] RPC vs LandsatModel

 

Hi Oscar

 

Thank you for the quick reply. 

 

Here are the files you requested, I do not know what to look for in these files, the one thing that I do know is the result image obtained from using the GCPs are closer to the an actual orthorectified image, and the using the landsatModel does nothing to the input.

 

I have attached files for both the ossimLandsatModel and for the RPCProjection with GCPs, 

 

Where 

1.:       input.geom is from the input.TIF

2.:       output.geom is obtained from "ossim-orthoigen --writer-prop create_external_geometry=1 ..."

3.:       ossimInfo is obtained from "ossim-info –p output.tif"

 

Thank you very much

 

-phil

 

On Tue, May 17, 2011 at 4:21 PM, Oscar L. Kramer <[hidden email]> wrote:

Hi Phil,

 

Can you run the following on your orthoigen product?

 

                ossim-info –p test.tif

 

Also add the following option to your orthoigen command line:

 

                ossim-orthoigen --writer-prop create_external_geometry=1 ...

 

and take a look at the geometry file. Send us both the ossim-info output and the geometry file.

 

 

Oscar L. Kramer

Senior Software Engineer

<a href="tel:<a href="tel:703.462.1881" value="+17034621881" target="_blank">703.462.1881" target="_blank"><a href="tel:703.462.1881" value="+17034621881" target="_blank">703.462.1881

[hidden email]

  

 

 

From: Philip Bouwer [mailto:[hidden email]]

Sent: Tuesday, May 17, 2011 09:35
To: Oscar L. Kramer
Subject: Re: [OSSIM] RPC vs LandsatModel

 

Hi Oscar 

 

I am so happy you replied, since most of the landsat model code was written by you. The comparison I'm doing is a binary diff, I'm working in Linux and I extract the raw binary data using "gdal_translate -of ENVI", using this creates a raw file of pixel data as well as header files, that way i can separate the image pixel data from the metadata. Using the raw pixel data I compare these to the input data and they are exactly the same (like nothing was done to the input image). 

 

Could you please have a look at the code piece attached and tell me if I'm doing it right (is a small file).

 

Thank you

-phil

 

 

 

On Tue, May 17, 2011 at 2:37 PM, Oscar L. Kramer <[hidden email]> wrote:

How are you comparing the two images? Using Imagelinker or Iview? I'm wondering if the viewer you are using is orthorectifying as well (as Imagelinker would do). In that case you wouldn't see a difference since both are displayed in the same projection.

Oscar


-----Original Message-----
From: Phil [mailto:[hidden email]]
Sent: Tuesday, May 17, 2011 07:29
To: [hidden email]
Subject: [OSSIM] RPC vs LandsatModel

Hi

Let me start off with I'm am no GIS expert... OK with that said, what is the
difference between using the RPC and the ossimLandsatModel? And can the
landsatModel be used to do orthorectification, if so then how?

I am trying to orthorectify Landsat scenes but I don't know what gives the
best results. I currently have an complete program that uses ossim to
generate RPC values from GCPs and then does the orthorectification. This
seems to work fine.

Now I am experimenting with the ossimLandsatModel, I have successfully got
the model going with the following:

-> ossimKeywordlist kwl;
->
-> ossimRefPtr<ossimFfL7> header = new
ossimFfL7("L71173065_06520020707_HRF.FST");
-> // header.get()->getErrorStatusString() displays OSSIM_OK, so I'm
assuming everything worked fine
-> // I also verified the header data vs the input FAST format header and it
all matches
->
-> // this loads creates the model as far as i know
-> ossimRefPtr<ossimLandSatModel> landsatModel = new
ossimLandSatModel(*header.get());
->
-> //now save the kwl and write it to some *.geom file
-> landsatModel->saveState(kwl);
-> kwl.write(outputFile);

This gives me the following file: "L71173065_06520020707_B50.geom"

Then I use "ossim-orthoigen L71173065_06520020707_B50.TIF output.TIF" to
create the orhorectified image.

Now when I compare the input "L71173065_06520020707_B50.TIF" to the output
"output.TIF" there is no difference at all, each and every pixel is the same
(same image size as well).

Is there something that I am missing when using the ossimLandatModel???

Thx very much in advance
-Phil




--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/RPC-vs-LandsatModel-tp6372705p6372705.html
Sent from the Ossim-developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]

 

 


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]

landsat_model____input.geom (3K) Download Attachment
landsat_model____ossimInfo (2K) Download Attachment
landsat_model____output.geom (994 bytes) Download Attachment
ossimRpcSolver_GCPs____input.geom (8K) Download Attachment
ossimRpcSolver_GCPs____ossimInfo (2K) Download Attachment
ossimRpcSolver_GCPs____output.geom (1K) Download Attachment



If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1803224.n2.nabble.com/RPC-vs-LandsatModel-tp6372705p6377666.html
To unsubscribe from RPC vs LandsatModel, click here.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

oscarkramer

I thought the data was raw. If it is L1G, then there are distortions for high relief areas embedded in the data. In order to get to L1T, you need to know the physics of the imaging ray in order to intersect the ray with the DEM. You don’t have that with the L1G data. The landsat model does that but your image is UTM, not “landsat model raw”. I don’t know off the top of my head if the raw LS metadata can somehow be used to recover the 3D from the L1G. There may be a way of regenerating the raw pixel coordinates given the L1G UTM projection as input and the LS metadata/LS-model as output. That’s getting deep into OSSIM. Sorry I don’t have time to get into the process. Are you a programmer or a user? This is not a trivial project.

 

 

 

From: Phil [mailto:[hidden email]]
Sent: Wednesday, May 18, 2011 09:40
To: [hidden email]
Subject: Re: [OSSIM] RPC vs LandsatModel

 

Hi Oscar

 

Thank you for the replies.

 

The input image is in UTM, the output must be in UTM as well. What I'm trying to do is orthorectify LS images. The input images are already at L1G (geometrically correct), I need to create a piece of software that can read in these L1G products and procude L1T (terrain corrected) images. I have already got the RPC methods working. Can the ossimLandsatModel be used to orthorectify these images???

 

Can you please tell me what you would do to get to L1T products if you had the following inputs:

 

1. Complete SRTM DEM set of data

2. Matching GCPs for any scene

    I have a chip library that covers almost all landsat scenes for UTM projection, I build a chip2image correlation system, based on the USGS LPGS system. This produces excellent GCPs.

3. I have loads of Landsat scenes in L1G, UTM projection. 

    Just as a side note, the chip lib is in UTM thus the input scenes need to be in UTM for the correlation to work.

 

Now from the above I want L1T products, the system I coded thus far can produce L1T using the ossimRPCsolver in either RPCProjection or RPCModel. I was wondering if it is possible to produce L1T using the ossimLandsatModel. The one thing I noted is the ossimLandsatModel parses the L1G metadata, and I see no way to include GCPs. I am assuming the ossim-orthoigen will automatically load the DEM, but the *.geom files associated with the input images are the only place where GCP data can be added (in a sense).

 

Am I missing something some where???

 

As Garret said when using the --geo with the ossim-orthoigen the output is different but I need the output to be in UTM, this brings me to another question. Can the input scene data used by ossim-orthoigen be in UTM or must it be in some other projection?

 

I hope I am not asking too many from you now, and I hope I am not vague.

 

Thx very very much

-Phil

 

On Wed, May 18, 2011 at 2:53 PM, oscarkramer [via OSGeo.org] <[hidden email]> wrote:

Phil,

 

I’m forwarding your data here to the group…

 

The LS model orthoigen output geom file indicates EPSG:32631 projection (UTM). You must have told it that either explicitely or implicitely. In any case, the pixels corresponding to that output image should definitely be different than the raw landsat image – unless the “raw” landsat image was already map projected to that same UTM projection.

 

As Garrett pointed out, if you don’t specify an output projection to orthoigen, it will use the same projection as the input (assuming the input itself is map projected) otherwise it will use a geographic projection (EPSG:4326). So, given that the output is UTM, and presuming you didn’t specify that to orthoigen, I would have to conclude that your LS image is already in a UTM projection. However, the landsat_model_input.geom you sent me is indeed a sensor model geometry (not a map projection), so I am confused. Something is missing.

 

The landsat_model_ossim_info you sent is on the input landsat image? Because that indicates UTM as well. I suspect you are not picking up the LS model in the code. Make sure your input LS geom file (the one with the sensor model params) has the same file name as the image but with .geom extension, and that it is located in the same dir as the image.

 

Oscar

 

 

From: Philip Bouwer [mailto:[hidden email]]

Sent: Tuesday, May 17, 2011 10:43
To: Oscar L. Kramer
Subject: Re: [OSSIM] RPC vs LandsatModel

 

Hi Oscar

 

Thank you for the quick reply. 

 

Here are the files you requested, I do not know what to look for in these files, the one thing that I do know is the result image obtained from using the GCPs are closer to the an actual orthorectified image, and the using the landsatModel does nothing to the input.

 

I have attached files for both the ossimLandsatModel and for the RPCProjection with GCPs, 

 

Where 

1.:       input.geom is from the input.TIF

2.:       output.geom is obtained from "ossim-orthoigen --writer-prop create_external_geometry=1 ..."

3.:       ossimInfo is obtained from "ossim-info –p output.tif"

 

Thank you very much

 

-phil

 

On Tue, May 17, 2011 at 4:21 PM, Oscar L. Kramer <[hidden email]> wrote:

Hi Phil,

 

Can you run the following on your orthoigen product?

 

                ossim-info –p test.tif

 

Also add the following option to your orthoigen command line:

 

                ossim-orthoigen --writer-prop create_external_geometry=1 ...

 

and take a look at the geometry file. Send us both the ossim-info output and the geometry file.

 

 

Oscar L. Kramer

Senior Software Engineer

<a href="tel:<a href="tel:703.462.1881" value="+17034621881" target="_blank">703.462.1881" target="_blank"><a href="tel:703.462.1881" value="+17034621881" target="_blank">703.462.1881

[hidden email]

  

Error! Filename not specified.

 

 

From: Philip Bouwer [mailto:[hidden email]]

Sent: Tuesday, May 17, 2011 09:35
To: Oscar L. Kramer
Subject: Re: [OSSIM] RPC vs LandsatModel

 

Hi Oscar 

 

I am so happy you replied, since most of the landsat model code was written by you. The comparison I'm doing is a binary diff, I'm working in Linux and I extract the raw binary data using "gdal_translate -of ENVI", using this creates a raw file of pixel data as well as header files, that way i can separate the image pixel data from the metadata. Using the raw pixel data I compare these to the input data and they are exactly the same (like nothing was done to the input image). 

 

Could you please have a look at the code piece attached and tell me if I'm doing it right (is a small file).

 

Thank you

-phil

 

 

 

On Tue, May 17, 2011 at 2:37 PM, Oscar L. Kramer <[hidden email]> wrote:

How are you comparing the two images? Using Imagelinker or Iview? I'm wondering if the viewer you are using is orthorectifying as well (as Imagelinker would do). In that case you wouldn't see a difference since both are displayed in the same projection.

Oscar


-----Original Message-----
From: Phil [mailto:[hidden email]]
Sent: Tuesday, May 17, 2011 07:29

To: [hidden email]
Subject: [OSSIM] RPC vs LandsatModel

Hi

Let me start off with I'm am no GIS expert... OK with that said, what is the
difference between using the RPC and the ossimLandsatModel? And can the
landsatModel be used to do orthorectification, if so then how?

I am trying to orthorectify Landsat scenes but I don't know what gives the
best results. I currently have an complete program that uses ossim to
generate RPC values from GCPs and then does the orthorectification. This
seems to work fine.

Now I am experimenting with the ossimLandsatModel, I have successfully got
the model going with the following:

-> ossimKeywordlist kwl;
->
-> ossimRefPtr<ossimFfL7> header = new
ossimFfL7("L71173065_06520020707_HRF.FST");
-> // header.get()->getErrorStatusString() displays OSSIM_OK, so I'm
assuming everything worked fine
-> // I also verified the header data vs the input FAST format header and it
all matches
->
-> // this loads creates the model as far as i know
-> ossimRefPtr<ossimLandSatModel> landsatModel = new
ossimLandSatModel(*header.get());
->
-> //now save the kwl and write it to some *.geom file
-> landsatModel->saveState(kwl);
-> kwl.write(outputFile);

This gives me the following file: "L71173065_06520020707_B50.geom"

Then I use "ossim-orthoigen L71173065_06520020707_B50.TIF output.TIF" to
create the orhorectified image.

Now when I compare the input "L71173065_06520020707_B50.TIF" to the output
"output.TIF" there is no difference at all, each and every pixel is the same
(same image size as well).

Is there something that I am missing when using the ossimLandatModel???

Thx very much in advance
-Phil




--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/RPC-vs-LandsatModel-tp6372705p6372705.html
Sent from the Ossim-developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list

[hidden email]

 

 


------------------------------------------------------------------------------

What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran

developers boost performance applications - including clusters.

http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list

[hidden email]


Error! Filename not specified.landsat_model____input.geom (3K) Download Attachment
Error! Filename not specified.landsat_model____ossimInfo (2K) Download Attachment
Error! Filename not specified.landsat_model____output.geom (994 bytes) Download Attachment
Error! Filename not specified.ossimRpcSolver_GCPs____input.geom (8K) Download Attachment
Error! Filename not specified.ossimRpcSolver_GCPs____ossimInfo (2K) Download Attachment
Error! Filename not specified.ossimRpcSolver_GCPs____output.geom (1K) Download Attachment

 


If you reply to this email, your message will be added to the discussion below:

http://osgeo-org.1803224.n2.nabble.com/RPC-vs-LandsatModel-tp6372705p6377666.html

To unsubscribe from RPC vs LandsatModel, click here.

 

 


View this message in context: Re: RPC vs LandsatModel
Sent from the Ossim-developer mailing list archive at Nabble.com.


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

Phil
Hi Oscar

Thank you for the explanation. I am a programmer but do not know much about sensor models. From what I understand the ossimLandsatModel will not work in my case, unless I can some how get back to the raw L0Rp format (and as you said its non trivial). If I have time I will have a look into this, as for now I am going to stick with the ossimRpcSolver with GCPs. Just to make sure, the ossimRpcSolver will work with the input being in UTM, right? The reason I am asking this is because, the output metadata (corner lat-lon and map coordinates) are wrong. It is as if ossim is applying UTM to a UTM image, or am I doing something wrong again? =)

I have made a previous post about this: ossim post metadata

Just have a look at the bold text, I got the other issue resolved with Dave's help.

This is the basic flow of my program at the moment:
1. Copy input scenes (they are in UTM L1G)
   a. Load metadata, making sure correct SRTM DEMs are in the correct folder, etc etc
2. Correlate chips to an image to obtain GCPs
3. Load those GCPs into the rpcSolver
4. Write the kwl to a *.geom file
5. Make a system call to ossim-orthoigen (Hoping this will be close to an L1T)


Now the result output images have very odd metadata. As you can see from the link above. Am I doing something wrong or am I missing something?

Thx again
-Phil

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

Garrett Potts
Hello Phil:

The only restriction on the RPC solver is that you include the corner points for I do not have a shift added into the solver.  This could be removed by adding a rectangle to the RpcSolver but not done it.  The RpcSolver just takes a list of tie points <lat, lon, hgt> <x,y> and then calculates a model using a weighted least squares fit.  


Take care

Garrett



On May 19, 2011, at 9:31 AM, Phil wrote:

> Hi Oscar
>
> Thank you for the explanation. I am a programmer but do not know much about
> sensor models. From what I understand the ossimLandsatModel will not work in
> my case, unless I can some how get back to the raw L0Rp format (and as you
> said its non trivial). If I have time I will have a look into this, as for
> now I am going to stick with the ossimRpcSolver with GCPs. Just to make
> sure, the ossimRpcSolver will work with the input being in UTM, right? The
> reason I am asking this is because, the output metadata (corner lat-lon and
> map coordinates) are wrong. It is as if ossim is applying UTM to a UTM
> image, or am I doing something wrong again? =)
>
> I have made a previous post about this:
> http://osgeo-org.1803224.n2.nabble.com/GeoTIFF-metadata-faults-td6344569.html
> ossim post metadata
>
> Just have a look at the bold text, I got the other issue resolved with
> Dave's help.
>
> This is the basic flow of my program at the moment:
> 1. Copy input scenes (they are in UTM L1G)
>   a. Load metadata, making sure correct SRTM DEMs are in the correct
> folder, etc etc
> 2. Correlate chips to an image to obtain GCPs
> 3. Load those GCPs into the rpcSolver
> 4. Write the kwl to a *.geom file
> 5. Make a system call to ossim-orthoigen (Hoping this will be close to an
> L1T)
>
> Now the result output images have very odd metadata. As you can see from the
> link above. Am I doing something wrong or am I missing something?
>
> Thx again
> -Phil
>
>
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/RPC-vs-LandsatModel-tp6372705p6381938.html
> Sent from the Ossim-developer mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> What Every C/C++ and Fortran developer Should Know!
> Read this article and learn how Intel has extended the reach of its
> next-generation tools to help Windows* and Linux* C/C++ and Fortran
> developers boost performance applications - including clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> www.ossim.org
> Ossim-developer mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/ossim-developer


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

Phil
Hi Garrett

I am not sure what you mean? This problem with the metadata happens even before I use the RPCs.

Example:

1. I have some input scene "input.tif" (this is the only file in the folder)
    a. This image is already in some projection (UTM)
2. I make a call to ossim-orthoigen --utm --disable-elev --meters 30 input.tif output.tif
    a. This produces an output image which should be exactly the same as the input, the input is already in UTM and the pixel resolution is already at 30m, I also disabled the elevation.

If on the other hand I use --geo instead of --utm then the output metadata is correct, but then I'm not in UTM any more, which I the images to be in.

If I generate the RPCs and do the ortho rectification the result is the same. BUT when I copy/keep the input.geom to output.geom the metadata is correct. Thus what I conclude is that the internal tiff metadata gets overwritten with incorrect values when I call ossim-orthoigen --utm... 

Is there some way to include the metadata from the *.geom into the output.tiff file?

Thx again
-Phil
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

Phil
Hi Garrett

And oh yea... From what I understand what you said, that means the model that the RPC solver generates will work for my scenes even if the input scenes are in UTM, right?

-Phil
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

oscarkramer
Phil,

You still have the fundamental problem that your image is L1G -- the image was "orthorectified" without the benefit of DEMs, so features in the image are placed in the wrong location on the map due to elevation changes. This shift is minimal for flat terrain but I believe your area has large relief. You need to back those shifts out using the rigorous model before you can reintersect with a DEM for a proper ortho.

Oscar

-----Original Message-----
From: Phil [mailto:[hidden email]]
Sent: Thursday, May 19, 2011 10:40
To: [hidden email]
Subject: Re: [OSSIM] RPC vs LandsatModel

Hi Garrett

And oh yea... From what I understand what you said, that means the model
that the RPC solver generates will work for my scenes even if the input
scenes are in UTM, right?

-Phil

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/RPC-vs-LandsatModel-tp6372705p6382260.html
Sent from the Ossim-developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

Phil
Hi Oscar

As I stated before I am no GIS expert, and sorry if this is a stupid question. What I understand what you mean is that the L1G images that I have needs to be in the same pixel order/structure as a raw format. See the picture below? Is that correct? Is this because the SRTM DEMs only fits onto the raw format (since now projection is applied to the DEMs)?

L1G -> Raw

Thx
-Phil
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

Phil
Hi Oscar

Please ignore the post above this one. I think I misunderstood you.

Can you please explain to me (the GIS newbie) what you mean with "rigorous model", or can you point me in the right direction?

Thx very very much for all you patience with me
-Phil
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RPC vs LandsatModel

oscarkramer
In reply to this post by Phil
Hey Phil,

It's not a question of format, but an issue of the processing that happenned to get from raw to L1G. The LGPS (ground processing system) took each pixel of the raw image and projected it onto a map without regard to DEM. That means the pixels will be on the wrong place in the map (the map here being the L1G UTM projection image). Say you have a pixel imaging/representing the top of a mountain, the lat/lon will be incorrect. If OSSIM does an elevation lookup for that location, it will give you the wrong elevation for the mountaintop. If you then use the mountaintop as a control point, the RPC solver is going to have to do some unnatural high-order warping to resolve that error. You will probably end up with some highly nonlinear solution that will probably have large errors in the regions without GCPs. In any case, Garrett brought up the issue of the RPC solver needing the corner points. Maybe RPC is not the way to go.

You need to take your UTM input image and reproject it to the landsat model projection (the "rigorous" model), using the default elevation used in generating the L1G (geoid? ellipsoid? average height? Dunno). That will give you something close to the L0 product. Then use the L0 product with LS model and your DEM and GCPs to generate you custom L1T. I am probably confusing you. This involves coding or paying someone to code it for you. My boss is on this list so I can't offer :)  Maybe somebody else on the list familiar with the OSSIM guts can help you. You can read an old document I wrote on OSSIM sensor modeling if you feel ambitious (attached). Good luck.

Oscar

-----Original Message-----
From: Phil [mailto:[hidden email]]
Sent: Thursday, May 19, 2011 11:21
To: [hidden email]
Subject: Re: [OSSIM] RPC vs LandsatModel

Hi Oscar

As I stated before I am no GIS expert, and sorry if this is a stupid
question. What I understand what you mean is that the L1G images that I have
needs to be in the same pixel order/structure as a raw format. See the
picture below? Is that correct? Is this because the SRTM DEMs only fits onto
the raw format (since now projection is applied to the DEMs)?

http://osgeo-org.1803224.n2.nabble.com/file/n6382437/Formats.png 

Thx
-Phil

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/RPC-vs-LandsatModel-tp6372705p6382437.html
Sent from the Ossim-developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

SensorModeling.pdf (387K) Download Attachment
Loading...