mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Update documentation ( tutorials )
This commit is contained in:
@@ -35,17 +35,13 @@ How to Read Raster Data using GDAL
|
||||
|
||||
This demonstration uses the default OpenCV imread function. The primary difference is that in order
|
||||
to force GDAL to load the image, you must use the appropriate flag.
|
||||
@code{.cpp}
|
||||
cv::Mat image = cv::imread( argv[1], cv::IMREAD_LOAD_GDAL );
|
||||
@endcode
|
||||
@snippet cpp/tutorial_code/imgcodecs/GDAL_IO/gdal-image.cpp load1
|
||||
When loading digital elevation models, the actual numeric value of each pixel is essential and
|
||||
cannot be scaled or truncated. For example, with image data a pixel represented as a double with a
|
||||
value of 1 has an equal appearance to a pixel which is represented as an unsigned character with a
|
||||
value of 255. With terrain data, the pixel value represents the elevation in meters. In order to
|
||||
ensure that OpenCV preserves the native value, use the GDAL flag in imread with the ANYDEPTH flag.
|
||||
@code{.cpp}
|
||||
cv::Mat dem = cv::imread( argv[2], cv::IMREAD_LOAD_GDAL | cv::IMREAD_ANYDEPTH );
|
||||
@endcode
|
||||
@snippet cpp/tutorial_code/imgcodecs/GDAL_IO/gdal-image.cpp load2
|
||||
If you know beforehand the type of DEM model you are loading, then it may be a safe bet to test the
|
||||
Mat::type() or Mat::depth() using an assert or other mechanism. NASA or DOD specification documents
|
||||
can provide the input types for various elevation models. The major types, SRTM and DTED, are both
|
||||
|
||||
Reference in New Issue
Block a user