I'm attempting to mosaic a set of .sid images using an LTIMosaicFilter. One issue I have is that the image tiles overlap slightly, but our client who created the images using GeoExpress didn't set either the NoDataPixel or background colors, even though each image tile has some black border where there's no data available. The resulting problem is that when creating the mosaic, the filter doesn't recognise when dealing with overlapped regions that the black pixels means no data, and proceeds to use these in preference to the good data from the underneath tile.
From looking at the reference manual, I can see there's a LTIOverrideBackgroundPixelData class with a setNoDataPixel method, but I can't work out how to apply this to my MrSIDImageReader instances to set the NoData pixel color to black so that the mosaicFilter would then (hopefully!) use the good data in preference.
A code snippet showing how I could achieve this would be very much appreciated!
Overriding the NoDataPixel value
Moderator: jskiffington
3 posts
• Page 1 of 1
Thanks Chris, have got it working now. I think the problem was I was trying to set the no data pixel in the second parameter to the mosaicFilter->initialize(), rather than setting it for each reader before adding them to the stage manager.
I was initially not sure how to set the actual pixel color, but then realised for black it's easy as the pixel constructor sets the values to 0 as default, so by doing:
for each reader, the no data pixel gets set correctly and the composite image from the mosaic filter now works great, correctly using the good data in preference to the black border pixels.
Thanks again for your help
I was initially not sure how to set the actual pixel color, but then realised for black it's easy as the pixel constructor sets the values to 0 as default, so by doing:
- Code: Select all
LTIPixel ndPixel (reader->getColorSpace(),reader->getNumBands(),reader->getDataType());
reader->overrideNoDataPixel(&ndPixel);
for each reader, the no data pixel gets set correctly and the composite image from the mosaic filter now works great, correctly using the good data in preference to the black border pixels.
Thanks again for your help
- Tubaman
- Posts: 3
- Joined: Mon Feb 28, 2011 8:31 am
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
- Forum index
- The team • Delete all board cookies • All times are UTC - 7 hours
