Package: opencv-camera
OpenCV CameraSimple threaded camera and calibration code using OpenCV. This tries to simplify some thingsInstallThe preferred way to install is usingpip:pip install opencv_cameraUsageSee the jupyter notebooks under thedocsin the repository for some examples.OnlinenbviewerColorspaceChange between common colorspaces with:bgr2gray(image)gray2bgr(image)bgr2rgb(image)rgb2bgr(image)bgr2hsv(image)hsv2bgr(image)CalibrationCreate a mosaic of input calibration images withmosaic(images, width)Calibrate a camera with:calibrator=CameraCalibration()board=ChessboardFinder((9,6),1)cam,cal=calibrator.calibrate(images,board)Display all of the found image points withcoverage((width, height), imagePoints)DistortionUse the found calibration parameters to undistort an image:un=UnDistort(cameraMatrix,distortionCoeff,w,h)corr_img=un.undistort(image)Visualize the lens distortion with:visualizeDistortion(cameraMatrix,distortCoeff,height,width)StereoCalibrate a stereo camera with:stereoCal=StereoCalibration()board=ChessboardFinder((9,6),1)ok,cm,sc=stereoCal.calibrate(imgL,imgR,board)Draw epipolar lines in stereo images withdrawEpipolarLines(imgpointsL,imgpointsR,imgL,imgR)AppsUseprogram --helpto display switches for each of the following:opencv_calibrate: calibrate a cameraopencv_capture: simple tool to capture and save imagesopencv_mjpeg: sets up a simple jmpeg server so you can view images in a web browserudp_server x.x.x.x: sends camera images via UDPudp_client x.x.x.x: displays UDP camera images from serverToDoRemodedapriltagcalibration, moved tomoms_apriltaglibraryAdd pointcloud from stereoAdd parameters for known camerasAdd Jupyter notebook documentation and examplesSimplify stereo cameraAddcomputeReprojectionErrorsandvisualizeReprojErrorsAddvisualizeDistortionAddvisualizeExtrinsicsRemoveattrs, replaced with python'sdataclassAdd save/load fromyamlAdd stereo calibrationpytestChange LogDateVersionNotes2022.12.23changed version number to match date, changed toopencv-contrib-python2020-12-270.10.10added distortion and reprojection display2020-09-150.10.8added known camera params and general cleanup2020-08-240.10.6added UDP image server and client2020-07-030.10.2renamed and focused on camera2018-07-190.9.4simple clean-up and updating some things2017-10-290.9.3bug fixes2017-04-090.9.0initial python 3 support2017-03-310.7.0refactored and got rid of things I do not need2017-01-290.6.0added video capture (video and images) program2016-12-300.5.3typo fix2016-12-300.5.1refactored2016-12-110.5.0published to PyPi2014-3-110.2.0startedMIT LicenseCopyright (c) 2014 Kevin J. WalchkoPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.