Closed tmizu23 closed 6 years ago
Hi, Are you running from master, or v0.3.1?
I run it with Windows docker latest opendronemap/opendronemap image. "img_size" parameter in odmgeoreferencing.py is "bundleResizedTo" in Georef.cpp as without change. And bundleResizedTo_ is used in caliculating cam.focal_length. Then cam.focal_length is used in isFaceProjected() and getPixelCoordinates() function in modifiedPclFunctions.cpp
Instead of running --resize-to -1
try --skip-resize
Hi,thank you reply. --skip-resize was removed at "Remove Resize module" committed on 25 Aug
I tried to fix this issue by changing Georef.cpp.
and this code will also fix the issue that gcp with resized image by --resize-to doesn't return correct result. When using GCP, the previous code seems to be the correct result only for the original size image.
and I think that gcp_list.txt should be made with the original image size even if setting the resize option, so I changed the code like it. ref. #541 #632
Please check the code. Changing Georef.cpp from L797 https://github.com/OpenDroneMap/OpenDroneMap/blob/master/modules/odm_georef/src/Georef.cpp#L797
// Caluculate resize scale
double resize_scale = 1.0;
cv::Mat image = cv::imread(cam.texture_file);
if(bundleResizedTo_ == -1) bundleResizedTo_ = image.cols;
resize_scale = static_cast<double>(bundleResizedTo_)/image.cols;
// Rescale the heigh, width, focal_length
cam.height = static_cast<double>(image.rows) * resize_scale;
cam.width = static_cast<double>(image.cols) * resize_scale;
cam.focal_length *= resize_scale;
// Rescale the pixcelX, pixcelY of gcp_list.txt
// The pixel position for the GCP in pcl-format in order to use pcl-functions
pcl::PointXY gcpPos;
gcpPos.x = static_cast<float>(gcps_[gcpIndex].pixelX_ * resize_scale );
gcpPos.y = static_cast<float>(gcps_[gcpIndex].pixelY_ * resize_scale);
Sorry, I forgot that was my removal 😨
So now in the code there is no resizing done, the --resize-to only applies to OpenSfM for speeding up the process. Everything else uses the original images for maximum resolution. When georef
is called, it uses the original image size, therefore resize_scale should always be 1. We should simply remove all the resize stuff from odm_georeferencing to make it simple.
almost +1, but there is a bug at the moment, so please fix following points.
Georef.cpp L800 should be commented out for georeferencing correctly https://github.com/OpenDroneMap/OpenDroneMap/blob/master/modules/odm_georef/src/Georef.cpp#L800
This should be fixed in latest master
if "--resize-to" is -1, odm_georeferencing.py or Georef.cpp does't process as original size. value -1 valid only opensfm process. Until it is fixed, It is better to modify help and manual.