Welcome to DOFBOT Pro repository
12.Discrete fourier transform algorithm
12.Discrete fourier transform algorithm
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.
The Fourier transform can decompose an image into its sine and cosine components. In other words, it can convert an image from its spatial domain to its frequency domain. The idea of this transformation is that any function can accurately approach the sum of infinite sin() functions and cos() functions. The Fourier transform provides this method to achieve this effect.
For discrete signals such as digital images, the frequency indicates the intensity of the signal change, or the speed of the signal change. The higher the frequency, the more drastic the change. The smaller the frequency, the gentler the signal. Corresponding to the image, high-frequency signals are often edge signals and noise signals in the image, while low-frequency signals include signals such as image contours and background that change frequently.
12.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
xxxxxxxxxxroslaunch opencv_apps discrete_fourier_transform.launch # #Discrete Fourier Transform AlgorithmEach functional case will have a parameter [debug_view], Boolean type, whether to use Opencv to display images, which is displayed by default.
If no display is required, set it to [False], for example
xxxxxxxxxxroslaunch opencv_apps contour_moments.launch debug_view:=FalseHowever, after starting in this way, some cases cannot be displayed in other ways, because in the source code, some [debug_view] is set to [False], which will turn off image processing.
12.2 Display method
- rqt_image_view
Enter the following command to select the corresponding topic
xxxxxxxxxxrqt_image_view
- opencv
The system displays it by default, no need to do anything.
12.3 Effect display
On the right is the picture after the Fourier transform algorithm
