Rough Homography fails - Cannot find matches

16 views
Skip to first unread message

christina Toldbo

unread,
Aug 10, 2022, 12:31:37 PMAug 10
to Ames Stereo Pipeline Support
Hello

I have two images that clearly have overlapping areas and when I use findip I find key points. However if I try matchip or parallel_stereo, it tells me that the rough homography fails and that it cannot match the images.

Does anyone have an idea how I can debug this? I have tried increasing the --ip-per-tile, I have tried supressing the rough homography, I have tried with another pair of images.

The images I have are generated from a model of vesta and I can see that when I run caminfo on them I only achieve an UpperLeftLongitude and UpperLeftLatitude but the LowerLeftLongitude, LowerLeftLatitude, LowerRightLongitude, LowerRightLatitude, UpperRightLongitude and UpperRightLatitude all have NULL value. Is this the culprit? i.e. is it this information that is used for the rought homography?

If yes, then where does these keywords come from? or can I set them manually?  

below is the output when I run parallel_stereo on the images:

Using tiles (before collar addition) of 2048 x 2048 pixels.
Using a collar (padding) for each tile of 0 pixels.

Stage 0 --> PREPROCESSING
    --> Setting number of processing threads to: 4
Using stereo file /Users/toldbo/workArea/stereo.default.
Writing log info to: /Users/toldbo/workArea/SynthVesta_Survey/test/results/-log-stereo_pprc-08-10-0913-37956.txt
Using session: isis
Loading camera model: /Users/toldbo/workArea/SynthVesta_Survey/test/D01710280060.cub
Loading camera model: /Users/toldbo/workArea/SynthVesta_Survey/test/D01710272860.cub
Distance between camera centers in meters: 130744.
Using image files:  /Users/toldbo/workArea/SynthVesta_Survey/test/D01710280060.cub, /Users/toldbo/workArea/SynthVesta_Survey/test/D01710272860.cub
    --> Computing statistics for left
      left: [ lo:0 hi:253 m: 127.325 s: 45.9779]
    --> Computing statistics for right
      right: [ lo:0 hi:252 m: 116.827 s: 49.1582]
    --> Normalizing globally to: [0 253]
    --> Matching interest points in StereoSession.
        Using epipolar threshold = 96.5436
        IP uniqueness threshold  = 0.7
        Datum:                     Geodetic Datum --> Name: D_VESTA  Spheroid: VESTA  Semi-major axis: 284500  Semi-minor axis: 229000  Meridian: Reference Meridian at 0  Proj4 Str: +a=284500 +b=229000
        Using rough homography.
Performing IP matching with alignment.
        Rough homography--> [****************************************] Complete!
Rough homography fit failed, trying with identity transform.
Aligning right to left for IP capture using rough homography: Matrix3x3((1,0,0)(0,1,0)(0,0,1))
        Looking for IP in left image...
        Using 5000 interest points per tile (1024^2 px).
        Detecting IP
        Removing IP near nodata with radius 4
        Building descriptors
        Found interest points: 5000
        Recording interest points to file: /Users/toldbo/workArea/SynthVesta_Survey/test/results/-D01710280060.vwip
        Looking for IP in right image...
        Using 5000 interest points per tile (1024^2 px).
        Detecting IP
        Removing IP near nodata with radius 4
        Building descriptors
        Found interest points: 5000
    --> Matching interest points using the epipolar line.
        Uniqueness threshold: 0.7
        Epipolar threshold:   96.5436
        Matching forward
        Using 1 thread(s) for matching.
        ---> Obtained 5000 matches.
        Matching backward
        Using 1 thread(s) for matching.
        ---> Obtained 5000 matches.
        Matched 0 points.



VW Error: Unable to match left and right images.
Traceback (most recent call last):
  File "/Users/toldbo/opt/anaconda3/envs/asp/bin/parallel_stereo", line 995, in <module>
    normal_run('stereo_pprc', args, msg='%d: Preprocessing' % step)
  File "/Users/toldbo/opt/anaconda3/envs/asp/bin/parallel_stereo", line 661, in normal_run
    raise Exception('Stereo step ' + kw['msg'] + ' failed')
Exception: Stereo step 0: Preprocessing failed


Alexandrov, Oleg (ARC-TI)[KBR Wyle Services, LLC]

unread,
Aug 10, 2022, 1:02:57 PMAug 10
to christina Toldbo, Ames Stereo Pipeline Support
I don't think ASP uses the LowerLeftLongitude info, etc. Yes, you can try skipping rough homography. You can try to change ip-detect-method, increase ip-inlier-factor. There is more info here: https://stereopipeline.readthedocs.io/en/latest/stereodefault.html.

You can try opening the images in stereo_gui and see if they are visually similar enough, especially when it comes to illumination direction. 


Synthetic images may be tricky. 

Are you having any luck with real images? 







From: ames-stereo-pi...@googlegroups.com <ames-stereo-pi...@googlegroups.com> on behalf of christina Toldbo <christin...@gmail.com>
Sent: Wednesday, August 10, 2022 9:31 AM
To: Ames Stereo Pipeline Support <ames-stereo-pi...@googlegroups.com>
Subject: [EXTERNAL] Rough Homography fails - Cannot find matches
 
--
You received this message because you are subscribed to the Google Groups "Ames Stereo Pipeline Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ames-stereo-pipeline...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ames-stereo-pipeline-support/08bd9f04-add0-4576-bd9f-eeb11764dc3an%40googlegroups.com.

christina Toldbo

unread,
Aug 10, 2022, 1:24:22 PMAug 10
to Ames Stereo Pipeline Support
Thank you :)

If I skip the rough homography it runs the parallel_stereo to the end, but the DEM is gibberish (see attached). Regardless of which IP method I use I find a lot of points for each image (5000 if I ask for it) and I have checked this with ipfind and plotted the IPs on top of the images and it has enough points and they 'make sense'. When I open the images in stereo_gui they look similar, well lit and with features in each that I recognize (attached). It works perfectly for the true Dawn Vesta images from the PDS. So I am just trying to get an idea of the dependencies of ASP - to me it seems that it thinks that the images do not overlap or something? That is why I thought it might have something to do with the footprint.

best,
Christina
DEM.png
Screen Shot 2022-08-10 at 10.15.48 AM.png

Alexandrov, Oleg (ARC-TI)[KBR Wyle Services, LLC]

unread,
Aug 10, 2022, 1:44:56 PMAug 10
to christina Toldbo, Ames Stereo Pipeline Support
You can try to examine the filtered disparity F.tif with disparitydebug (https://stereopipeline.readthedocs.io/en/latest/tools/disparitydebug.html). If it looks good, the problem is in triangulation. So, your cameras.

It is too early to say that DEM is total gibberish. Maybe the projection is wrong. You can try point2dem with stereographic projection, with its lon-lat center somewhere in your area of interest (in stereo_gui, if you do Control-Mouse-Drag in a small region it should tell you its lon-lat position). See an example in https://stereopipeline.readthedocs.io/en/latest/tools/point2dem.html for how to use the stereographic projection.

You can also try running stereo only a on a small region from stereo_gui (see its manual for how), then run:

point2dem <your projection> run/run-PC.tif run/run-L.tif --orthoimage --errorimage.

The --orthoimage thing will create an image overlayed onto your DEM, and the --errorimage will create an intersection error map which can be inspected with stereo_gui (after colorizing). If the ray intersection errors in that map look high relative to your known pixel size length on the ground,  that will also mean the cameras are wrong as opposed to the images.

Then, I wonder what happens if you run cam2map on your cubes. One can peek at the projection of those images with gdalinfo -proj4, and can overlay them in stereo_gui as georeferenced images. That should also tell you if you have a projection/camera issue or an image issue. 




Sent: Wednesday, August 10, 2022 10:24 AM

To: Ames Stereo Pipeline Support <ames-stereo-pi...@googlegroups.com>
Subject: Re: [EXTERNAL] Rough Homography fails - Cannot find matches
 

christina Toldbo

unread,
Aug 10, 2022, 5:30:17 PMAug 10
to Ames Stereo Pipeline Support
Thank you so much for your help. I have tried to perform each of the steps you describe. 

examine the filtered disparity F.tif
I am in doubt what is meant by ''looks good' - it is supposed to show the features of the image right? like a hazy height-map (F file attached).
try point2dem with stereographic projection
point2dem --stereographic --proj-lon 418 --proj-lat 252 -PC.tif (with the 418 and 252 coming from stereo_gui) then I get another DEM but it looks similar to before (attached)
Control-Mouse-Drag in a small region should tell you lon-lat position
It gives me bounds but not in lon-lat - the values are [225 255 443 352].
running stereo only a on a small region from stereo_gui and then point2dem
I picked a region where the .match file showed matches ( - see attached). I get the error:
Aligning right to left for IP capture using rough homography: Matrix3x3((0.963969,0.214737,0)(-0.229791,0.959385,0)(-1.52684e-05,-9.61199e-06,1))
Post homography has largely different scale and skew from rough fit. Post solution is Matrix3x3((-1.70885,-5.91283,365.211)(0.0472243,-12.4091,527.865)(0.00214991,-0.0455213,1)). Examine your images. RANSAC Error.  Number of requested inliers is less than min number of elements needed for fit.
run point2dem <your projection> run/run-PC.tif run/run-L.tif --orthoimage --errorimage
Overlay and intersection error map attached  - with stereographic projection (orthographic projection give:
'Bad projection in GeoReference.cc. Proj.4 error: tolerance condition error. Location is Vector2(-90.009,75.4889).'
If the ray intersection errors in that map look high that will also mean the cameras are wrong as opposed to the images.
The intersectionerror.tif is completely white. also in the error message for the chopped region says: Triangulation error: 14505 +- 802.514 meters

Am I wrong to assume that the results of this means something is wrong with the camera model?
DRG.png
F.png
DEM.png
Screen Shot 2022-08-10 at 1.53.52 PM.png
Screen Shot 2022-08-10 at 1.53.52 PM.png

Alexandrov, Oleg (ARC-TI)[KBR Wyle Services, LLC]

unread,
Aug 10, 2022, 5:42:56 PMAug 10
to christina Toldbo, Ames Stereo Pipeline Support
>examine the filtered disparity F.tif
>I am in doubt what is meant by ''looks good' - it is supposed to show the features of the image right? like a hazy height-map (F file attached).

Looks decent enough.

> try point2dem with stereographic projection
> point2dem --stereographic --proj-lon 418 --proj-lat 252 -PC.tif (with the 418 and 252 coming from stereo_gui) then I get another DEM but it looks similar to before (attached)
> Control-Mouse-Drag in a small region should tell you lon-lat position
> It gives me bounds but not in lon-lat - the values are [225 255 443 352].

You chose to use the pixel coordinates. I should have been more clear. This should be run on a georeferenced image, such as a DEM, orthoimage, or the result of cam2map. Then stereo_gui will give you a lon and lat value. The above are wrong, of course, as longitude must be in [-180, 180] or [0, 360], and latitude in [-90, 90] degrees.

> running stereo only a on a small region from stereo_gui and then point2dem
> I picked a region where the .match file showed matches ( - see attached). I get the error:
> Aligning right to left for IP capture using rough homography: Matrix3x3((0.963969,0.214737,0)(-0.229791,0.959385,0)(-1.52684e-05,-9.61199e-06,1))
> Post homography has largely different scale and skew from rough fit. Post solution is Matrix3x3((-1.70885,-5.91283,365.211)(0.0472243,-12.4091,527.865)> (0.00214991,-0.0455213,1)). Examine your images. RANSAC Error.  Number of requested inliers is less than min number of elements needed for fit.

I guess you can use a bigger --ip-per-tile to get more matches, or make the selection clips bigger, or both.

> run point2dem <your projection> run/run-PC.tif run/run-L.tif --orthoimage --errorimage
> Overlay and intersection error map attached  - with stereographic projection (orthographic projection give:
> 'Bad projection in GeoReference.cc. Proj.4 error: tolerance condition error. Location is Vector2(-90.009,75.4889).'

Yep, per above, the longitude and latitude is not correct. 

> If the ray intersection errors in that map look high that will also mean the cameras are wrong as opposed to the images.
> The intersectionerror.tif is completely white. also in the error message for the chopped region says: Triangulation error: 14505 +- 802.514 meters
> Am I wrong to assume that the results of this means something is wrong with the camera model?

Yes, this is quite terrible. Unless your camera has a ground resolution of 1000 meters, which is likely not the case.

You can try again with a good longitude and latitude in stereo_gui, based maybe on your terrible DEM, which should at and also with bigger crop windows in stereo_gui. 

The hope you can narrow things down somewhat on a reasonable set of clips and choose an appropriate projection for those clips.

Did you run cam2map on your inputs and overlay the outputs as georeferenced images in stereo_gui or in qview? That should be another way of getting a georerefenced images, from which you could guess in stereo_gui a good longitude-latitude. (Or you can use gdalinfo for that, it prints the lon-lat bounds and center of a georeferenced image.)  And cam2map should give you an idea of how your images look projected onto your planet, which is a good thing to know.

Reply all
Reply to author
Forward
0 new messages