Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Camera calibration takes forever #116

Open
fdev31 opened this issue Nov 28, 2021 · 1 comment
Open

Camera calibration takes forever #116

fdev31 opened this issue Nov 28, 2021 · 1 comment

Comments

@fdev31
Copy link

fdev31 commented Nov 28, 2021

During camera calibration there are two issues:

  1. when the checker can't be found, it can take ages (minutes) after pressing the button
  2. there is no clear feedback when the checker wasn't found but the processing is over: if consecutive failures happens, there is no change on the screen (the current error message isn't cleared out when "Add current frame" is pressed)

I patched my local copy to mitigate 1 by using "fast check" mode, the normalization part can probably be dropped, it was just an experiment:

diff --git a/calibrate_video.py b/calibrate_video.py
index 4c35153..0d3bafc 100644
--- a/calibrate_video.py
+++ b/calibrate_video.py
@@ -163,11 +163,12 @@ class FisheyeCalibrator:
         gray = cv2.cvtColor(self.stretch_image(img),cv2.COLOR_BGR2GRAY)
 
         # Find the chess board corners
-        ret, corners = cv2.findChessboardCorners(gray, self.chessboard_size, None)
+        ret, corners = cv2.findChessboardCorners(gray, self.chessboard_size, flags=cv2.CALIB_CB_FAST_CHECK + cv2.CALIB_CB_NORMALIZE_IMAGE)
 
         if not ret:
             return (False, "Failed to detect chessboard", None)
 
+        ret, corners = cv2.findChessboardCorners(gray, self.chessboard_size, flags=cv2.CALIB_CB_NORMALIZE_IMAGE)
 
         # If found, add object points, image points (after refining them)
         self.num_images += 1

Some big red cross or question mark over the image could indicate it failed... but I didn't browse the code enough (and don't know Qt...) to figure it out.

@ElvinC
Copy link
Owner

ElvinC commented Dec 13, 2021

Thanks for the feedback!

lukegluke pushed a commit to lukegluke/gyroflow_old that referenced this issue Sep 18, 2022
Middle mouse button timeline panning
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