8000 Error while using calibrate_cameras · Issue #32 · erget/StereoVision · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Error while using calibrate_cameras #32
Open
@sokol07

Description

@sokol07

When using calibrate_cameras I was getting such an error:
cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\calib3d\src\calibration.cpp:1318: error: (-211:One of arguments' values is out of range) image width and height must be positive in function 'cvCalibrateCamera2Internal'

I found that #16 was a fix for similar issue. I reverted that change, placed self.image_size after calib.dist_coefs["right"] and everything is ok now.

So this piece of code look at the moment like that in my project:

calib = StereoCalibration()   
        (calib.cam_mats["left"], calib.dist_coefs["left"],  
         calib.cam_mats["right"], calib.dist_coefs["right"],  
         calib.rot_mat, calib.trans_vec, calib.e_mat,  
         calib.f_mat) = cv2.stereoCalibrate(self.object_points,  
                                            self.image_points["left"],  
                                            self.image_points["right"],  
                                            calib.dist_coefs["left"],  
                                            calib.cam_mats["right"],  
                                            calib.dist_coefs["right"],  
                                            self.image_size,  
                                            calib.rot_mat,  
                                            calib.trans_vec,  
                                            calib.e_mat,  
                                            calib.f_mat,  
                                            criteria=criteria,  
                                            flags=flags)[1:]  
                                          
  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0