Welcome to AI Vision USB Camera repository
11.Discrete fourier transform algorithm
Discrete fourier transform algorithm
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.
1. Use
Code path:~/yahboomcar_ws/src/opencv_apps/launch
- Start the camera
roslaunch yahboomcar_visual opencv_apps.launch img_flip:=false
- img_flip parameter: whether the image needs to be flipped horizontally, the default is false.
[usb_cam-test.launch] file opens the [web_video_server] node by default, and you can directly use the [IP:8080] web page to view images in real time.
- Start the corner detection function of Opencv_apps
roslaunch opencv_apps discrete_fourier_transform.launch # Discrete Fourier Transform AlgorithmThe debug_view for some functions is disabled, and there is no screen appearing. You can view the effect in the following two ways.
xThe reason for closing debug_view is that it will generate errors on the terminal, but the actual effect has not been affected
- Local View Screen
Enter the following command and select the corresponding topic to see the effect:
xxxxxxxxxxrqt_image_view
- LAN viewing screen
In the same local area network, enter IP+port (8080) in the browser, for example:
x192.168.2.150:8080 # IP is the IP of the host computer
2. Effect display
On the right is the picture after the Fourier transform algorithm
