A circular arc detection method and circular arc detection device
By determining the region of interest in the circle/arc detection and interpolation sampling along the pole radial direction, the complexity and calculation amount of edge detection are reduced, the detection efficiency and accuracy are improved, and the circle/arc detection in the prior art is solved The problem of low algorithm efficiency and poor real-time performance.
Patent Information
- Application Number
- CN202010340838.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-26
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2040-04-26
AI Technical Summary
The existing circle/arc detection algorithm has large calculation volume, low efficiency and poor real-time performance, making it difficult to meet the needs of actual engineering.
By determining the region of interest in the image to be detected and interpolated the pixel values in the region of interest along the pole radial direction, a plurality of first images along different pole radial directions are obtained, and each first image is then performed Edge detection, multiple edge points are obtained, and then the generated edge points are arc-fitted and filtered to obtain the characteristic parameters of the circle/arc.
It greatly reduces the complexity and calculation amount of edge detection, improves the efficiency and accuracy of edge detection, and can meet the real-time requirements of actual engineering.
Smart Images

Figure CN113643225B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an arc detection method and an arc detection device. Background Art
[0002] In actual production applications, it is necessary to rely on machine vision to extract circular / arc features, such as circular holes, cylinders or chamfers on workpieces. In order to ensure production efficiency, it is necessary to ensure that the process of feature extraction using machine vision has sufficient speed and efficiency.
[0003] The inventors of the present application have discovered during long-term research and development that the currently commonly used circle / arc detection algorithms, such as the Hough transform, often require edge detection of the entire image, analysis and processing of the detected edge points, and ultimately obtaining the characteristic parameters of the circle / arc; however, these methods have large computational complexity, low efficiency, and poor real-time performance, and are difficult to meet the needs of actual engineering projects. Summary of the invention
[0004] The main problem to be solved by the present application is to provide an arc detection method and an arc detection device, which can greatly reduce the complexity of edge detection, reduce the amount of calculation, improve the efficiency of edge detection, and improve the accuracy of detection.
[0005] In order to solve the above technical problems, the technical solution adopted in the present application is to provide an arc detection method, which includes: determining a region of interest in an image to be detected; interpolating pixel values in the region of interest along the polar direction of the region of interest to obtain a first image; performing edge detection on the first image to obtain multiple edge points; performing arc fitting screening on the multiple edge points to obtain characteristic parameters of the circle / arc.
[0006] To solve the above technical problems, another technical solution adopted in the present application is to provide an arc detection device, which includes an input unit, a processor and an output unit connected in sequence; wherein the input unit is used to obtain an image to be detected; the processor is used to determine a region of interest in the image to be detected; the pixel values in the region of interest are interpolated along the polar direction of the region of interest to obtain a first image; edge detection is performed on the first image to obtain multiple edge points; arc fitting and screening are performed on the multiple edge points to obtain characteristic parameters of the circle / arc; the output unit is used to output the characteristic parameters of the circle / arc.
[0007] In order to solve the above technical problem, another technical solution adopted by the present application is to provide a storage medium, which is used to store a computer program. When the computer program is executed by a processor, it is used to implement the above arc detection method.
[0008] Through the above scheme, the beneficial effects of the present application are: determining the area of interest in the image to be detected, interpolating the pixel values in the area of interest along the polar direction, obtaining multiple first images along different polar directions, and then performing edge detection on each first image to obtain edge points in multiple first images respectively, and then performing arc fitting and screening on the generated edge points to obtain the characteristic parameters of the circle / arc; since the method of interpolation along the polar direction is used to sample the image to be detected, the workload of edge detection and analysis and processing of edge points is greatly reduced, the complexity of edge detection is reduced, the amount of calculation can be reduced, the efficiency of edge detection can be improved, and since the interpolated image is used for edge detection, the accuracy of detection can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0010] Figure 1 It is a flow chart of an embodiment of an arc detection method provided by the present application;
[0011] Figure 2 is a flow chart of another embodiment of the arc detection method provided by the present application;
[0012] Figure 3 is a schematic diagram of an area of interest in another embodiment of the arc detection method provided by the present application;
[0013] Figure 4 is a schematic diagram of interpolation along the polar radius direction in another embodiment of the arc detection method provided by the present application;
[0014] Figure 5 is a schematic diagram of a vertical edge in another embodiment of the arc detection method provided by the present application;
[0015] Figure 6 is a schematic diagram of an area to be determined in another embodiment of the arc detection method provided by the present application;
[0016] Figure 7 It is a structural schematic diagram of an embodiment of an arc detection device provided by the present application;
[0017] Figure 8 It is a structural diagram of an embodiment of a storage medium provided by the present application. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0019] The arc detection method in the present application can be widely used in the detection of various objects with arc boundaries in the field of machine vision. For example, circular structures on the surface of workpieces or objects can be detected to obtain information such as the specific position and size of the circular structure, so as to determine whether the setting of the circular structure meets the standards.
[0020] See also Figure 1 , Figure 1 : is a flow chart of an embodiment of an arc detection method provided by the present application, the method comprising:
[0021] Step 11: Determine the region of interest in the image to be detected.
[0022] The target object to be detected is converted into a digital image, i.e., the image to be detected, by a camera device. The image to be detected is an image with a circle or an arc, which can be a grayscale image, a color image or a depth image. For ease of processing, the color image or the depth image can be converted into a grayscale image first.
[0023] After acquiring the image to be detected, in order to obtain the characteristic parameters of the circle / arc in the image to be detected, a region of interest (ROI) is determined in the image to be detected to reduce processing time and increase accuracy; the region of interest is the area to be processed, and its shape can be a circle, annular ring, sector or sector-shaped ring, etc. The center of the annular ring or sector-shaped area can be defined by the user or default.
[0024] Furthermore, in order to determine whether the setting of the region of interest is reasonable, an out-of-bounds check can be performed on the region of interest, that is, to check whether the region of interest exceeds the boundary of the image to be detected; if the region of interest does not exceed the boundary of the image to be detected, step 12 is executed; if the region of interest exceeds the boundary of the image to be detected, the region of interest can be re-determined until the set region of interest does not exceed the boundary.
[0025] Step 12: interpolate the pixel values in the region of interest along the polar direction of the region of interest to obtain a first image.
[0026] After determining the region of interest in the image to be detected, the image to be detected is sampled, multiple radial directions are selected, and interpolation is performed along each radial direction to obtain multiple pixel values along the radial directions to form a first image, and each radial direction corresponds to a first image; wherein the radial directions may be multiple directions starting from a preset position in the image to be detected; for example, when the region of interest is a sector-shaped area, the preset position is the center of the sector-shaped area.
[0027] Step 13: Perform edge detection on the first image to obtain multiple edge points.
[0028] The edge detection method is used to perform edge detection on multiple first images obtained by the interpolation method to obtain edge points corresponding to each first image; the edge detection algorithm can be implemented by calculating the first-order derivative, second-order derivative or gradient of the neighborhood pixels.
[0029] Step 14: Perform arc fitting screening on multiple edge points to obtain characteristic parameters of the circle / arc.
[0030] After acquiring the edge points corresponding to each first image, these edge points may be fitted and screened multiple times to finally obtain characteristic parameters of a circle / arc, which include center coordinates, radius or center angle, and the like.
[0031] Different from the prior art, in order to ensure the efficiency and accuracy of feature extraction of circles / arcs, the present embodiment provides a fast arc detection method, which uses a multi-row interpolation method to sample the image to be detected, first determines the region of interest in the image to be detected, and then interpolates the pixel values in the region of interest along the polar direction to obtain multiple first images along different polar directions, and performs edge detection to obtain multiple edge points, and then performs multiple arc fitting and screening on the generated edge points to finally obtain the characteristic parameters of the circle / arc; since the method of interpolation along the polar direction is used to sample the image to be detected, the workload of edge detection and edge point analysis and processing is greatly reduced, the complexity of edge detection is reduced, the amount of calculation can be reduced, and the efficiency of edge detection can be improved; and since the interpolated image is used for edge detection, sub-pixel coordinates can be used for calculation, and the obtained characteristic parameters are decimals, compared with the original pixel values in the image to be detected, integer characteristic parameters are obtained, which can ensure that the detection result has sufficient accuracy and improve the accuracy of detection.
[0032] See also Figure 2 , Figure 2 : is a flow chart of another embodiment of the arc detection method provided by the present application, the method comprising:
[0033] Step 21: Determine the region of interest in the image to be detected.
[0034] Step 22: In the circular ring / sector-shaped area, multiple interpolation positions are obtained along the polar radius direction of the circular ring / sector-shaped area.
[0035] The interpolation positions in each radial direction are spaced by a first preset distance, and the angle between two adjacent radial directions is a preset angle. The number of radial directions and the preset angle can be set by the user or by default. Figure 3 As shown, the number of polar radius directions is 8, point O is the center of the sector-shaped circular ring area S, and OA-OH are polar radiuses, which are evenly distributed.
[0036] Step 23: Obtain the pixel value at each interpolation position using a bilinear interpolation method to form a corresponding first image.
[0037] For example, Figure 3 Taking the mid-pole diameter OA as an example, Figure 4 As shown, L AG1 =L G1G2 =…=L G4G5 , L AG1 is the distance between point A and point G1, L G1G2 is the distance between point G1 and point G2, L G4G5 is the distance between point G4 and point G5. Since the coordinates of points G1-G5 are not integers, the bilinear interpolation method can be used to calculate their pixel values using the pixel values adjacent to points G1 / G2 / G3 / G4 / G5 to obtain the pixel value {P G1 , P G2 , P G3 , P G4 , P G5}, the pixel values constituting the first image, P G1 -P G5 They are the pixel values corresponding to points G1-G5 respectively.
[0038] Step 24: Perform edge detection on each first image using an edge detection method to obtain a first edge detection result.
[0039] Each first image is processed using an edge detection method to obtain a first edge detection result; edge detection can be completed by using methods such as gradient calculation, and in digital image processing, gradient calculation can be completed using convolution operation, thereby completing edge detection; edge points in each first image are generally on different circles / arcs, and edge points in different first images may be on the same circle / arc.
[0040] Furthermore, the first image can be directly smoothed and filtered, and then the image gradient can be calculated using the Sobel operator, and threshold processing can be performed to obtain an edge map of the first image; or the Canny edge detection method can be used to first perform Gaussian filtering on the first image, and then calculate the gradient amplitude image, and then perform non-maximum suppression, and finally use double threshold processing and connection analysis to perform edge connection.
[0041] Step 25: Screen the first edge detection result to obtain a second edge detection result.
[0042] In a specific embodiment, the screening method is: performing non-extreme value suppression and thresholding processing on the first edge detection result to screen out some edge points in the first edge detection result.
[0043] Specifically, the first edge detection result is first convolved with a convolution kernel to obtain a corresponding gradient value; the gradient value is then subjected to non-extreme value suppression processing to screen out non-edge points to obtain a first edge point. Since the edge point is located at the local extreme value of the gradient value, the non-extreme value suppression processing can screen out pixels with large local gradient values but not edge points to produce a finer edge image; the first edge point is then screened using a thresholding process to screen out the first edge points that do not meet the preset threshold to obtain a second edge point, which can screen out edge points that do not meet the threshold requirements and further screen out non-edge points.
[0044] Step 26: Group the second edge points to obtain multiple groups of third edge points.
[0045] There are two types of polarity of edge points: positive and negative; according to the polarity of the second edge point, all the second edge points are divided into two groups of third edge points; when the value of the adjacent pixels including the second edge point along the preset direction gradually increases, the polarity of the second edge point is positive; when the value of the adjacent pixels including the second edge point along the preset direction gradually decreases, the polarity of the second edge point is negative.
[0046] Furthermore, when the edge formed by the plurality of second edge points is a horizontal edge, the preset direction is a vertical downward direction; when the edge formed by the plurality of second edge points is a vertical edge, the preset direction is a horizontal rightward direction. Figure 5 As shown, the shaded part is the edge pixel, which is a vertical edge, the preset direction is horizontal to the right, and the polarity of these edge points is positive.
[0047] Step 27: Use a circle fitting method to perform circle fitting on each group of third edge points to obtain multiple circles / arcs.
[0048] In a specific embodiment, step 27 can be divided into the following steps:
[0049] Step 1: Use the circle fitting method to fit each group of third edge points to obtain at least one fitting circle.
[0050] The circle fitting method may be an average value method or a least-two-value method. The circle fitting method is used to fit two groups of third edge points respectively, thereby obtaining two fitting circles.
[0051] Step 2: Calculate the distance between each third edge point and the corresponding fitting circle, screen out the third edge points whose distance from the fitting circle is greater than the second preset distance, record the third edge points that meet the requirements of the second preset distance as fourth edge points, record the screened out third edge points as fifth edge points, and store them.
[0052] The third edge points in each group whose distance to the corresponding fitting circle is greater than the second preset distance are filtered out, the third edge points whose distance between the two is greater than the second preset distance are recorded as fourth edge points, and the third edge points whose distance between the two is less than or equal to the second preset distance are recorded as fifth edge points, and are stored for later use.
[0053] Step 3: Repeat the above fitting and screening steps until the number of fourth edge points in each group is less than the number of preset interpolation rows, and the distance between the fourth edge point and the fitting circle is less than the second preset distance.
[0054] Repeat steps 1 and 2 until the number of fourth edge points in each group is less than the number of preset interpolation rows, and the distance or the variance of the distance between each fourth edge point and the fitting circle obtained by fitting multiple fourth edge points is less than a second preset distance; the number of preset interpolation rows is the same as the number of the first image, and the number of preset interpolation rows can be greater than 3.
[0055] Step 4: Fit the fourth fitting point in each group to obtain the characteristic parameters of the corresponding circle / arc.
[0056] The fourth edge point retained in step 3 is fitted using a circle fitting method to obtain a corresponding feature parameter, which can be a decimal to increase the accuracy of detection.
[0057] Step 5: Repeat steps 1 to 4 to process the fifth edge point until each fifth edge point is grouped and fitted.
[0058] For example, the number of preset interpolation rows is 8. Taking the positive edge points as an example, assuming that the third edge points are P1-P50, the third edge points P1-P50 are fitted using the method of step one to obtain the fitting circle FC; the method of step two is used to process and calculate whether the distance between the third edge points P1-P50 and the fitting circle FC is greater than the second preset distance, and finally the fourth edge points P1-P42 and the fifth edge points P43-P50 are obtained after screening; step three is executed to obtain four groups of fourth edge points: P1-P8, P9-P16, P17-P24 and P25-30, and the remaining edge points P31-P50 are all fifth edge points; step four is executed for the four groups of fourth edge points: P1-P8, P9-P16, P17-P24 and P25-30 are fitted respectively to obtain four groups of feature parameters; execute step five, for the fifth edge point P31-P50, use the methods of step one to step four to process, complete grouping and fitting, and obtain four groups of edge points: P31-P35, P36-P41, P42-P45 and P46-P50, fit them respectively to obtain corresponding feature parameters, thereby obtaining 8 groups of feature parameters, and their corresponding edge points are P1-P8, P9-P16, P17-P24, P25-30, P31-P35, P36-P41, P42-P45 and P46-P50.
[0059] Using the method of step 26 and step 27, the edge points are first grouped, and then circle fitting is performed on each group of edge points to fit a number of circles / arcs. Then, contrast detection is performed on these circles / arcs to screen out circles / arcs that do not meet the contrast requirements.
[0060] Step 28: Perform contrast detection on the pixel values at multiple circles / arcs, and filter out circles / arcs that do not meet the preset contrast requirement.
[0061] Using the feature parameters obtained in step 27, the corresponding image is subtracted from the image to be detected for contrast detection to determine whether there is actually an edge in the area corresponding to the feature parameters, and the circles / arcs that do not meet the preset contrast are screened out; specifically, 3-5 pixels including the edge point can be subtracted from the adjacent pixels corresponding to each edge point.
[0062] In a specific embodiment, an area containing a circle / arc is recorded as an area to be determined, and a pixel value of the area to be determined is obtained, and the shape and size of the area to be determined are matched with the characteristic parameters of the circle / arc; it is determined whether the contrast of the area to be determined is greater than a preset contrast; if the contrast of the area to be determined is greater than the preset contrast, it is determined that the area to be determined has a circle / arc; if the contrast of the area to be determined is less than or equal to the preset contrast, it is determined that the area to be determined does not have a circle / arc, that is, the edge corresponding to the characteristic parameter is a false edge.
[0063] For example, Figure 6 As shown, the fan-shaped edge S is calculated by adopting steps 21 to 27. In order to verify whether the fan-shaped edge S is a real edge in the image to be detected, the pixel value near the edge point in the fan-shaped edge S can be used for judgment; for the area Q to be determined containing the fan-shaped edge S, it is determined whether the contrast of the sub-area containing the edge point is greater than the preset contrast, such as: whether the contrast in the sub-area A is greater than the preset contrast. If the contrast of each sub-area or the sub-area exceeding the preset ratio is greater than the preset contrast, it is determined that the fan-shaped edge S is real, otherwise, it is determined to be a false edge.
[0064] In the process of circle / arc detection, in order to reduce the amount of calculation, it is often necessary to place a circular / sector-shaped region of interest in the image to be detected; interpolate the region of interest from the center of the circular / sector-shaped region of interest to obtain several first images; then use the edge detection method to perform edge detection on the first image; by screening the edge points and calculating the sub-pixel coordinates, the specific position of the real edge point can be obtained; by grouping and fitting the edge points, multiple fitting results are obtained; then contrast detection is performed on the fitted circle / arc in the image to be detected to check the rationality of the fitted circle / arc; finally, the characteristic parameters of the real circle / arc are output.
[0065] By sampling and interpolating the region of interest, it is possible to avoid extreme value processing of the image corresponding to the entire region of interest, thereby greatly reducing the workload of edge detection and analysis and processing of edge points; by adopting sub-pixel coordinates and fitting screening methods, the accuracy of circle / arc detection can be improved, ensuring that the detection result reaches 0.2 pixel accuracy.
[0066] See also Figure 7 , Figure 7 1 is a schematic diagram of the structure of an embodiment of an arc detection device provided in the present application. The arc detection device includes an input unit 71, a processor 72 and an output unit 73 connected in sequence.
[0067] The input unit 71 is used to obtain the image to be detected; the processor 72 is used to determine the region of interest in the image to be detected; the pixel values in the region of interest are interpolated along the polar direction of the region of interest to obtain a first image; edge detection is performed on the first image to obtain multiple edge points; arc fitting and screening are performed on the multiple edge points to obtain characteristic parameters of the circle / arc; the output unit 73 is used to output the characteristic parameters of the circle / arc.
[0068] In this embodiment, the processor 72 uses a row interpolation method to sample the image to be detected, which greatly reduces the workload of edge detection and edge point analysis and processing, can improve detection efficiency, and can reduce the amount of calculation to meet the efficiency requirements of actual production; at the same time, due to the use of sub-pixel coordinates, the detection accuracy can be improved.
[0069] See also Figure 8 , Figure 8 It is a structural diagram of an embodiment of a storage medium provided in the present application, wherein the storage medium 80 is used to store a computer program 81, and the computer program 81 is used to implement the above-mentioned arc detection method when executed by a processor.
[0070] The storage medium 80 may be a server, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other media that can store program codes.
[0071] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only illustrative, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0072] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0073] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0074] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A circular arc detection method, characterized in that: include: Determine a region of interest in the image to be detected; Interpolating pixel values in the region of interest along the polar direction of the region of interest to obtain a first image; Performing edge detection on the first image to obtain a plurality of edge points; Perform arc fitting screening on the plurality of edge points to obtain characteristic parameters of the circle / arc; The region of interest is a circular ring / sector-shaped region, the characteristic parameters of the circle / arc include the coordinates of the center of the circle and the radius, and the step of interpolating the pixel values in the region of interest along the polar direction of the region of interest to obtain the first image includes: In the annular / sector-shaped area, a plurality of interpolation positions are obtained along the polar direction of the annular / sector-shaped area, wherein the interpolation positions in each polar direction are spaced apart by a first preset distance, and the angle between two adjacent polar directions is a preset angle; Obtaining the pixel value at each interpolation position by using a bilinear interpolation method to form the corresponding first image; The step of performing arc fitting screening on the plurality of edge points to obtain characteristic parameters of the circle / arc comprises: Grouping the second edge points to obtain multiple groups of third edge points; Performing circle fitting on each group of the third edge points using a circle fitting method to obtain a plurality of circles / arcs; Contrast detection is performed on the pixel values at the multiple circles / arcs, and the circles / arcs that do not meet the preset contrast requirement are screened out.
2. The arc detection method according to claim 1, characterized in that: The step of performing edge detection on the first image to obtain a plurality of edge points comprises: Performing edge detection on each of the first images using an edge detection method to obtain a first edge detection result; The first edge detection result is screened to obtain a second edge detection result.
3. The arc detection method according to claim 2, characterized in that: The step of screening the first edge detection result to obtain the second edge detection result includes: Non-extreme value suppression and thresholding processing are performed on the first edge detection result to screen out some edge points in the first edge detection result.
4. The arc detection method according to claim 3, characterized in that: The step of performing non-extreme value suppression and thresholding processing on the first edge detection result to screen out some edge points in the first edge detection result includes: Convolving the first edge detection result with a convolution kernel to obtain a corresponding gradient value; Performing non-extreme value suppression processing on the gradient value to screen out non-edge points and obtain a first edge point; The first edge points are screened by thresholding, and the first edge points that do not meet a preset threshold are screened out to obtain second edge points.
5. The arc detection method according to claim 4, characterized in that: The step of grouping the second edge points to obtain multiple groups of third edge points includes: According to the polarities of the second edge points, dividing all the second edge points into two groups of the third edge points; Among them, when the values of neighboring pixels including the second edge point gradually increase along the preset direction, the polarity of the second edge point is positive; when the values of neighboring pixels including the second edge point gradually decrease along the preset direction, the polarity of the second edge point is negative.
6. The arc detection method according to claim 5, characterized in that: The step of performing circle fitting on each group of the third edge points using a circle fitting method to obtain a plurality of circles / arcs comprises: Fitting each group of the third edge points using the circle fitting method to obtain at least one fitting circle; Calculating the distance between each of the third edge points and the corresponding fitting circle, screening out the third edge points whose distance from the fitting circle is greater than a second preset distance, recording the third edge points that meet the requirement of the second preset distance as fourth edge points, recording the screened out third edge points as fifth edge points, and storing them; Repeat the above steps until the number of the fourth edge points in each group is less than the number of preset interpolation rows, and the distance between the fourth edge point and the fitting circle is less than the second preset distance; Fitting the fourth fitting point in each group to obtain the corresponding characteristic parameters of the circle / arc; Repeat the above steps to process the fifth edge point until the grouping and fitting of each fifth edge point is completed.
7. The arc detection method according to claim 6, characterized in that: The step of performing contrast detection on the pixel values at the plurality of circles / arcs and screening out the circles / arcs that do not meet the preset contrast requirement comprises: Recording the area containing the circle / arc as the area to be determined, and obtaining the pixel value of the area to be determined, wherein the shape and size of the area to be determined match the characteristic parameters of the circle / arc; It is determined whether the contrast of the area to be determined is greater than the preset contrast. If so, it is determined that the area to be determined has the circle / arc. Otherwise, it is determined that the area to be determined does not have the circle / arc.
8. An arc detection device, characterized in that: comprising an input unit, a processor and an output unit connected in sequence; The input unit is used to obtain an image to be detected; the processor is used to determine an area of interest in the image to be detected; the pixel values in the area of interest are interpolated along the polar direction of the area of interest to obtain a first image; edge detection is performed on the first image to obtain a plurality of edge points; arc fitting is performed on the plurality of edge points to obtain characteristic parameters of the circle / arc; the output unit is used to output the characteristic parameters of the circle / arc; the area of interest is a circular ring / sector-shaped area, the characteristic parameters of the circle / arc include the coordinates of the center of the circle and the radius, and the processor is used to: A plurality of interpolation positions are obtained along the radial direction of the circular ring / sector-shaped area, wherein the interpolation positions in each radial direction are spaced by a first preset distance, and the angle between two adjacent radial directions is a preset angle; a pixel value at each interpolation position is obtained by using a bilinear interpolation method to form the corresponding first image; the processor is used to: group the second edge points to obtain a plurality of groups of third edge points; perform circle fitting on each group of the third edge points by using a circle fitting method to obtain a plurality of circles / arcs; perform contrast detection on the pixel values at the plurality of circles / arcs to filter out the circles / arcs that do not meet the preset contrast requirements.
Citation Information
Patent Citations
Stable high-performance circle feature detection method
CN106530347A
Brake block dimension detecting method and device based on machine vision
CN108460776A