Welcome to DOFBOT Pro repository
10.Contour moment
10.Contour moment
This section is a dedicated course for the Jetson-Nano mainboard. The Orin mainboard does not have a ROS1 environment and cannot run the following programs. The startup commands for this section are run on the Jetson-Nano host machine (mainboard). Simply open a terminal directly on the mainboard and enter the course commands; there is no need to run them in Docker.
Moment functions are widely used in image analysis, such as pattern recognition, target classification, target recognition and orientation estimation, image encoding and reconstruction, etc. The moment set calculated from an image can not only describe the global characteristics of the image shape, but also provide a large amount of different geometric feature information about the image, such as size, position, direction and shape. The description ability of image moments is widely used in target recognition and orientation estimation in various fields of image processing, computer vision and robotics.
First moment: related to shape;
Second moment: shows how much the curve extends around the mean of the straight line;
Third-order moment: a symmetry measurement about the mean value; 7 invariant moments can be derived from the second-order moment and the third-order moment. The invariant moment is a statistical characteristic of the image, which satisfies the invariance of translation, expansion and contraction, and rotation, and is widely used in the field of image recognition.
10.1 Use
Source code launch file path:~/dofbot_ws/src/opencv_apps/launch
Step 1: Start the camera
roslaunch dofbot_visual opencv_apps.launch img_flip:=false
- img_flip parameter: whether the image needs to be flipped horizontally, the default is false.
Step 2: Start the corner detection function of Opencv_apps