Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RPC: We do not support -t rpc with mapproj images

  • Loading branch information...
commit 84790713265c9576c2f3e885e6f536e01cc728b4 1 parent 11df453
@oleg-alexandrov oleg-alexandrov authored
View
41 docs/book/examples.tex
@@ -45,7 +45,7 @@ \section{Guidelines for Selecting Stereo Pairs}
\ac{ISIS} cube format, the images must have had SPICE data associated
by running ISIS's \texttt{spiceinit} program run on them first.
-\subsection{Combatting Long Run Times}
+\subsection{Combating Long Run Times}
The factor that predominantly determines running time in the Stereo
Pipeline is the size of the search space considered by the correlation
@@ -392,7 +392,7 @@ \section{Mars Exploration Rovers MER}
The MER rovers have several cameras on board and they all seem to have
a stereo pair. With ASP you are able to process the PANCAM, NAVCAM,
-and HAZCAM camera imagery. ISIS has no telemetry or camera instrinsic
+and HAZCAM camera imagery. ISIS has no telemetry or camera intrinsic
supports for these images. That however is not a problem as their raw
imagery contains the cameras' information in JPL's CAHV, CAHVOR, and
CHAVORE formats.
@@ -403,7 +403,7 @@ \section{Mars Exploration Rovers MER}
clouds. \emph{The *-PC.tif is a raw point cloud with the first 3
channels being XYZ in the rover site's coordinate frame}. We don't
support the creation of DEMs from these images and that is left as an
-excercise for the user.
+exercise for the user.
\subsection{PANCAM, NAVCAM, HAZCAM}
@@ -458,7 +458,7 @@ \subsection*{stereo.default}
\end{minipage}\end{center}
\clearpage
-\section{Lunar Reconaissance Orbiter LROC NAC}
+\section{Lunar Reconnaissance Orbiter LROC NAC}
\subsection{Lee-Lincoln Scarp}
@@ -776,13 +776,15 @@ \section{Digital Globe Imagery}
areas, that is a bonus, but we can't provide any advice for how to
perform or improve the results if you choose to use ASP in that way.
-ASP can only process Level 1B imagery and cannot process Digital
-Globe's aerial imagery. We can pull a camera model from the RPC
-coefficients or from their linear camera model described in the
-provided XML files. We won't be discussing the RPC method in this
-section, however you can learn more about it in the later example (section \ref{rpc})
-where we discuss processing GeoEye imagery which comes only with RPC
-coefficients. Our implementation of the linear camera model only
+ASP can only process Level 1B imagery and cannot process Digital Globe's
+aerial imagery. We can pull a camera model from the RPC coefficients or
+from their linear camera model described in the provided XML files. We
+won't be discussing the RPC method in this section, however you can
+learn more about it in the later example (section \ref{rpc}) where we
+discuss processing GeoEye imagery which comes only with RPC
+coefficients.
+
+Our implementation of the linear camera model only
models the geometry of the imaging hardware itself and velocity
aberration. We do not currently model refraction due to light bending
in Earth's atmosphere. It is our understanding that this could
@@ -845,7 +847,8 @@ \subsection{Processing Raw}
\subsubsection*{Commands}
\begin{verbatim}
- > stereo 12FEB12053305-P1BS_R2C1-052783824050_01_P001.TIF \
+ > stereo -t dg \
+ 12FEB12053305-P1BS_R2C1-052783824050_01_P001.TIF \
12FEB12053341-P1BS_R2C1-052783824050_01_P001.TIF \
12FEB12053305-P1BS_R2C1-052783824050_01_P001.XML \
12FEB12053341-P1BS_R2C1-052783824050_01_P001.XML dg/dg
@@ -931,7 +934,7 @@ \subsubsection*{Commands}
12FEB12053341-P1BS_R2C1-052783824050_01_P001.TIF \
12FEB12053341-P1BS_R2C1-052783824050_01_P001.XML \
right_mapped.tif
- > stereo left_mapped.tif right_mapped.tif \
+ > stereo -t dg left_mapped.tif right_mapped.tif \
12FEB12053305-P1BS_R2C1-052783824050_01_P001.XML \
12FEB12053341-P1BS_R2C1-052783824050_01_P001.XML \
dg/dg srtm_53_07.tif
@@ -951,7 +954,7 @@ \section{GeoEye and Astrium Imagery / RPC Imagery}
\label{rpc}
GeoEye provides imagery from Ikonos and the two GeoEye
-satellites. Astrium provideds imagery from SPOT and Pleiades
+satellites. Astrium provides imagery from SPOT and Pleiades
satellites. Both companies provide only Rational Polynomial Camera
(RPC) models. RPC represents four 20-element
polynomials that map geodetic coordinates to image coordinates. Since
@@ -989,9 +992,17 @@ \section{GeoEye and Astrium Imagery / RPC Imagery}
\subsubsection*{Commands}
\begin{verbatim}
- > stereo po_312012_pan_0000000.tif po_312012_pan_0010000.tif geoeye/geoeye
+ > stereo -t rpc po_312012_pan_0000000.tif po_312012_pan_0010000.tif geoeye/geoeye
\end{verbatim}
+In case the image files do not contain the RPC models, separate XML
+files having this information need to be provided, as done for Digital
+Globe images (section \ref{rawdg}).
+
+Currently, stereo using RPC camera models cannot be performed if the
+input images are map-projected, as it is possible with Digital Globe
+images with linear camera models (section \ref{mapproj}).
+
\subsubsection*{stereo.default}
The stereo.default example file works generally well with all GeoEye
View
7 src/asp/Sessions/RPC/StereoSessionRPC.cc
@@ -51,6 +51,13 @@ namespace asp {
} catch ( NotFoundErr const& err ) {}
if ( !rpc_model ) {
+
+ if (camera_file == ""){
+ vw_throw( NotFoundErr()
+ << "RPCModel: Could not find the RPC model in " << image_file
+ << ", and no XML camera file was provided.\n" );
+ }
+
RPCXML rpc_xml;
rpc_xml.read_from_file( camera_file );
rpc_model = new RPCModel( *rpc_xml.rpc_ptr() ); // Copy the value
View
72 src/asp/Tools/stereo.cc
@@ -257,8 +257,45 @@ namespace asp {
}
void user_safety_checks(Options const& opt){
+
+ // Error checking
+
+ if ( stereo_settings().seed_mode > 3 ){
+ vw_throw( ArgumentErr() << "Invalid value for seed-mode: "
+ << stereo_settings().seed_mode << ".\n" );
+ }
+
+ if ( stereo_settings().seed_mode == 0 &&
+ stereo_settings().use_local_homography ){
+ vw_throw( ArgumentErr() << "Cannot use local homography without "
+ << "computing low-resolution disparity.\n");
+ }
+
+ if ( !opt.input_dem.empty() && stereo_settings().seed_mode == 2 )
+ vw_throw( NoImplErr() << "Computation of low-resolution disparity from "
+ << "DEM is not implemented for map-projected images.\n");
+
+ GeoReference georef;
+ bool has_georef1 = read_georeference( georef, opt.in_file1 );
+ bool has_georef2 = read_georeference( georef, opt.in_file2 );
+ if ( !opt.input_dem.empty() && (!has_georef1 || !has_georef2)){
+ vw_throw( ArgumentErr() << "The images are not map-projected, "
+ << "cannot use the provided DEM: " << opt.input_dem << ".n");
+ }
+
+ if ( (opt.session->name() == "dg" || opt.session->name() == "dgmaprpc" ) &&
+ has_georef1 && has_georef2 && opt.input_dem == "") {
+ vw_out(WarningMessage) << "It appears that the input images are "
+ << "map-projected. In that case a DEM needs to be "
+ << "provided for stereo to give correct results.\n";
+ }
+
+ if ( opt.session->name() == "rpc" && opt.input_dem != "") {
+ vw_throw( ArgumentErr() << "Cannot use map-projected images with "
+ << "an RPC session.\n");
+ }
- //---------------------------------------------------------
+ // Camera checks
try {
boost::shared_ptr<camera::CameraModel> camera_model1, camera_model2;
opt.session->camera_models(camera_model1, camera_model2);
@@ -307,38 +344,7 @@ namespace asp {
// Silent. Top Left pixel might not be valid on a map
// projected image.
}
-
- if ( stereo_settings().seed_mode > 3 ){
- vw_throw( ArgumentErr() << "Invalid value for seed-mode: "
- << stereo_settings().seed_mode << ".\n" );
- }
-
- if ( stereo_settings().seed_mode == 0 &&
- stereo_settings().use_local_homography ){
- vw_throw( ArgumentErr() << "Cannot use local homography without "
- << "computing low-resolution disparity.\n");
- }
-
- // Checks for map-projected images below
- if ( !opt.input_dem.empty() && stereo_settings().seed_mode == 2 )
- vw_throw( NoImplErr() << "Computation of low-resolution disparity from "
- << "DEM is not implemented for map-projected images.\n");
-
- GeoReference georef;
- bool has_georef1 = read_georeference( georef, opt.in_file1 );
- bool has_georef2 = read_georeference( georef, opt.in_file2 );
- if ( !opt.input_dem.empty() && (!has_georef1 || !has_georef2)){
- vw_throw( ArgumentErr() << "The images are not map-projected, "
- << "cannot use the provided DEM: " << opt.input_dem << ".n");
- }
-
- if ( (opt.session->name() == "dg" || opt.session->name() == "dgmaprpc" ) &&
- has_georef1 && has_georef2 && opt.input_dem == "") {
- vw_out(WarningMessage) << "It appears that the input images are "
- << "map-projected. In that case a DEM needs to be "
- << "provided for stereo to give correct results.\n";
- }
-
+
}
// approximate search range
Please sign in to comment.
Something went wrong with that request. Please try again.