Help for MARSDISPCOMPARE

PURPOSE:
This program is meant to be part of processing chain which ends up 
with L->R disparity image, a R->L disparity image, and  a mask 
indicating which values in the l->R disparity image should be ignored.
This is determined by comparing the L->R and R->L results for consistency.
If they don't map to the same result, the pixel is rejected.

EXECUTION:
marsdispcompare inp=(left,right) out=disparity_mask 


where:
left is the L->R disparity image
right is the R->L disparity image
out is the output mask indicating which disparity values in the left 
image to be ignored.

All of these images can be created with marscor3. 

METHOD:

The program loops through every pixel in the disparity image.  
For each pixel (optionally satisfying a quality threshold) in the L->R 
disparity image, 
the  location in the R->L disparity image is found. At this location, 
which is commonly not an integer, A bilinear interpolation is 
performed using the 4 nearest neighbors. 
(Optionally, the interpolation may be limited to the case where all nearest
neighbors satisfy a quality threshold) 
This interpolated value gives a location in L->R image. If this location 
is close to the original pixel, satisfying a user specified threshold, 
the output mask value is set to 0. Otherwise, it is set to 1. 
This creates the mask for the L->R disparity image. The mask for the R->L
disparity image may be obtained by running marsdispcompare again with 
RL and LR switched.

The following set of commands demonstrate how the mask is created
1) ./marsjplstereo inp= \(SS009FFL897017919_11A7EL1M1.IMG,
SS009FFL897017919_11A7ER1M1.IMG \) out=DISPLR.IMG MAXDISP=25   
This creates the low quality L->R disparity image
2)~/marsdispinvert/marsdispinvert INP=DISPLR.IMG OUT=DISPRL.IMG FILL_VALUE=127
This creates a low quality R->L disparity image with default value set to 127. 
The default value can be determined by inspection of the original images. 
Note: This value is a delta value;
3)./marscor3 inp=\(SS009FFL897017919_11A7EL1M1.IMG,SS009FFL897017919_11A7ER1M1.IMG\) 
out=DISP2LR.IMG in_disp=DISPLR.IMG  
This creates the high quality disparity. 
4)./marscor3 inp=\(SS009FFL897017919_11A7ER1M1.IMG,SS009FFL897017919_11A7EL1M1.IMG\) 
out=DISP2RL.IMG in_disp=DISPRL.IMG
The creates the high quality R->L disparity.
5)  ./marsdispcompare INP=\(DISP2LR.IMG,DISP2RL.IMG\) OUT=out.msk
This creates the disparity mask. 



HISTORY:
09-16-09 Initial
08-27-20 F.Ayoub: Addition of SCALING

COGNIZANT PROGRAMMER:  Mathew Yeates


PARAMETERS:


INP

input images. first: left to right disparity image second: right to left disparity image

O_THRESH

outlier (in pixels) threshold.

MINDIST

distance (in pixels) threshold.

OUT

output disparity mask

QUALITYRL

input R-> L disparity quality image

QUALITYLR

input L-> R disparity quality image

SCALING

Activate scaling of thresholds

QUALITY_THRESH

Two thresholds that the values in the quality images must satisfy. first - left disparity image second - right disparity image

See Examples:


Cognizant Programmer: