NULL pixel - Is there a way to know how many pixels are assigned NULL after applying "camtrim" function? And is there a way to output the NULL / Non-NULL image coordinate to a list? #5605
Replies: 3 comments 4 replies
-
To get the counts you can use stats. To get exact locations might be trickier, as far as I know there isn't an ISIS app that allows for this. You could use something like plio to get that information, but that is a bit more advanced python scripting. If you're interested in going that route I can give some code examples. Otherwise, I'll see if others at Astro know of a way to accomplish this via ISIS apps. |
Beta Was this translation helpful? Give feedback.
-
For the Non-NULL (and maybe NULL pixels), there is a 3rd party Python script, by Alessandro Frigeri, called pix2vect which simply wraps the ISIS routine campt. The routine was built to enable the conversion from raster pixels to vector polygons, which can help visualize oblique images or fly-by images (where the pixels are not always the same size in the image). So, while the routine pix2vect saves out all sides of every pixel, the code could be easily commented to just plot the information for the center of each pixel. I think you could simply comment out lines 130-134 (and maintain line 135), which should also speed up the run. So as a python-wrapped routine hitting campt, it is very slow. As a much faster version, Alessandro just submitted a C++ update to pixel2map to the ISIS Team. While it is still under review, if this version is approved, it might be released with a future version of ISIS. This C++ version is much much faster. To use this update of pix2map now, one would need to compile ISIS themselves (with his updates). |
Beta Was this translation helpful? Give feedback.
-
Seems like you'd be better off using something like rasterio to just query the pixel locations of NULL data pixels and extract their world coordinates (but that requires being able to write a little Python). |
Beta Was this translation helpful? Give feedback.
-
As titled. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions