How to detect a circle in a binary image

xiaoxiao2021-03-06  44

Hoff Transformation is one of the basic methods of identifying geometries from the image in image processing, and there are many modifications.

Entering algorithm. The most basic Hoff transform is to detect a straight line (line segment) from the black and white image.

Let's first look at the problem: set a straight line in a black and white image, which requires this straight line. We know that the equation of the straight line can be represented by Y = k * x b, where K and B are parameters, which are slope and intercept. Parameters of all straight lines of a certain point (X0, Y0) meet the equation Y0 = Kx0 B. That is, the point (X0, Y0) determines a straight line. Equation Y0 = kx0 b is a straight line on the parameter K - B plane, (you can also be a straight line corresponding to equation B = -x0 * k Y0). Thus, a foreground pixel point on the image X-Y plane corresponds to a straight line on the parameter plane. We give an example to explain the principle of solving the previous problem. The straight line on the image is y = x, let's take the three points above: A (0, 0), B (1, 1), C (22). It can be found that the parameters of the straight line of a point must meet the equation B = 0, the parameters of the straight line of the B point should meet the equation 1 = k b, the parameters of the straight line of the C point should meet equation 2 = 2k B, These three equations correspond to three straight lines on the parameter plane, and these three lines will intersect a point (k = 1, b = 0). Similarly, other points on the original image (such as (3, 3), (4, 4), etc.) correspond to the straight line on the plane (k = 1, b = 0). This nature provides us to solve the problem:

First, we initialize a buffer, corresponding to the parameter plane, set all the data to 0.

For each front attraction on the image, the straight line corresponding to the parameter plane is obtained, and the value of all points on this line is added 1.

Finally, find the largest point on the parameter plane, this location is the parameters of the straight line on the original image. The above is the basic idea of ​​Hukov transformation. That is to correspond to the line on the image plane to the line on the parameter plane, and finally solve the problem by statistical characteristics. If there are two straight lines on the image plane, then two peak points will be seen on the parameter plane, and so on.

In practical applications, Y = K * X B forms of linear equations have no way to represent x = C forms (this time, the slope of the straight line is infinite). So in practical applications, the parameter equation P = X * COS (Theta) Y * SIN (Theta) is used. Thus, one point on the image plane corresponds to a curve on the parameter P --- Theta plane. Others are still the same.

Looking at one of the following questions: We have to detect a circular shape from a radius from a pair of images. This problem is more intuitive than the previous one. We can take the same parameter plane as the image plane, in the image on the image, and draw a circle on the parameter plane in a known radius, and accumulate the results. Finally, the peak point on the parameter plane is found, and this location corresponds to the center of the image. In this question, each point on the image plane corresponds to a circle on the parameter plane.

Change the above problem, if we don't know the value of the radius, to find the circle on the image. In this way, a method is to expand the parameter plane as a three-dimensional space. That is to say, the parameter space becomes three dimensional, the center of the corresponding circle and the radius. Every point on the image plane corresponds to a circle under each radius in the parameter space, which is actually a cone. Finally, of course, it is still looking for peak points in the parameter space. However, this method clearly requires a lot of memory, and the speed of operation will be a big problem.

Is there any better way? The images that we assume before we are black and white images (2-value images), in fact these 2-value images are mostly colored or grayscale images through edge extraction. We mentioned earlier, the image edge except location information, and the direction information is also important, here is used. According to the nature of the circle, the radius of the circle must be onto the straight line perpendicular to the cutting tangent, that is, on the round of any point on the circle. In this way, solve the above problem, we still use 2-dimensional parameter space, for each front attraction on the image, plus its direction information, you can determine a straight line, the circular center is on this straight line. In this way, the problem will be much simpler. There are still many similar problems, such as detecting ellipses, squares, rectangles, arcs, etc. Most of these methods are similar, the key is to familiarize with these geometric mathematics. The application of Hoff transform is very broad. For example, we must do a check identification task, assume that there is a red color square seal on the check, we can change this seal to this seal through Huff, and other means Other processing. Hoff transform is easy to position due to the influence of image rotation, so it is easy to position. Hoff transform has many improvement methods, a more important concept is a generalized Hoff transform, which is for all curves, and it is also very useful. It is also a multi-improved algorithm for the Hoff transformation of the straight line, such as the previous method we don't consider whether the line on the line on the image continuous problem, which has an optimized method as the application.

By the way, engage in image processing, in theory, there are several magazines to see, nature is English magazine, Chinese journals do not have special image processing journals, of course, there are also many journals involving this, but In fact, it is indeed a lot more than English magazine.

'IEEE Transactions on Pattern and Machine Intelligence' 'IEEE Transactions On Image Processing'

It is the most important two, and other conference articles such as ICIP are also very good. However, if you don't want to be very biased, these games don't have anything.

转载请注明原文地址:https://www.9cbs.com/read-70039.html

New Post(0)