Camera Calibration in less than 5 Minutes with OpenCV
ฝัง
- เผยแพร่เมื่อ 19 ก.พ. 2023
- Camera Calibration Software and High Precision Calibration Boards: camera-calibrator.com/
Inside my school and program, I teach you my system to become an AI engineer or freelancer. Life-time access, personal help by me and I will show you exactly how I went from below average student to making $250/hr. Join the High Earner AI Career Program here 👉 www.nicolai-nielsen.com/aicareer (PRICES WILL INCREASE SOON)
You will also get access to all the technical courses inside the program, also the ones I plan to make in the future! Check out the technical courses below 👇
Camera Calibration Software and Boards: camera-calibrator.com
_____________________________________________________________
In this video 📝 We'll talk about Camera Calibration and Geometry. We will first talk about the basics of camera geometry and how it can be used for calibrating cameras. We will see different types of distortion on cameras and images. At the end of the video, I'll show you in a Python script how to apply what we have learned and calibrate a camera from a practical computer vision setup.
If you enjoyed this video, be sure to press the 👍 button so that I know what content you guys like to see.
_____________________________________________________________
🛠️ Freelance Work: www.nicolai-nielsen.com/nncode
_____________________________________________________________
💻💰🛠️ High Earner AI Career Program: www.nicolai-nielsen.com/aicareer
⚙️ Real-world AI Technical Courses: (www.nicos-school.com)
📗 OpenCV GPU in Python: www.nicos-school.com/p/opencv...
📕 YOLOv7 Object Detection: www.nicos-school.com/p/yolov7...
📒 Transformer & Segmentation: www.nicos-school.com/p/transf...
📙 YOLOv8 Object Tracking: www.nicos-school.com/p/yolov8...
📘 Research Paper Implementation: www.nicos-school.com/p/resear...
📔 CustomGPT: www.nicos-school.com/p/custom...
_____________________________________________________________
📷 Calibrator 📷
My camera calibration software, CharuCo Boards, and Checker boards
Link to webshop: camera-calibrator.com
_____________________________________________________________
📞 Connect with Me:
🌳 linktr.ee/nicolainielsen
🌍 My Website: www.nicolai-nielsen.com/
🤖 GitHub: github.com/niconielsen32
👉 LinkedIn: / nicolaiai
🐦 X/Twitter: / nielsencv_ai
🌆 Instagram: / nicolaihoeirup
_____________________________________________________________
🎮 My Gear (Affiliate links):
💻 Laptop: amzn.to/49LJkTW
🖥️ Desktop PC:
NVIDIA RTX 4090 24GB: amzn.to/3Uc7yAM
Intel I9-14900K: amzn.to/3W4Z5Cb
Motherboard: amzn.to/4aR6wBC
32GB RAM: amzn.to/3Jt2XVR
🖥️ Monitor: amzn.to/4aLP8hh
🖱️ Mouse: amzn.to/3W501GH
⌨️ Keyboard: amzn.to/3xUGz5b
🎙️ Microphone: amzn.to/3w1F1WK
📷 Camera: amzn.to/4b4Ryr9
_____________________________________________________________
Tags:
#CameraCalibration #CameraCalibrationOpenCV #CameraDistortion #ComputerVision #OpenCV #Python - วิทยาศาสตร์และเทคโนโลยี
Camera Calibration Software and High Precision Calibration Boards: camera-calibrator.com/
Can you show a link to the calibration image you used? Also, is the frame size in mm?
Just curious, isnt ChArUco a better pattern for calibration?
Hello! When I run the code, I am getting the error message: [ WARN:0] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (438) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
Any advice?
What is the link for the longer calibration video? Does a camera need to be calibrated? What is the value in calibration?
This is the link for the longer video: Camera Calibration in Python with OpenCV - Python Script with Images
th-cam.com/video/3h7wgR5fYik/w-d-xo.html
U don’t have to calibrate it but can be used to remove distortion and get the intrinsic parameters of the camera which can be used for many things
@@NicolaiAI Thanks for the response.
I took the chessboard pic from my phone which is 8x8, and the frame WxH was 480x270, hence i updated these infos in the calibration.py. I get the below error
(-215:Assertion failed) nimages > 0 in function 'calibrateCameraRO' on the line
ret, cameraMatrix, dist, rvecs, tvecs = cv.calibrateCamera(objpoints, imgpoints, frameSize, None, None).
Any idea ?
Images are not loaded in correctly
what is the unit of the mean error given in the result? Thanks!
It’s pixels from the reprojection
Hello, How often do we need to do camera calibration. once per camera or for everytime you move the camera
Just once per camera if u are only interested in the intrinsic parameters
@@NicolaiAI thank you so much. I really appreciate it
@@bellomayowa6993 ur welcome
It depends on your application. If your camera is under extreme environment conditions or if you want very precise accuracy, you may need to calibrate your camera more frequently since your intrinsic camera parameters could potentially change over time. Temperature changes can often cause physical changes to your camera. But if you are using it in very controlled environment and accuracy is not super important, you may get away with only calibrating once.
good evening how are you? I'm studying on a school project and I need to calibrate the camera I'm using. So I followed your tutorial then I retrieved your script from your git account, now I have a problem when I execute the code. I have an error regarding this part:
img = cv.imread('cali5.png')
h, w = img.shape[:2]
newCameraMatrix, king = cv.getOptimalNewCameraMatrix(cameraMatrix, dist, (w,h), 1, (w,h))
Here is the error that appears:
AttributeError: 'NoneType' object has no attribute 'shape'
I'm asking for your help.
Good evening.
Did you solve this problem? how?
img = cv.imread('cali5.png')
you should use your existing picture and make sure the path is right.
like: "img = cv.imread('xxx/xxx.png')"
is it really required to have the chessboard? I have been trying other images, the code just not work with other images
Nope this specific code needs to be with a chessboard and is also the easiest by far. You can just print a chessboard or even just try out with one in your phone or tablet
1. don't you have to take into account the pixel density on each device when creating a checkerboard pattern? Or what do you have to take into account?
2. where can one create a suitable checkerboard pattern?
No the pixel density doesn’t really matter. Just make sure u are able to detect the corners correctly and maybe use some sub pixel/corner refinement.
U can just download checkerboards on google. There are some generators
Wouldn't it mean that you zooming in would alter the size of the checkerboard and thus biased the tangential distortion ?@@NicolaiAI
Hi, bro . I have tried your code with about 15 pictures and everything is going well. But the total error is too much high, my error is 0.236623....!
It;s just so much high and I think the cameramtx and dist are not accurate enough in this way. Can you give me some suggestions about how can I have the same small error like you have showed in your video. Thanks.
Same issue here
Hi, thanks for the video. I'm trying to run your program on my dataset (11 photos taken from a GoPro MAX) but the 'ret' boolean always stays at false so the chessboard is never detected. The images are well read by the program, any clue why this problem occurs ?
You may want to play around with how close or far your chessboard is to your camera
Could you please explain how to do it with 24 color card? I need to calibrate it with these 24 colors , not with chessboard
if the pattern is checkered, count the size of the board, so if your board is like 24x24 the chess size is 23x23, or if your board is 24x20 the chess size is 23x19, hope you see the pattern here
Should not the chessboardSize be equal to (10,7)?
Nope u should specify the number of corners in the chessboard in each row and column
@@NicolaiAI The chessboard displayed on the tablet screen has 10 corners and 7 corners in each row and column respectively. Great work on your videos btw, they are helpful and well organized, keep it up :D
for some reason, opencv only takes into account the inner borders of the chessboard, such the final number is always one less than the original count of rows and cols.
What is the camera?
Just a standard cheap webcam haha
it was a headache where to get chessboard, iPad is definitely a easy way to go
Yeah for sure! Or u can also just print out one
what is img = cv.imread('cali5.png')?
I was stuck on this for a while as well. If you watch his video closely, you'll notice that is just the name of one of his calibration images. Just rename it to one of your own.
@@ScottFoust Hello, I am also having the same problem. Can you tell me how to get the calibration images?
Target = objective-purpose
For each objective-purpose
= Audio soft-limit(min-max) hard-limit(min-max) slope(min-max)
= Video focus hunt-track(min-max) gradation-slope(min-max), focus(min-max) gradation-slope(min-max)
Nowadays, digital rubbish looks really bad on TV, even professional camera and professional studio. Digital camera with old manual lens with hands-brains for those missing parameters should make the hunting-focus less zombie-jumping lousy.
There is the gimbal and record at 2k to post-process to 1080p as digital-stabilization. There is no optical stabilization in my books. I am not a zombie. For military, hunt and track and other layers should be drag drop priority-table.
Real time with - it's complicated, I don't know, anything, ... Apply to men.
Apache helmet with Lidar and artillery calculator and construction civil engineering 3D modelling and range-finder scope tech is useless to such people. Add helmet with Range(min-max), slope(min-max), if you think millennials are smarter.
2 rectangle is keystone compensation for data discard shift. Bellows in old-school terminology.
Baseline target-board
= old cartoon for analog paper tune
= Japanese anime for color proofing
= China MMonline games for response-time of processor and pixels
= Korean MMo for bandwidth and network of smart TV-monitor
= Movies CGI titanic for the point when SGI lot to Linix-beowulf-culsters
= American animation movies for DVD and Blu ray
= Focusing issues not present in cartoons for kids before-after year ... Always...