Skip to content
Browse files

Rename DEM acuracy to DEM error. Add documentation

  • Loading branch information...
1 parent 8687a06 commit 71568e5fa97124f2842bb792acbef25370ed6601 @oleg-alexandrov oleg-alexandrov committed Apr 10, 2013
View
24 docs/book/correlation.tex
@@ -12,7 +12,7 @@ \chapter{Correlation}
parameters in the \texttt{stereo.default} file. For scientists and
engineers who are using \acp{DEM} produced with the Stereo Pipeline, this
chapter may help to answer the question, ``What is the Stereo Pipeline
-doing to the raw data to produce this \ac{DEM}?''
+doing to the raw data to produce this \ac{DEM}?''
A related question that is commonly asked is, ``How accurate is a \ac{DEM}
produced by the Stereo Pipeline?'' This chapter does not yet address
@@ -35,7 +35,7 @@ \section{Pre-processing}
The first optional (but recommended) step in the process is least
squares Bundle Adjustment, which is described in detail in
-Chapter~\ref{ch:bundle_adjustment}.
+Chapter~\ref{ch:bundle_adjustment}.
Next, the left and right images are roughly aligned using one of three
methods: (1) a homography transform of the right image based on
@@ -110,7 +110,7 @@ \section{Disparity Map Initialization}
disparity map as an image whose pixel locations correspond to
the pixel $(u,v)$ in the left image, and whose pixel values
contain the horizontal and vertical offsets $(d_u, d_v)$ to the
-matching pixel in the right image, which is $(u+d_u, v+d_v)$.
+matching pixel in the right image, which is $(u+d_u, v+d_v)$.
The correlation process attempts to find a match for every pixel in
the left image. The only pixels skipped are those marked invalid in
@@ -152,7 +152,7 @@ \section{Disparity Map Initialization}
region of the right image, as in Figure~\ref{fig:correlation_window}.
The ``best'' match is determined by applying a cost function that
compares the two windows. The location at which the window evaluates
-to the lowest cost compared to all the other search locations is
+to the lowest cost compared to all the other search locations is
reported as the disparity value. The \texttt{cost-mode} variable allows you
to choose one of three cost functions, though we recommend normalized
cross correlation \citep{Menard97:robust}, since it is most robust to
@@ -181,7 +181,7 @@ \section{Disparity Map Initialization}
\texttt{\textit{output\_prefix}-D\_sub.tif}, we are allowed to
process beyond that limitation.
-Finally, this might go with out saying, but any colossal failure in
+Any large failure in
the low resolution disparity image will be detrimental to the
performance of the higher resolution disparity. In the event that the
low resolution disparity is completely unhelpful, it can be skipped by
@@ -190,6 +190,16 @@ \section{Disparity Map Initialization}
image is completely lost when subsampled. An example would be
satellite imagery of fresh snow in the arctic.
+An alternative to computing \texttt{\textit{output\_prefix}-D.tif}
+from sub-sampled images (\texttt{corr-seed-mode 1}) or skipping it
+altogether (\texttt{corr-seed-mode 0}), is to compute it from a
+lower-resolution DEM of the area (\texttt{corr-seed-mode 2}). In this
+situation, the DEM needs to be specified together with its estimated
+error. See section \ref{corr_section} for more detailed information as
+to how to specify these options. In our experiments, if the input DEM
+has a resolution of 1 km, a good value of the DEM error is about 10 m,
+or higher if the terrain is very variable.
+
\subsection{Debugging Disparity Map Initialization}
Never will all pixels be successfully matched during stereo
@@ -301,7 +311,7 @@ \section{Sub-pixel Refinement}
as it zeros in on the correct match in the right image. This
adaptive window is essential for computing accurate matches on crater
or canyon walls, and on other areas with significant perspective
-distortion due to foreshortening.
+distortion due to foreshortening.
This affine-adaptive behavior is based on the Lucas-Kanade template
tracking algorithm, a classic algorithm in the field of computer
@@ -369,7 +379,7 @@ \section{Triangulation}
\caption{Once a disparity map has been generated and refined, it can
be used in combination with the geometric camera models to compute
the locations of 3D points on the surface of Mars. This figure
- shows the position (at the origins of the red, green, and blue vectors) and
+ shows the position (at the origins of the red, green, and blue vectors) and
orientation of the Mars Global Surveyor at
two points in time where it captured images in a stereo pair.}
\label{fig:triangulation}
View
8 docs/book/stereodefault.tex
@@ -85,7 +85,7 @@ \section{Preprocessing}
\end{description}
-\section{Correlation}
+\section{Correlation}\label{corr_section}
\hrule
\bigskip
@@ -144,8 +144,10 @@ \section{Correlation}
resolutions due to its independent and tiled nature. This
low-resolution disparity seed is a good hybrid approach.
\item[2 - Low-resolution disparity from an input DEM] - Use a DEM together with an estimated
- value for its accuracy to compute a low-resolution disparity, which will then be used
- to find the full-resolution disparity as above.
+ value for its error to compute a low-resolution disparity, which will then be used
+ to find the full-resolution disparity as above. These quantities
+ can be specified via the options \texttt{disparity-estimation-dem}
+ and \texttt{disparity-estimation-dem-error} respectively.
\end{description}
For large images, bigger than MOC-NA, using the low-resolution
View
26 src/asp/Core/DemDisparity.cc
@@ -37,7 +37,7 @@ namespace asp {
template <class ImageT, class DEMImageT>
class DemDisparity : public ImageViewBase<DemDisparity<ImageT, DEMImageT> > {
ImageT m_left_image;
- double m_dem_accuracy;
+ double m_dem_error;
GeoReference m_dem_georef;
const DEMImageT & m_dem;
Vector2f m_downsample_scale;
@@ -50,15 +50,15 @@ namespace asp {
public:
DemDisparity( ImageViewBase<ImageT> const& left_image,
- double dem_accuracy, GeoReference dem_georef,
+ double dem_error, GeoReference dem_georef,
DEMImageT const& dem,
Vector2f const& downsample_scale,
boost::shared_ptr<camera::CameraModel> left_camera_model,
boost::shared_ptr<camera::CameraModel> right_camera_model,
bool homography_align, Matrix<double> const& align_matrix,
int pixel_sample, ImageView<PixelMask<Vector2i> > & disparity_spread)
:m_left_image(left_image.impl()),
- m_dem_accuracy(dem_accuracy),
+ m_dem_error(dem_error),
m_dem_georef(dem_georef),
m_dem(dem),
m_downsample_scale(downsample_scale),
@@ -100,7 +100,7 @@ namespace asp {
}
}
- double height_error_tol = std::max(m_dem_accuracy/4.0, 1.0); // height error in meters
+ double height_error_tol = std::max(m_dem_error/4.0, 1.0); // height error in meters
double max_abs_tol = height_error_tol/4.0; // abs cost function change b/w iterations
double max_rel_tol = 1e-14; // rel cost function change b/w iterations
int num_max_iter = 50;
@@ -193,9 +193,9 @@ namespace asp {
// Since our DEM is only known approximately, the true
// intersection point of the ray coming from the left camera
- // with the DEM could be anywhere within m_dem_accuracy from
+ // with the DEM could be anywhere within m_dem_error from
// xyz. Use that to get an estimate of the disparity
- // accuracy.
+ // error.
ImageView< PixelMask<Vector2> > curr_pixel_disp_range(3, 1);
double bias[] = {-1.0, 1.0, 0.0};
@@ -205,7 +205,7 @@ namespace asp {
Vector2 right_fullres_pix;
try {
- right_fullres_pix = m_right_camera_model->point_to_pixel(xyz + bias[k]*m_dem_accuracy*left_camera_vec);
+ right_fullres_pix = m_right_camera_model->point_to_pixel(xyz + bias[k]*m_dem_error*left_camera_vec);
} catch ( camera::PointToPixelErr const& e ) {
curr_pixel_disp_range(k, 0).invalidate();
continue;
@@ -244,7 +244,7 @@ namespace asp {
template <class ImageT, class DEMImageT>
DemDisparity<ImageT, DEMImageT>
dem_disparity( ImageViewBase<ImageT> const& left,
- double dem_accuracy, GeoReference dem_georef,
+ double dem_error, GeoReference dem_georef,
DEMImageT const& dem,
Vector2f const& downsample_scale,
boost::shared_ptr<camera::CameraModel> left_camera_model,
@@ -255,7 +255,7 @@ namespace asp {
) {
typedef DemDisparity<ImageT, DEMImageT> return_type;
return return_type( left.impl(),
- dem_accuracy, dem_georef,
+ dem_error, dem_georef,
dem, downsample_scale,
left_camera_model, right_camera_model,
homography_align, align_matrix,
@@ -285,9 +285,9 @@ namespace asp {
if (dem_file == ""){
vw_throw( ArgumentErr() << "dem_disparity: No value was provided for: disparity-estimation-dem.\n" );
}
- double dem_accuracy = stereo_settings().disparity_estimation_dem_accuracy;
- if (dem_accuracy < 0.0){
- vw_throw( ArgumentErr() << "dem_disparity: Invalid value for disparity-estimation-dem-accuracy: " << dem_accuracy << ".\n" );
+ double dem_error = stereo_settings().disparity_estimation_dem_error;
+ if (dem_error < 0.0){
+ vw_throw( ArgumentErr() << "dem_disparity: Invalid value for disparity-estimation-dem-error: " << dem_error << ".\n" );
}
GeoReference dem_georef;
@@ -326,7 +326,7 @@ namespace asp {
ImageViewRef<PixelMask<Vector2i> > lowres_disparity
= dem_disparity(left_image_sub,
- dem_accuracy, dem_georef,
+ dem_error, dem_georef,
dem, downsample_scale,
left_camera_model, right_camera_model,
homography_align, align_matrix, pixel_sample,
View
6 src/asp/Core/StereoSettings.cc
@@ -73,7 +73,7 @@ namespace asp {
CorrelationDescription::CorrelationDescription() : po::options_description("Correlation Options") {
StereoSettings& global = stereo_settings();
- global.disparity_estimation_dem_accuracy = 0.0;
+ global.disparity_estimation_dem_error = 0.0;
(*this).add_options()
("prefilter-kernel-width", po::value(&global.slogW)->default_value(1.5),
"Sigma value for Gaussian kernel used in prefilter for correlator.")
@@ -97,8 +97,8 @@ namespace asp {
"Compute only the low-resolution disparity, skip the full-resolution disparity computation.")
("disparity-estimation-dem", po::value(&global.disparity_estimation_dem)->default_value(""),
"DEM to use in estimating the low-resolution disparity (when corr-seed-mode is 2).")
- ("disparity-estimation-dem-accuracy", po::value(&global.disparity_estimation_dem_accuracy),
- "Accuracy (in meters) of the disparity estimation DEM.")
+ ("disparity-estimation-dem-error", po::value(&global.disparity_estimation_dem_error),
+ "Error (in meters) of the disparity estimation DEM.")
("use-local-homography", po::bool_switch(&global.use_local_homography)->default_value(false)->implicit_value(true),
"Apply a local homography in each tile.");
View
2 src/asp/Core/StereoSettings.h
@@ -114,7 +114,7 @@ namespace asp {
vw::uint16 corr_max_levels; // Max pyramid levels to process. 0 hits only once.
bool compute_low_res_disparity_only; // Skip the full-resolution disparity computation
std::string disparity_estimation_dem; // DEM to use in estimating the low-resolution disparity
- double disparity_estimation_dem_accuracy; // Accuracy (in meters) of the disparity estimation DEM
+ double disparity_estimation_dem_error; // Error (in meters) of the disparity estimation DEM
bool use_local_homography; // Apply a local homography in each tile
// Subpixel Options

0 comments on commit 71568e5

Please sign in to comment.
Something went wrong with that request. Please try again.