This paper mainly studies the obstacle detection problem of mobile robots in unknown environments, and proposes a software implementation method for obstacle detection system based on Matlab and VC++ hybrid programming. This method integrates the numerical calculation function of MATLAB, with powerful graphics and image processing functions and the visualization, fast execution speed, easy maintenance and upgrade of VC++. The experimental results show that this detection method can greatly improve the programming efficiency and shorten the software development cycle in the development process of obstacle detection system.
introduction
At present, many researchers have applied visual navigation to the mobile control of mobile robots. However, due to the large amount of image processing data and complex algorithms, there are shortcomings in specific applications, such as poor real-time performance, insufficient robustness of the road area detection algorithm, and only suitable for the specific road model of the algorithm. In order to improve the real-time performance of mobile robots in detecting obstacles, this paper proposes a software implementation method of obstacle detection system based on Matlab and VC hybrid programming, which can greatly improve the efficiency of programming, shorten the software development cycle, and can detect obstacles quickly and accurately.
1 VC++ and Matlab mixed programming method
Matlab is a high-level technical computing language and interactive environment for algorithm development, data analysis and numerical calculation launched by MatlaWorks in the United States. It has powerful functions in matrix operations, numerical calculations and graphic display, and is very intuitive and concise. It provides corresponding toolboxes for various engineering computing fields and has been widely used in various industries such as control, biomedical engineering, speech processing, digital signal processing, radar engineering, signal analysis, computer technology, etc. However, compared with other high-level programming languages, its program execution speed is slower, and the disclosure of its source code is not conducive to the confidentiality of algorithms and data.
Visual C++ is an object-oriented high-level programming language launched by Microsoft. It integrates a variety of visual programming tools such as powerful compilers, connectors, debuggers, AppWizard, etc. It runs in a compiled manner and has a fast running speed, especially a strong ability to write interfaces. However, it is far inferior to Matlab language in digital processing analysis, algorithm tools, programming efficiency, and accurate and convenient drawing of data images.
There are five common methods for combining Matlab and VC++:
①Matlab engine.
② Use Matcom to compile Matlab's M file into C language file and embed it into VC++.
③ Use the function library provided by Matlab or the C++ interface function library to program directly in VC.
④ Use the MCC command provided by Matlab to generate a package file based on C language or C++ language corresponding to the Matlab file, and then embed it into VC.
⑤ Apply assembly technology to realize Matlab and VC hybrid programming.
This study conducted research and experiments on five methods. The last four methods only partially support Matlab's image processing toolbox, while the Matlab engine has full-function calling capabilities for Matlab, including support for digital image and communication object processing. Therefore, this paper selects the Matlab engine to implement the obstacle detection system development platform based on VC++ and Matlab.
2 Design and implementation of obstacle detection system
2.1 Setting up the Matlab and VC interface compilation environment
In the integrated environment of VC, if you want to achieve communication with the Matlab engine, you need to make some settings for the VC compilation environment, such as adding Matlab header files to the VC project, adding Matlab library files, etc.
2.2 Setting and program implementation of calling Matlab engine in VC
To use Matlab engine for image processing in VC, you first need to make some basic definitions in the program. For example, in the cpp file that uses the Matlab engine class, you need to first add the statements #inclu-de "engine.h" and #include "matrix.h". You need to use Engine*m_ep to define the Matlab engine, and use the m_ep=engOpen(NULL) statement to start the Matlab engine; finally, you need to use the engClose(m_ep) statement to close the Matlab engine.
The obstacle detection system studied in this paper mainly uses binocular stereo vision to detect the position and distance of obstacles, and controls the dual cameras of the mobile robot to collect image pairs, and then performs a series of image processing. Its software design adopts modular development ideas, mainly including image acquisition module, edge feature extraction module, Otsu image segmentation module, camera calibration module, stereo matching module and 3D reconstruction module. The main interface of the obstacle detection system is shown in Figure 1.
3. Detection process and results of obstacle detection system
Figures 2 to 5 show the processing of the obstacle detection system, which includes the acquisition of real-time images, image preprocessing, obstacle feature extraction, feature point matching, and finally calculating the position coordinates of the obstacle through the parallax method, thereby providing the necessary information for decision control. Table 1 shows the coordinates of some points in the detected obstacles.
4 Conclusion
In actual scientific research, it saves the trouble of writing some complicated and tedious image algorithm codes, and can provide convenience for engineering technicians who are familiar with VC language to develop practical image processing algorithm research; using Matlab engine can simply and effectively realize the function of calling Matlab in VC, thus improving efficiency and shortening the software development cycle.
Previous article:Design Considerations for Transconductance Amplifiers
Next article:Maintenance of Digital Multimeter Calibrator
Recommended ReadingLatest update time:2024-11-16 19:37
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Understanding of variable frequency power supply: What types of loads does variable frequency power supply have?
- Drive control design
- 【Multi-function thermal imager】Extension board production
- What are the similarities and differences between pulse transformers, power frequency transformers, and high frequency transformers?
- The Academic Degrees Committee of the State Council voted to approve the proposal to "establish integrated circuit as a first-level discipline"!
- Digital Signal Processor (DSP) – Machine Vision Applications
- esp32-s2-wrover cannot start after upgrading micropython 1.18
- Today is International Day Against Spatting. Were you ever spanked as a child?
- B&O Beoplay E8 TWS True Wireless Bluetooth Earphones
- Flyback switching power supply simulation using Saber