Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Bug in TestRingRectification.cpp #43

Closed
PaulBergmann opened this issue Aug 10, 2016 · 1 comment
Closed

Bug in TestRingRectification.cpp #43

PaulBergmann opened this issue Aug 10, 2016 · 1 comment

Comments

@PaulBergmann
Copy link

In TestRingRectification.cpp (Line 87), you have the following for loop for reading the side camera images for different frames:

vector<vector<Mat>> sideCamImages(framesList.size(), vector<Mat>());
  for (int frameIdx = 0; frameIdx < framesList.size(); ++frameIdx) {
    const string& frameName = framesList[frameIdx];
    LOG(INFO) << "getting side camera images from frame: " << frameName;
    for (int i = 0; i < numSideCameras; ++i) {
      const string srcImagePath = FLAGS_root_dir + "/vid/" + framesList[0] +
        "/isp_out/" + camModelArray[i].cameraId + ".png";
      LOG(INFO) << "\t" << camModelArray[i].cameraId << ": " << srcImagePath;
      Mat origImage = imreadExceptionOnFail(srcImagePath, CV_LOAD_IMAGE_COLOR);
      Mat imageUndistorted;
      cvUndistortBicubic(
        origImage, imageUndistorted, intrinsic, distCoeffs, intrinsic);
      sideCamImages[frameIdx].push_back(imageUndistorted);
    }
  }

I think the line

const string srcImagePath = FLAGS_root_dir + "/vid/" + framesList[0] +
        "/isp_out/" + camModelArray[i].cameraId + ".png";

should rather contain framesList[frameIdx], otherwise the images for the first frame are repeatedly loaded?

@fbriggs
Copy link

fbriggs commented Aug 10, 2016

Good catch, you are right. This didn't have any affect most of the time, because if you run the 'rectify' step from the GUI, it only uses one frame. However, if you run TestRingRectification directly, it is possible to pass it more frames, and potentially get a higher accuracy solution. For example, here is a command to run it with frames 0 and 1:

./bin/TestRingRectification
--logbuflevel -1 --stderrthreshold 0 --v 0
--rig_json_file ./res/config/17cmosis_default.json
--src_intrinsic_param_file ./res/config/sunex_intrinsic.xml
--output_transforms_file ~/Desktop/new_rectify_test/rectify.yml
--root_dir ~/Desktop/new_rectify_test
--frames_list 000000,000001
--visualization_dir ~/Desktop/new_rectify_test/rectify_vis

I'll have a diff fixing this soon. Thanks.

@fbriggs fbriggs closed this as completed Aug 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants