Is there are way to determine the row and column of a pixel in an un-orthorectified image that corresponds to a latitude and longitude given a particular DEM? That is, convert a spatial coordinate to a row,col coordinate for a specific RPC file and DEM source?
Use case: I have a stack of satellite images in nitf format and lat,lon coordinates for points of interest. I want to crop the images around each of the POIs and circumvent any pixel distortions due to orthorectification. So rather than orthorectify the images and crop them around a lat,lon, I want to convert the lat,lon to row,col and crop the un-orthorectified image.
Current approach: The only way I can think to do this for a particular image is to:
- Create a new 2-band image that is the same size as the original image where the pixel values are the row and column.
- Orthorectify this new image
- Sample the new image at a lat,lon to get a row,col coordinate.
For my processing I'm using Python and GDAL bindings.
Problem: This approach seems very inefficient with time and memory, and I don't fully understand the accuracy and precision. So if it's possible, I would prefer to essentially reverse-orthorectify a lat,lon coordinate.