Chipping to valid projection

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Chipping to valid projection

Andyjo

So I’m running into some issues with having nodata values in the middle of our imagery (shadows of course), 3 band, (0,0,0). This usually wouldn’t be an issue if I were to crop down mosaics to not include jagged collection edges, but when I do i’d like to be able to retain the information contained in the imagery, and set everything around the imagery to nodata…

 

Another way to say it… I have a jagged polygon containing actual imagery, whereas the entire output image is larger (bounding box of the jagged polygon). Data outside the polygon is set to nodata correctly, but we have data inside the imagery which is actually (0,0,0), but I’d like to flip it to (1,1,1) for transparency reasons later on.

 

So, what is the correct way to flip pixels from (0,0,0) to (1,1,1) inside valid projection areas?

 

In orthoigen I tried most combinations of: --clip-pixels, --clamp-pixels, --replacement-mode, and –clip-to-valid-rect but haven’t had any luck yet. It seems like what I really want is something like ‘--clip-to-valid-projection’.

It looks like I might be able to do it with the  --mask option, but honestly think there has to be a better way than unioning all of the polygons and writing a shape file!

 

I can send a screenshot of the issue if that helps

 

I’m sure everyone runs into this issue…

 

Any help would be great! Thanks!

 

Andrew Johnson


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

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Chipping to valid projection

Andyjo

It looks like the answer to this problem might be to run the following on every source image prior to piping everything into orthoigen…

ossim-pixelflip –m replace_full_targets <output_type> <input_file> <output_file> 0 1

 

using –clamp-pixels in orthoigen ‘sort of’ worked, but I was getting some odd artifacts along edges.

 

Andrew Johnson

 

From: Andrew D. Johnson
Sent: Tuesday, August 12, 2014 11:51 AM
To: [hidden email]
Subject: Chipping to valid projection

 

So I’m running into some issues with having nodata values in the middle of our imagery (shadows of course), 3 band, (0,0,0). This usually wouldn’t be an issue if I were to crop down mosaics to not include jagged collection edges, but when I do i’d like to be able to retain the information contained in the imagery, and set everything around the imagery to nodata…

 

Another way to say it… I have a jagged polygon containing actual imagery, whereas the entire output image is larger (bounding box of the jagged polygon). Data outside the polygon is set to nodata correctly, but we have data inside the imagery which is actually (0,0,0), but I’d like to flip it to (1,1,1) for transparency reasons later on.

 

So, what is the correct way to flip pixels from (0,0,0) to (1,1,1) inside valid projection areas?

 

In orthoigen I tried most combinations of: --clip-pixels, --clamp-pixels, --replacement-mode, and –clip-to-valid-rect but haven’t had any luck yet. It seems like what I really want is something like ‘--clip-to-valid-projection’.

It looks like I might be able to do it with the  --mask option, but honestly think there has to be a better way than unioning all of the polygons and writing a shape file!

 

I can send a screenshot of the issue if that helps

 

I’m sure everyone runs into this issue…

 

Any help would be great! Thanks!

 

Andrew Johnson


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

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Chipping to valid projection

David Burken
Hi Andrew,

ossim-pixelflip was written for that.  It's actually a filter you can insert into an image chain.  With that and a mask filter you can really do a bunch of stuff.   Where you'll get into trouble is when you have valid nulls and data with all 0's.  Note that orthoigen also has many options to flip and mask values.  Not for the weak at heart though.

Dave


On 08/12/2014 12:06 PM, Andrew D. Johnson wrote:

It looks like the answer to this problem might be to run the following on every source image prior to piping everything into orthoigen…

ossim-pixelflip –m replace_full_targets <output_type> <input_file> <output_file> 0 1

 

using –clamp-pixels in orthoigen ‘sort of’ worked, but I was getting some odd artifacts along edges.

 

Andrew Johnson

 

From: Andrew D. Johnson
Sent: Tuesday, August 12, 2014 11:51 AM
To: [hidden email]
Subject: Chipping to valid projection

 

So I’m running into some issues with having nodata values in the middle of our imagery (shadows of course), 3 band, (0,0,0). This usually wouldn’t be an issue if I were to crop down mosaics to not include jagged collection edges, but when I do i’d like to be able to retain the information contained in the imagery, and set everything around the imagery to nodata…

 

Another way to say it… I have a jagged polygon containing actual imagery, whereas the entire output image is larger (bounding box of the jagged polygon). Data outside the polygon is set to nodata correctly, but we have data inside the imagery which is actually (0,0,0), but I’d like to flip it to (1,1,1) for transparency reasons later on.

 

So, what is the correct way to flip pixels from (0,0,0) to (1,1,1) inside valid projection areas?

 

In orthoigen I tried most combinations of: --clip-pixels, --clamp-pixels, --replacement-mode, and –clip-to-valid-rect but haven’t had any luck yet. It seems like what I really want is something like ‘--clip-to-valid-projection’.

It looks like I might be able to do it with the  --mask option, but honestly think there has to be a better way than unioning all of the polygons and writing a shape file!

 

I can send a screenshot of the issue if that helps

 

I’m sure everyone runs into this issue…

 

Any help would be great! Thanks!

 

Andrew Johnson



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


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer


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

_______________________________________________
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
|

Re: Chipping to valid projection

Andyjo

Thanks Dave,

So if I can insert the pixel flipper into the image chain, I’m assuming I should be able to put it directly after loading of the imagery (from a .src file). Or should it be deeper in the chain at the getTile level? Is there a way I can just dump a spec file from orthoigen, and pixelflipper, then manually combine them?

Sorry if these aren’t well formed questions, I haven’t jumped into the code to see how to do it yet.

 

As for the orthoigen options, I think I can do it all via command line, but have to create a shape file mask, but  honestly don’t feel like writing another program to make a shape file, to then pipe into orthoigen…. Unless there’s already something in ossim to do it that I don’t know about!

 

Thanks again for your help!

 

Andrew Johnson

 

From: David Burken [mailto:[hidden email]]
Sent: Tuesday, August 12, 2014 7:19 PM
To: [hidden email]; Andrew D. Johnson
Subject: Re: [OSSIM] Chipping to valid projection

 

Hi Andrew,

ossim-pixelflip was written for that.  It's actually a filter you can insert into an image chain.  With that and a mask filter you can really do a bunch of stuff.   Where you'll get into trouble is when you have valid nulls and data with all 0's.  Note that orthoigen also has many options to flip and mask values.  Not for the weak at heart though.

Dave

On 08/12/2014 12:06 PM, Andrew D. Johnson wrote:

It looks like the answer to this problem might be to run the following on every source image prior to piping everything into orthoigen…

ossim-pixelflip –m replace_full_targets <output_type> <input_file> <output_file> 0 1

 

using –clamp-pixels in orthoigen ‘sort of’ worked, but I was getting some odd artifacts along edges.

 

Andrew Johnson

 

From: Andrew D. Johnson
Sent: Tuesday, August 12, 2014 11:51 AM
To: [hidden email]
Subject: Chipping to valid projection

 

So I’m running into some issues with having nodata values in the middle of our imagery (shadows of course), 3 band, (0,0,0). This usually wouldn’t be an issue if I were to crop down mosaics to not include jagged collection edges, but when I do i’d like to be able to retain the information contained in the imagery, and set everything around the imagery to nodata…

 

Another way to say it… I have a jagged polygon containing actual imagery, whereas the entire output image is larger (bounding box of the jagged polygon). Data outside the polygon is set to nodata correctly, but we have data inside the imagery which is actually (0,0,0), but I’d like to flip it to (1,1,1) for transparency reasons later on.

 

So, what is the correct way to flip pixels from (0,0,0) to (1,1,1) inside valid projection areas?

 

In orthoigen I tried most combinations of: --clip-pixels, --clamp-pixels, --replacement-mode, and –clip-to-valid-rect but haven’t had any luck yet. It seems like what I really want is something like ‘--clip-to-valid-projection’.

It looks like I might be able to do it with the  --mask option, but honestly think there has to be a better way than unioning all of the polygons and writing a shape file!

 

I can send a screenshot of the issue if that helps

 

I’m sure everyone runs into this issue…

 

Any help would be great! Thanks!

 

Andrew Johnson




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




_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

 


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

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Chipping to valid projection

David Burken
On 08/13/2014 08:38 AM, Andrew D. Johnson wrote:

Thanks Dave,

So if I can insert the pixel flipper into the image chain, I’m assuming I should be able to put it directly after loading of the imagery (from a .src file). Or should it be deeper in the chain at the getTile level?

You would want to do after the reader but before the renderer.

Is there a way I can just dump a spec file from orthoigen, and pixelflipper, then manually combine them?

Sorry if these aren’t well formed questions, I haven’t jumped into the code to see how to do it yet.

There is a ''--chain-template".  Also a --clip-to-valid-rect.  See "ossim-extract-vertices".  Also "ossim-create-bitmask"

Not sure I understand.  ossim-igen takes a spec file.  It's tricky though generating valid spec files.  If you want to see one you can do "ossim-orthoigen -T "ossimIgen:log" <your_orthoigen_args>

You get a spec file. You should be able to do:  ossim-igen <your_spec_file>

 

As for the orthoigen options, I think I can do it all via command line, but have to create a shape file mask, but  honestly don’t feel like writing another program to make a shape file, to then pipe into orthoigen…. Unless there’s already something in ossim to do it that I don’t know about!

You would need a mask of the valid image only.  See above comments.

 

Thanks again for your help!

 

Andrew Johnson


Talk to you later,
Dave


 

From: David Burken [[hidden email]]
Sent: Tuesday, August 12, 2014 7:19 PM
To: [hidden email]; Andrew D. Johnson
Subject: Re: [OSSIM] Chipping to valid projection

 

Hi Andrew,

ossim-pixelflip was written for that.  It's actually a filter you can insert into an image chain.  With that and a mask filter you can really do a bunch of stuff.   Where you'll get into trouble is when you have valid nulls and data with all 0's.  Note that orthoigen also has many options to flip and mask values.  Not for the weak at heart though.

Dave

On 08/12/2014 12:06 PM, Andrew D. Johnson wrote:

It looks like the answer to this problem might be to run the following on every source image prior to piping everything into orthoigen…

ossim-pixelflip –m replace_full_targets <output_type> <input_file> <output_file> 0 1

 

using –clamp-pixels in orthoigen ‘sort of’ worked, but I was getting some odd artifacts along edges.

 

Andrew Johnson

 

From: Andrew D. Johnson
Sent: Tuesday, August 12, 2014 11:51 AM
To: [hidden email]
Subject: Chipping to valid projection

 

So I’m running into some issues with having nodata values in the middle of our imagery (shadows of course), 3 band, (0,0,0). This usually wouldn’t be an issue if I were to crop down mosaics to not include jagged collection edges, but when I do i’d like to be able to retain the information contained in the imagery, and set everything around the imagery to nodata…

 

Another way to say it… I have a jagged polygon containing actual imagery, whereas the entire output image is larger (bounding box of the jagged polygon). Data outside the polygon is set to nodata correctly, but we have data inside the imagery which is actually (0,0,0), but I’d like to flip it to (1,1,1) for transparency reasons later on.

 

So, what is the correct way to flip pixels from (0,0,0) to (1,1,1) inside valid projection areas?

 

In orthoigen I tried most combinations of: --clip-pixels, --clamp-pixels, --replacement-mode, and –clip-to-valid-rect but haven’t had any luck yet. It seems like what I really want is something like ‘--clip-to-valid-projection’.

It looks like I might be able to do it with the  --mask option, but honestly think there has to be a better way than unioning all of the polygons and writing a shape file!

 

I can send a screenshot of the issue if that helps

 

I’m sure everyone runs into this issue…

 

Any help would be great! Thanks!

 

Andrew Johnson




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




_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

 



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

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer