OpenCV is an open-source machine vision Library Supported by Interl. For its introduction, you can search for it on the Internet. I will not talk about the main content of OpenCV here. Instead, I will give a brief introduction to the usage experience of OpenCV during this period, so as to inspire my friends who intend to use this library and share their ideas with you.
When I was at school, although I was studying image processing, I was still involved in my work after I applied many things to images. In the past, when we were dealing with images, we never worried about speed. We thought that computer hardware had grown to this day and we were omnipotent. The processing speed of dual-core and quad-core systems was almost catching up with the space ship. However, it is another thing to use in machine vision. Generally speaking, machine vision requires that the image processing speed is measured in milliseconds (MS), specifically a few milliseconds, hardware hard, if the algorithm is not good, the speed is never up, so the speed is crucial, not determined by the hardware technology.
Speed is one aspect, and accuracy is another important aspect. The requirements for accuracy in vision are usually measured by sub-pixel standards. Therefore, image processing algorithms are not generally used. subpixel algorithms are often used to achieve sub-pixel standards. Generally, the pixel coordinates of an image are calculated using integers. However, the sub-pixel standard is generally used in machine vision, which is calculated by floating point numbers. However, although some are written as floating-point numbers, they are not necessarily subpixel algorithms, and their results are not subpixels at all. The requirements for precision in vision are also extremely high. Generally, the measurement unit is micron (um), such as a few microns. This requirement can be met only by using sub-pixel algorithms.
In general, there is currently no successful Machine Vision Development Kit in China, and large domestic Machine Vision companies are basically focusing on foreign agent software. On the one hand, it is a late start in China, but I think there are more reasons for the lack of efforts in this field to do some basic research work, the development of a visual system is always achieved by proxy of others. OpenCV is the best basic job in machine vision.
In general, the function library provided by OpenCV involves a wide range of features and powerful image processing functions. However, it is only a basic thing for research and is not a plaster, you can easily paste the image. We can develop our own products only by conducting in-depth research on some of the basic functions it provides.
As an open-source function library, OpenCV provides us with a lot of convenience. Looking at its source code, there are indeed many unique points worth learning. But as an open source, the limitations are also here. Many of its things are not optimal. If so, they can be used commercially. Therefore, we only need to constantly transform it to make it closer to our applications. Here we will describe it based on my usage.
The first is image positioning. OpenCV also provides a function for Image Matching. This function is well written, but it cannot be used commercially. Because of its slow processing speed, the accuracy is not sub-pixel, and there is no rotation. It is just a simple gray-scale positioning. How can we make good use of this function? when using this function, I made a lot of effort and made some improvements to it, so that it truly realized commercial value. Today, the positioning software I have written with OpenCV is no less fast and accurate than those famous-name software in foreign countries, such as software giants like halcon and sapera, the positioning effect I made with OpenCV, such as an image with a resolution of 1280*1024, is several milliseconds, I have made a maximum of 3 to 4 milliseconds, and the accuracy is similar. However, because OpenCV is not limited by sub-pixels, the accuracy is usually around one pixel.
Furthermore, halcon uses a geometric shape-based algorithm for geometric positioning. It can be said that halcon is doing very well, so that its template image shape can be freely selected and rotated. Sapera's edge profile-based positioning is still at a level. No one knows about Sapera's algorithms, and it is still a mystery. In many machine Image Positioning, geometric positioning is more effective and accurate. In some situations where the histogram of the image area is similar, it is difficult to locate the target area. Geometric positioning, based on the geometric characteristics of the region, is not only accurate, but also more efficient. At present, the geometric positioning I have done with OpenCV has a good overall effect, but the accuracy is not enough. It is not so accurate in the clutch of image edges. However, in subsequent studies, it will catch up.
Generally, the target area of the image is shaped, but in actual use, I met a customer who only needs to locate a straight line. Because a straight line does not belong to a shape area, its features are difficult to describe, so it seems the simplest but the most difficult to do. OpenCV uses the Hough transform to detect straight lines and circles, and the effect is not good. Because the essence of the Hough transformation is the ing of Two Different spaces, the Results Detected in the noisy images are strange. Therefore, to accurately locate the edge, we must pre-process the image, so that the processed edge is clearly displayed. Therefore, it is much easier to perform the image moderation by using the best-of-breed method.
In machine vision, Blob analysis is common, and OpenCV also has Blob tracking instances. However, I did not use them seriously, but I made an algorithm and implemented it myself, and the effect is good. I am working on a beer bottle grinding tool number detection project, I called my own design of Blob analysis algorithm, the results are good. In actual use, we often need to use our own defined image types. So I modified the IplImage structure in OpenCV and then defined my own image class, it can be read at will, which makes it much easier. In fact, the operations on files in OPenCV are quite well written and very convenient.
In general, OpenCV is a very good open-source project, and there are many things we need to learn. However, it is not easy to read the source code. Because it involves a large number of macro definitions, many function statements are macro definitions, and they are nested with each other, which seems quite difficult. I am not familiar with it for only two or three months. You have to learn and explore and digest it in practice. Here, we only want to remind you of one idea. It is inconvenient to explain the algorithm. Otherwise, the boss will definitely criticize it. Store is like a battlefield. Keep everything confidential. Haha! (If a friend needs software, contact me)
Master Yu Shenzhen
2007.10.2
SkySeraph Oct24th HQU