Image circular hole counting and classifying method
Through image acquisition, processing and statistical methods, the problem of inaccurate round hole identification caused by image stretching and deformation is solved, fast and accurate round hole counting and classification are achieved, and efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202410643444.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-23
AI Technical Summary
The existing technology cannot effectively handle image stretching and deformation during image acquisition, resulting in inaccurate round hole recognition and fitting, and fails to complete the entire process from image acquisition to feature recognition and classification.
Image acquisition, cropping, denoising processing, threshold processing, contour extraction and statistical methods are used to remove outliers and distinguish large and small circles through first-order moments and aspect ratios, and calculate the number of holes.
It achieves fast and accurate counting and classification of circular holes, reduces the randomness of preset values, avoids a large amount of image collection and model training work in deep learning, and improves efficiency and accuracy.
Smart Images

Figure CN118608463A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to an image circular hole counting and classification method. Background Art
[0002] In the aircraft manufacturing process, due to process requirements such as riveting, circular holes need to be left on the surface of parts when they are made. There are two common types of holes: large holes and small holes. In order to ensure the quality of riveting and reduce the rework cycle, it is necessary to count and classify the circular holes on the surface of parts. In the prior art, there is a Chinese invention patent named "A circular object detection method and system" with a patent application number of CN202111570608.4, which discloses a circular object detection method, including the following steps: S1, put the edge points of the circle to be detected into the edge point set D, divide the edge point set D into at least four equal parts according to the angle, and each equal part Corresponding to an area; S2, randomly select three fitting points d1, d2, d3 from the three areas, and detect the parameters of the candidate circle fitted based on the three fitting points d1, d2, d3; S3, randomly select the verification point d4, and substitute the verification point d4 into the candidate circle P1; S4, if the verification point is within the allowable deviation range of the candidate circle, the count score of the candidate circle P1 is increased by 1, the number of verifications k2=k2+1, and return to step S3. When the number of verifications reaches the maximum number of cycles k2max, if the count score of the candidate circle P1 reaches the set threshold Nt, the candidate circle P1 is a true circle.
[0003] The focus of the comparison document is on the identification and fitting of circles. The fitting of true circles depends on the accuracy of the image and fitting algorithm. If the circle is stretched and deformed when the image is taken, the true circle cannot be accurately found according to this document. The comparison document has the following differences and shortcomings:
[0004] (1) The application scenarios of the comparison files are highly dependent on the image acquisition level. Once the shooting angle changes and the image is stretched, it is impossible to accurately fit a circle according to three points and identify a true circle.
[0005] (2) The comparison document focuses on circle fitting and does not involve image pre- and post-processing such as image acquisition, denoising, feature extraction and classification. It is impossible to complete the entire process from image acquisition to feature recognition and classification end-to-end. The problem addressed by the comparison document cannot be solved by the comparison document method. Summary of the invention
[0006] In order to solve the above problems, the present invention provides an image circular hole counting and classification method for counting and classifying circular holes on the surface of parts.
[0007] In order to achieve the above-mentioned invention object, the technical solution provided by this application is as follows:
[0008] A method for counting and classifying circular holes in an image comprises the following steps:
[0009] S1. Using image acquisition equipment to acquire images;
[0010] S2. Crop the collected image;
[0011] S3. Perform denoising according to the features of the collected image;
[0012] S4. threshold processing according to the collected image features;
[0013] S5. Extract the contours of the image after threshold processing and fill the contours. Each contour is composed of the pixels where it is located. Assume that an image has I contours in total, and the i-th contour is {(x 1 ,y 1 ),(x 2 ,y 2 ),……,(x n ,y n )}, where (x, y) is the coordinate of each pixel point, and n is the number of all pixels of the contour;
[0014] S6. Calculate the first-order moment m of each extracted contour 00 :
[0015]
[0016] Where I(x,y) is the pixel value of the pixel point (x,y), and all non-zero pixel values are recorded as 1 during calculation;
[0017] S7. Remove abnormal contours that do not meet the requirements;
[0018] S8. Divide the large holes and small holes, and calculate the number of large holes and small holes.
[0019] Furthermore, the S1 specifically includes:
[0020] S11. Collection preparation: The light source position and light intensity are fixed for each collection. There is a clear contrast between the background and the color of the object to be collected. The background is kept clean without any extra objects. When collecting, the object to be collected is placed flat on the table, and the camera is parallel to the object to be collected.
[0021] S12. Collection process: During collection, the complete surface of the object to be collected is collected at one time. If there is circular hole information on multiple surfaces of the object to be collected, each surface is collected to ensure that only one surface is collected each time.
[0022] Furthermore, the S2 specifically includes:
[0023] The image is read as a grayscale image on the computer. If it is a color image, it is converted to a grayscale image before cropping;
[0024] S21. If there is more than one background, cropping is performed, and an arbitrary shape cropping method is used during cropping, only the object to be collected is retained, and redundant complex backgrounds are removed;
[0025] S22. If the background has only one color and has a large contrast with the color of the object to be collected, the background is retained without cropping.
[0026] Furthermore, the S3 specifically includes:
[0027] S31. If the noise in the image is scattered like snowflakes or there are tiny circular holes with a diameter less than one tenth of the diameter of the smallest circular hole, salt and pepper denoising is performed, and the pixels of the selected kernel size are sorted by pixel value, and the middle value is selected as the pixel value of the center pixel. The kernel size is based on the maximum size that does not blur the smallest circular hole;
[0028] S32. If the image has no impurities except the single-color background and the circular hole, perform Gaussian filtering, select the kernel size, and calculate the pixel value of the intermediate value according to the two-dimensional Gaussian function. The kernel size is based on the maximum size that does not blur the smallest circular hole.
[0029] Furthermore, the S4 specifically includes:
[0030] S41. If the background is single, an adaptive threshold algorithm is used to select the threshold by maximizing the inter-class variance.
[0031] S42. If the background is not single, the adaptive threshold algorithm is used for adjustment, and the adaptive threshold is floated up and down by 40 values. First, a rough threshold is selected from the center of the optimal threshold with a step length of 10, and then a fine selection is performed with a step length of 1 to select the optimal threshold from which the circular hole and the background are accurately separated;
[0032] S43: If the background is not single, the grayscale value of the image background boundary is consistent with the grayscale value of the circular hole using an adaptive threshold algorithm, a grayscale distribution map is drawn, and 3 to 4 points with the largest changes in the image trough are selected through the grayscale distribution map for threshold segmentation.
[0033] Furthermore, the S7 specifically includes:
[0034] S71. Delete the first-order moment m 00 The contour is 0;
[0035] S72. Draw a contour rectangle. Each contour consists of n points. The longest distance of the i-th contour on the x-axis is the width w of the rectangle. i , the longest distance on the y-axis is the height h of the rectanglei :
[0036]
[0037] where x p 、x q is the horizontal coordinate of the n points that make up the contour, y p ,y q is the ordinate of the n points that make up the contour;
[0038] S73. Calculate the aspect ratio r of each contour i :
[0039]
[0040] S74. Aspect Ratio {r 1 ,r 2 ,……,r I}Draw a box plot to check the abnormal points;
[0041] S75. 1 ,r 2 ,……,r I} Sort from small to large and extract the upper quartile q of the sorted sequence 1 , which is the 25th percentile number in the sequence, q 1 The location is Extract the lower quartile q of the sorted sequence 2 , which is the 75% number in the sequence position, q 2 The location is The interquartile range iqr = q is calculated 2 -q 1 , the upper and lower limits of distinguishing abnormal points are:
[0042]
[0043] Where k is the selected threshold;
[0044] S76: Remove abnormal contours outside the upper and lower limits.
[0045] Furthermore, the S8 specifically includes:
[0046] S81. Recalculate the first-order moment after removing the abnormal contour and sort it to obtain the sorted first-order moment sequence {m 1 ,m 2 ,……,m L}, L is the number of all contours after removing abnormal contours.
[0047] S82. Calculate the first-order difference d j :
[0048] d j =m j -m j-1 ,j=1,2,……,L,
[0049] Among them, the supplement m 0 =m 1 ;
[0050] S83. Extract the differential sequence {d 1 ,d 2 ,……,d L}The subscript index of the maximum value in .
[0051] index=argmax({d 1 ,d 2 ,……,d L})
[0052] S84. The number of small holes is index-1, and the number of large holes is L-index+1.
[0053] The beneficial effects of the present invention are:
[0054] 1. This method distinguishes outliers by quartiles. Compared with distinguishing outliers by calculating variance and mean, it does not need to determine the number of outliers in advance and then search for outliers point by point, which reduces the randomness of preset values and is faster and more accurate.
[0055] 2. This method selects the first-order moment and aspect ratio as features for post-processing. Compared with deep learning, it does not require a lot of work such as collecting thousands of images, labeling images, and training models, and is more efficient and quick.
[0056] 3. This method focuses on the extraction of circles and the distinction between large and small circles. For images with a single feature of a circle, image features are extracted through standard shooting, image denoising, threshold processing and other methods, and then outliers are removed and large and small circles are distinguished based on statistical methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a flow chart of the present invention.
[0058] Figure 2 This is the black and white image after threshold processing.
[0059] Figure 3 Box plot of the first moment.
[0060] Figure 4 A line chart of first-order differences. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is to explain the present invention rather than to limit the present invention. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0062] The specific implementation method of the present invention is described below with reference to the accompanying drawings and examples, but the present invention is not limited to this embodiment.
[0063] Example 1
[0064] like Figure 1 As shown, a method for counting and classifying circular holes in an image comprises the following steps:
[0065] S1. Use a camera or other image acquisition device to acquire images;
[0066] S2. Crop the collected image;
[0067] S3. Perform denoising according to the features of the collected image;
[0068] S4. threshold processing according to the collected image features;
[0069] S5. Extract the contours of the image after threshold processing and fill the contours. Each contour is composed of the pixels where it is located. Assume that an image has I contours in total, and the i-th contour is {(x 1 ,y 1 ),(x 2 ,y 2 ),……,(x n ,y n )}, where (x, t) is the coordinate of each pixel point, and n is the number of all pixels of the contour;
[0070] S6. Calculate the first-order moment m of each extracted contour 00 :
[0071]
[0072] Where I(x,y) is the pixel value of the pixel point (x,y), and all non-zero pixel values are recorded as 1 during calculation;
[0073] S7. Remove abnormal contours that do not meet the requirements;
[0074] S8. Divide the large holes and small holes, and calculate the number of large holes and small holes.
[0075] Example 2
[0076] like Figure 1 As shown, a method for counting and classifying circular holes in an image comprises the following steps:
[0077] S1. Use a camera or other image acquisition device to acquire images;
[0078] S2. Crop the collected image;
[0079] S3. Perform denoising according to the features of the collected image;
[0080] S4. threshold processing according to the collected image features;
[0081] S5. Extract the contours of the image after threshold processing and fill the contours. Each contour is composed of the pixels where it is located. Assume that an image has I contours in total, and the i-th contour is {(x 1 ,y 1 ),(x 2 ,y 2 ),……,(x n ,y n )}, where (x, y) is the coordinate of each pixel point, and n is the number of all pixels of the contour;
[0082] S6. Calculate the first-order moment m of each extracted contour 00 :
[0083]
[0084] Where I(x,y) is the pixel value of the pixel point (x,y), and all non-zero pixel values are recorded as 1 during calculation;
[0085] S7. Remove abnormal contours that do not meet the requirements;
[0086] S8. Divide the large holes and small holes, and calculate the number of large holes and small holes.
[0087] S1 specifically includes:
[0088] S11. Collection preparation: The light source position and light intensity are fixed for each collection. There is a clear contrast between the background and the object to be collected, such as silver-white objects to be collected and black background, black objects to be collected and white background, etc. The background is kept clean without any extra objects. When collecting, the object to be collected is placed flat on the table, and the camera is parallel to the object to be collected.
[0089] S12. Collection process: When collecting, pay attention to collecting the complete surface of the object to be collected at one time. If there are circular hole information on multiple surfaces of the object to be collected, collect each surface and ensure that only one surface is collected each time.
[0090] S2 specifically includes:
[0091] The image is read as a grayscale image on the computer. If it is a color image, it is converted to a grayscale image before cropping;
[0092] S21. If the background is complex, such as more than one color, it is cropped, and an arbitrary shape cropping method is used during cropping, only the object to be collected is retained, and the redundant complex background is removed;
[0093] S22. If the background is single, that is, only one color and has a large contrast with the color of the object to be collected, such as black and white, then the background is retained without cropping.
[0094] S3 specifically includes:
[0095] S31. If the noise in the image is scattered like snowflakes or there are tiny circular holes with a diameter less than one tenth of the diameter of the smallest circular hole, salt and pepper denoising is performed, and the pixels of the selected kernel size are sorted by pixel value, and the middle value is selected as the pixel value of the center pixel. The kernel size is based on the maximum size that does not blur the smallest circular hole;
[0096] S32. If the image has no impurities except the single-color background and the circular hole, perform Gaussian filtering, select the kernel size, and calculate the pixel value of the intermediate value according to the two-dimensional Gaussian function. The kernel size is based on the maximum size that does not blur the smallest circular hole.
[0097] S4 specifically includes:
[0098] S41. If the background is single, that is, only one color, the adaptive threshold algorithm (1979, maximum inter-class variance method) is used to select the threshold by maximizing the inter-class variance.
[0099] S42. If the background is not single, the adaptive threshold algorithm is used for adjustment, and the adaptive threshold is floated up and down by 40 values. First, a rough threshold is selected from the center of the optimal threshold with a step length of 10, and then a fine selection is performed with a step length of 1 to select the optimal threshold from which the circular hole and the background are accurately separated;
[0100] S43: If the background is not single, the grayscale value of the image background boundary is consistent with the grayscale value of the circular hole using an adaptive threshold algorithm, a grayscale distribution map is drawn, and 3 to 4 points with the largest changes in the image trough are selected through the grayscale distribution map for threshold segmentation.
[0101] S7 specifically includes:
[0102] S71. Delete the first-order moment m 00 The contour is 0;
[0103] S72. Draw a contour rectangle. Assuming that each contour consists of n points, the longest distance of the i-th contour on the x-axis is the width w of the rectangle. i, the longest distance on the y-axis is the height h of the rectangle i :
[0104]
[0105] where x p 、x q is the horizontal coordinate of the n points that make up the contour, y p ,y q is the ordinate of the n points that make up the contour;
[0106] S73. Calculate the aspect ratio r of each contour i :
[0107]
[0108] S74. Aspect Ratio {r 1 ,r 2 ,……,r I}Draw a box plot to check the abnormal points;
[0109] S75. 1 ,r 2 ,……,r I} Sort from small to large and extract the upper quartile q of the sorted sequence 1 , which is the 25th percentile number in the sequence, q 1 The location is Extract the lower quartile q of the sorted sequence 2 , which is the 75% number in the sequence position, q 2 The location is The interquartile range iqr = q is calculated 2 -q 1 , the upper and lower limits of distinguishing abnormal points are:
[0110]
[0111] Where k is the selected threshold. The larger k is, the fewer points are classified as outliers, and the smaller k is, the more points are classified as outliers. The default setting of k for the box plot is 1.5 to remove extremely extreme abnormal contours and select a threshold of about 10.
[0112] S76: Remove abnormal contours outside the upper and lower limits.
[0113] S8 specifically includes:
[0114] S81. Recalculate the first-order moment after removing the abnormal contour and sort it to obtain the sorted first-order moment sequence {m 1 ,m 2 ,……,m L}, L is the number of all contours after removing abnormal contours, that is, the number of all holes.
[0115] S82. Calculate the first-order difference d j :
[0116] d j =m j -m j-1 ,j=1,2,……,L,
[0117] Among them, the supplement m 0 =m 1 ;
[0118] S83. Extract the differential sequence {d 1 ,d 2 ,……,d L}The subscript index of the maximum value in .
[0119] index=argmax({d 1 ,d 2 ,……,d L})
[0120] S84. The number of small holes is index-1, and the number of large holes is L-index+1.
[0121] Example 3
[0122] Based on Example 1 and Example 2, a method for counting and classifying circular holes in an image comprises the following steps:
[0123] S1: Use image acquisition equipment such as cameras to acquire images.
[0124] S11: Collection preparation. Place the parts on a dark tabletop without any extra items on the tabletop. The collection camera uses a 9-megapixel camera. When shooting, the camera is parallel to the surface of the collected parts. The lighting is the top light of the room. The light is evenly distributed on the parts without any reflection.
[0125] S12: Collection process: The complete surface of the part to be collected is collected at one time.
[0126] S2: Crop the acquired image. Read the image in grayscale and crop the effective part surface in a rectangular shape.
[0127] S3: Perform denoising based on the features of the collected image. Select salt and pepper denoising and set the kernel size to 11.
[0128] S4: Threshold processing based on the collected image features.
[0129] S41: Adopting the adaptive threshold algorithm, the threshold is 89.
[0130] S42: The adaptive threshold (89) is floated up and down by 40 values. First, a rough selection step of 10 is performed from the center of the optimal threshold to select a rough threshold (69), and then a fine selection step of 1 is performed to select the optimal threshold 70 to accurately separate the circular hole from the background. Figure 2 shown.
[0131] S5: Extract contours from the image after threshold processing and fill the contours. At this time, there are 108 contours.
[0132] S6: Calculate the first-order moment m of each extracted contour 00 :
[0133]
[0134] Where I(x,y) is the pixel value of the pixel point (x,y), and all non-zero pixel values are recorded as 1 during calculation.
[0135] S7: Remove abnormal contours that do not meet the requirements.
[0136] S71: Delete the first-order moment m 00 The contour is 0, and there are 107 contours left
[0137] S72: Draw a contour rectangle. The longest distance of the i-th contour on the x-axis is the width w of the rectangle. i , the longest distance on the y-axis is the height h of the rectangle i :
[0138]
[0139] where x p 、x q is the horizontal coordinate of the n points that make up the contour, y p ,y q is the ordinate of the n points that make up the contour.
[0140] S73: Calculate the aspect ratio r of each contour i :
[0141]
[0142] S74: Aspect Ratio {r 1 ,r 2 ,……,r I}Draw a box plot to check for abnormal points.
[0143] S75: 1 ,r 2 ,……,r I} Sort from small to large and extract the upper quartile q of the sorted sequence 1 , which is the 25th percentile number in the sequence, q 1 The location is Extract the lower quartile q of the sorted sequence 2 , which is the 75% number in the sequence position, q 2 The location is The interquartile range iqr = q is calculated 2 -q 1 , the upper and lower limits of distinguishing abnormal points are:
[0144]
[0145] Where k is set to 10. The specific calculation is upper = 1.43, lower = 0.55. Figure 3 shown. Figure 3 The horizontal axis is the aspect ratio sequence, labeled 1; the vertical axis is the specific value of the aspect ratio sequence.
[0146] S76: Remove the outlier point at the bottom of the box plot. At this time, 106 contours remain.
[0147] S8: Divide the large holes and small holes, and calculate the number of large holes and small holes.
[0148] S81: Recalculate the first-order moment after removing the abnormal contour and sort it. The sorted first-order moment sequence {m 1 ,m 2 ,……,m 106};
[0149] S82: Calculate the first-order difference d j :
[0150] d j =m j -m j-1 ,j=1,2,……,L,
[0151] Among them, the supplement m 0 =m 1 . Sequences such as Figure 4 shown. Figure 4 The horizontal axis is the subscript index, and the vertical axis is the difference value.
[0152] S83: Extract the difference sequence {d 1 ,d 2 ,……,d L}The subscript index of the maximum value in .
[0153] index=argmax({d 1 ,d 2,……,d L}),
[0154] The specific calculation index is 54.
[0155] S84: The final number of small holes is 53 and the number of large holes is 53.
[0156] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for counting and classifying circular holes in an image, characterized in that: The following steps are involved: S1. Using image acquisition equipment to acquire images; S2. Crop the collected image; S3. Perform denoising according to the features of the collected image; S4. threshold processing according to the collected image features; S5. Extract contours from the image after threshold processing and fill the contours. Each contour is composed of the pixels where it is located. There are I contours in an image. The i-th contour is {(x1,y1),(x2,y2),……,(x n ,y n )}, where (x, y) is the coordinate of each pixel point, and n is the number of all pixels of the contour; S6. Calculate the first-order moment m of each extracted contour 00 : Where I(x,y) is the pixel value of the pixel point (x,y), and all non-zero pixel values are recorded as 1 during calculation; S7. Remove abnormal contours that do not meet the requirements; S8. Divide the large holes and small holes, and calculate the number of large holes and small holes.
2. The method for counting and classifying circular holes in an image according to claim 1, characterized in that: The S1 specifically includes: S11. Collection preparation: The light source position and light intensity are fixed for each collection. There is a clear contrast between the background and the color of the object to be collected. The background is kept clean without any extra objects. When collecting, the object to be collected is placed flat on the table, and the camera is parallel to the object to be collected. S12. Collection process: During collection, the complete surface of the object to be collected is collected at one time. If there is circular hole information on multiple surfaces of the object to be collected, each surface is collected to ensure that only one surface is collected each time.
3. The method for counting and classifying circular holes in an image according to claim 1, characterized in that: In S2, the image is read on the computer in grayscale. If it is a color image, it is converted into a grayscale image before cropping.
4. The method for counting and classifying circular holes in an image according to claim 3, characterized in that: The S2 specifically includes: S21. If there is more than one background, cropping is performed, and an arbitrary shape cropping method is used during cropping, only the object to be collected is retained, and redundant complex backgrounds are removed; S22. If the background has only one color and has a large contrast with the color of the object to be collected, the background is retained without cropping.
5. The method for counting and classifying circular holes in an image according to claim 1, characterized in that: The S3 specifically includes: S31. If the noise in the image is scattered or there are tiny circular holes with a diameter less than one tenth of the diameter of the smallest circular hole, salt and pepper denoising is performed, and the pixels of the selected kernel size are sorted by pixel value, and the middle value is selected as the pixel value of the center pixel. The kernel size is based on the maximum size that does not blur the smallest circular hole; S32. If the image has no impurities except the single-color background and the circular hole, perform Gaussian filtering, select the kernel size, and calculate the pixel value of the intermediate value according to the two-dimensional Gaussian function. The kernel size is based on the maximum size that does not blur the smallest circular hole.
6. The method for counting and classifying circular holes in an image according to claim 1, characterized in that: The S4 specifically includes: S41. If the background is single, an adaptive threshold algorithm is used to select the threshold by maximizing the inter-class variance; S42. If the background is not single, the adaptive threshold algorithm is used for adjustment, and the adaptive threshold is floated up and down by 40 values. First, a rough threshold is selected from the center of the optimal threshold with a step length of 10, and then a fine selection is performed with a step length of 1 to select the optimal threshold from which the circular hole and the background are accurately separated; S43: If the background is not single, the grayscale value of the image background boundary is consistent with the grayscale value of the circular hole using an adaptive threshold algorithm, a grayscale distribution map is drawn, and 3 to 4 points with the largest changes in the image trough are selected through the grayscale distribution map for threshold segmentation.
7. The method for counting and classifying circular holes in an image according to claim 1, characterized in that: The S7 specifically includes: S71. Delete the first-order moment m 00 The contour is 0; S72. Draw a contour rectangle. Each contour consists of n points. The longest distance of the i-th contour on the x-axis is the width w of the rectangle. i , the longest distance on the y-axis is the height h of the rectangle i : where x p 、x q is the horizontal coordinate of the n points that make up the contour, y p ,y q is the ordinate of the n points that make up the contour; S73. Calculate the aspect ratio r of each contour i : S74. For aspect ratio {r1, r2, ..., r I }Draw a box plot to check the abnormal points; S75. Set {r1, r2, ..., r I } Sort from small to large, extract the upper quartile q1 of the sorted sequence, that is, the number at the 25% position of the sequence, and the position of q1 is Extract the lower quartile q2 of the sorted sequence, which is the 75% number of the sequence position. The position of q2 is The interquartile range iqr = q2-q1 is calculated, and the upper and lower limits of the abnormal points are: Where k is the selected threshold; S76: Remove abnormal contours outside the upper and lower limits.
8. The method for counting and classifying circular holes in an image according to claim 8, characterized in that: The S8 specifically includes: S81. Recalculate the first-order moment after removing the abnormal contour and sort it to obtain the sorted first-order moment sequence {m1,m2,……,m L }, L is the number of all contours after removing abnormal contours; S82. Calculate the first-order difference d j : d j =m j -m j-1 ,j=1,2,……,L, Among them, m0=m1; S83. Extract the differential sequence {d1, d2, ..., d L }The subscript index of the maximum value in; index=argmax({d1,d2,……,d L }) S84. The number of small holes is index-1, and the number of large holes is L-index+1.
Citation Information
Patent Citations
Hatching egg hatching survival property online detecting method based on least square method ellipse fitting
CN110402849A
Target colony growth characteristic identification method
CN111178173A
Material enhancement feature recognizing and picking method of color selector
CN112122175A
Part hole site intelligent identification and positioning method
CN113554695A
Multi-colony body counting method based on image segmentation algorithm
CN113902713A
