01
Camera Calibration
-
Connect the CSI camera to the Raspberry Pi camera interface, ensuring that the blue side of the cable faces the black switch cover; -
Connect the Raspberry Pi to a display and open the terminal to input commands;
-
Select Interface option and then choose P1 Camera;
-
Save and exit, then reboot the Raspberry Pi
-
Prepare a chessboard as shown in the picture, assigning coordinates (0,0,0), (1,0,0), (2,0,0) … (11,8,0) to the chessboard;
-
Open the terminal on the Raspberry Pi and input the command to activate the camera;
cheese
-
Select the external camera and take multiple photos of the chessboard from different angles;
-
Save the photos taken into a folder, renaming them as ‘1.jpg’、‘2.jpg’、…
-
Copy the photos to the computer, placing them in the same directory as the code file (link at the end)
-
Open the code with pycharm (calib_camera), add the libraries used in settings numpy、opencv-python、glob
-
Modify path 1 to the path where the chessboard photos are stored, modify path 2 to the path for the test photo (using the 17th photo as an example)
-
Run the program to obtain the corrected photo, which will be automatically stored in the same path as the captured photos
-
Record the camera’s parameter matrix
02
Monocular Distance Measurement
-
Measure the height of the camera from the ground where the object is placed -
Open the code in the Raspberry Pi using codeblock to access Object_detection&&Distance (link at the end), and modify the height parameter in the appropriate location
-
Modify the camera’s parameter matrix based on the test data
2. Measure Distance
-
Compile and run the program
03
(Detailed operations can refer to the video)
https://github.com/COONEO/neor_mini.git # Melodic branch
Welcome to join our group chat, which is for friends who love robot development, making it easier for everyone to learn, share, and exchange ideas about creating intelligent robots, and to meet more like-minded friends. There are also irregular community exclusive benefits! Follow our public account or send "join group" in the dialog box to get the way to join.
Layout: SUSU
Creating is not easy, if you like this content, please share it with your friends to share and exchange the joy of creation, and also encourage us to create more robot development guides for everyone, so let’s learn by doing together!
———
Recommended Reading:
Building a ROS Open Source Mini Unmanned Vehicle from Scratch
Standing on the Shoulders of PX4-Autopilot: Outdoor Autonomous Driving Path Planning
NEOR mini Runs Wild on the Track
Building an Open Source Crop Inspection Robot from Scratch
Open Source! Step-by-Step Guide to Building an Arduino + Raspberry Pi ROS Car (Part 1)
Open Source! Step-by-Step Guide to Building an Arduino + Raspberry Pi ROS Car (Part 2)
Building ROS Robot – Ubuntu Binding Serial Port Devices
Open Source! Vision Line Following ROS Car Based on OpenCV
Open Source! Step-by-Step Guide to Driving Arduino + ROS Car Motor (A4950T)
Whaaat?! Install Ubuntu 22.04 Desktop Directly on Raspberry Pi 4 2GB to Run ROS2 for Robot Development
Step-by-Step Guide to Debugging ROS Chassis with Ultrasonic + Remote Control + Light Combination
Open Source! Step-by-Step Guide to Implementing a Servo Gimbal
Leave a Comment
Your email address will not be published. Required fields are marked *