Microoperation target segmentation method based on improved Otsu and edge operator
Through improved bilateral filtering and Otsu algorithm, the problem of low accuracy of the micro-operation target segmentation algorithm under the influence of uneven light and noise under micro-vision is solved, and higher precision target segmentation and micro-operation recognition are achieved.
Patent Information
- Application Number
- CN202411880742.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-19
AI Technical Summary
The existing micro-operation target segmentation algorithm under microscopic vision is low in accuracy and difficult to meet the high-precision requirements of micro-operation when affected by factors such as shadows and image noise caused by uneven light.
Using an improved bilateral filtering algorithm and an improved Otsu algorithm, the accuracy of target segmentation is improved through improved gray-scale domain weighting coefficients and inter-class variance function.
It significantly improves the denoising effect of the image and the retention of edge information, obtains more accurate prospect targets and contour ranges, and improves the recognition and positioning accuracy of micro-operation targets.
Smart Images

Figure CN119693404A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of micro-operation target segmentation under microscopic vision, and particularly relates to a micro-operation target segmentation method based on improved Otsu and edge operators. Background Art
[0002] As micro-operation tasks become more complex, the requirements for micro-operation precision and accuracy are getting higher and higher. Simple manual operation can no longer meet the needs of the operation process. With the development of target detection and positioning technology based on image processing and microscopic vision control theory, the level of automation of micro-operation has been greatly improved. In the picking and releasing of micro-operation, the identification and positioning of the end of the probe and the object of operation are the prerequisites for realizing micro-operation contact picking and releasing. However, the shadows and image noise caused by uneven illumination will have a significant impact on the target threshold segmentation under microscopic vision, which will further reduce the recognition and positioning accuracy of micro-operation targets.
[0003] At present, there are two main methods to solve this problem. The first method is to use traditional image processing technology to enhance the contrast between the foreground and the background by designing algorithms, and to remove the shadows caused by uneven illumination by filtering technology to correct or mitigate the impact of uneven illumination. The second method is to use deep learning technology, combined with current powerful hardware resources and large-scale data sets, to learn the distribution of illumination in the image to identify and correct shadows. The deep learning method is highly targeted, simple to implement and stable, but its recognition accuracy depends on the scale and quality of the data set. Compared with traditional methods, deep learning methods may be better in recognition accuracy, but they require a large amount of data support. Although traditional image processing methods have a wide range of applications, they require a certain amount of computing time.
[0004] Although domestic and foreign scholars have conducted a lot of research on the segmentation of micro-operation targets, the existing micro-operation target segmentation algorithm under microscopic vision still has the problem of low image processing technology accuracy when affected by factors such as shadows and image noise caused by uneven illumination. Therefore, studying a high-precision and high-robust microscopic vision target segmentation algorithm is of great significance to realize the automation of micro-operation. Summary of the invention
[0005] The purpose of the present invention is to solve the problem of low accuracy of existing micro-operation target segmentation methods due to the influence of shadows caused by image noise and uneven illumination, and to propose a micro-operation target segmentation method based on improved Otsu and edge operators.
[0006] The technical solution adopted by the present invention to solve the above technical problems is: a micro-operation target segmentation method based on improved Otsu and edge operator, the method specifically comprises the following steps:
[0007] Step 1: grayscale the original image containing the micro-operation target to obtain a grayscale image, and then use an improved bilateral filtering algorithm to denoise the grayscale image to obtain a denoised image;
[0008] The improved bilateral filtering algorithm specifically improves the grayscale domain weighting coefficient, and the improved grayscale domain weighting coefficient is specifically:
[0009]
[0010] Among them, ω s (x,y) is the grayscale domain weighting coefficient of the pixel (x,y), k s is the weight value, f(x 0 ,y 0 ) is the pixel point (x) in the grayscale image 0 ,y 0 ), f(x,y) is the gray value of the pixel (x,y) in the gray image, |·| means calculating the absolute value, (x,y)∈M(x 0 ,y 0 ), M(x 0 ,y 0 ) is a grayscale image with pixels (x 0 ,y 0 ) is the pixel set in the convolution kernel centered at σ s is the grayscale domain standard deviation;
[0011] Step 2: Based on the improved Otsu algorithm, the denoised image is subjected to micro-operation target segmentation to obtain the micro-operation target segmentation result;
[0012] If the number of targets segmented in the micro-operation target segmentation result is consistent with the actual number of micro-operation targets in the original image, the obtained micro-operation target segmentation result is directly used as the final micro-operation target segmentation result;
[0013] If the number of targets segmented in the micro-operation target segmentation result is inconsistent with the actual number of micro-operation targets in the original image, then step three is performed on the denoised image;
[0014] Step 3: Based on the improved edge operator and the improved Otsu algorithm, the denoised image is subjected to micro-operation target segmentation to obtain the final micro-operation target segmentation result.
[0015] The beneficial effects of the present invention are:
[0016] 1. The improved bilateral filtering of the present invention has a more obvious effect on noise removal, making the image pixel value smoother, and because the convolution kernel weight at the edge position is reduced, the edge information after filtering is retained more completely. The filtering and edge protection effects of the improved bilateral filtering algorithm are improved compared to the unimproved bilateral filtering algorithm.
[0017] 2. The threshold obtained by the improved Otsu threshold segmentation algorithm is relatively stable and is basically not affected by the ratio of foreground and background pixels. It can accurately segment the foreground and background to ensure the accuracy of segmentation.
[0018] 3. The method of the present invention removes the shadows around the image, obtains a more accurate foreground target and contour range, is more conducive to improving the subsequent micro-operation target recognition and positioning accuracy, and has strong adaptability to changes in the external environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flow chart of a micro-operation target segmentation method based on improved Otsu and edge operator of the present invention;
[0020] Figure 2 This is a flowchart for target segmentation of denoised images based on the improved edge operator and the improved Otsu algorithm. DETAILED DESCRIPTION
[0021] Specific implementation method 1: Combination Figure 1 The present embodiment describes a micro-operation target segmentation method based on an improved Otsu and edge operator, and the method specifically comprises the following steps:
[0022] Step 1: grayscale the original image containing the micro-operation target to obtain a grayscale image, and then use an improved bilateral filtering algorithm to denoise the grayscale image to obtain a denoised image;
[0023] The improved bilateral filtering algorithm specifically improves the grayscale domain weighting coefficients by converting the original ω s The grayscale difference parameter f(x,y)-f(x 0 ,y 0 ) is changed to grayscale difference exponent parameter exp(|f(x,y)-f(x 0 ,y 0 )|) to enhance the grayscale difference. The improved grayscale domain weighting coefficient is as follows:
[0024]
[0025] Among them, ω s (x,y) is the grayscale domain weighting coefficient of the pixel (x,y), ks is the weight value, f(x 0 ,y 0 ) is the pixel point (x) in the grayscale image 0 ,y 0 ), f(x,y) is the gray value of the pixel (x,y) in the gray image, |·| means calculating the absolute value, (x,y)∈M(x 0 ,y 0 ), M(x 0 ,y 0 ) is a grayscale image with pixels (x 0 ,y 0 ) is the pixel point set in the convolution kernel (the convolution kernel size used in the present invention is 3×3), σ s is the grayscale domain standard deviation (respectively set M(x 0 ,y 0 ) is subtracted from the grayscale value of the pixel (x, y), and the standard deviation of all the differences is calculated);
[0026] Step 2: Based on the improved Otsu algorithm, the denoised image is subjected to micro-operation target segmentation to obtain the micro-operation target segmentation result;
[0027] If the number of targets segmented in the micro-operation target segmentation result is consistent with the actual number of micro-operation targets in the original image, the obtained micro-operation target segmentation result is directly used as the final micro-operation target segmentation result;
[0028] If the number of targets segmented in the micro-operation target segmentation result is inconsistent with the actual number of micro-operation targets in the original image, then step three is performed on the denoised image;
[0029] Step 3: Based on the improved edge operator and the improved Otsu algorithm, the denoised image is subjected to micro-operation target segmentation to obtain the final micro-operation target segmentation result.
[0030] Due to the influence of uneven illumination, dark shadows are formed at the edge of the image, and the pixel values of the dark shadows at the foreground and edge of the image are similar, so the foreground and the dark shadows are easily confused during segmentation. This phenomenon is particularly obvious when the operating tool occupies a small proportion in the image. Therefore, in order to solve this problem, the present invention adopts the method of step three to eliminate the influence of these dark shadows on the recognition of the operating target.
[0031] Specific implementation method 2: This implementation method is different from the specific implementation method 1 in that the specific process of using the improved bilateral filtering algorithm to denoise the grayscale image is as follows:
[0032]
[0033] Among them, f Bilateral (x 0 ,y 0 ) is the pixel point (x 0 ,y 0 ), ω(x,y) is the gray value of the pixel (x,y) in the original image;
[0034] ω(x,y)=ω d (x,y)·ω s (x,y)
[0035] Among them, ω d (x,y) is the spatial distance domain weighting coefficient of the pixel point (x,y).
[0036] The other steps and parameters are the same as those in the first embodiment.
[0037] ω d (x, y) is a Gaussian filter, which is mainly used to filter blurred pixels; and ω s (x, y) uses the grayscale difference as the Gaussian parameter to calculate the weight, and the larger the grayscale difference, the smaller the weight. After multiplying the two parts, when encountering edge information in the image, the corresponding weight ratio can be reduced to protect the edge. The present invention uses an improved bilateral filtering algorithm to denoise the image, which can make the image pixel value smoother while improving the denoising effect, and because the convolution kernel weight at the edge position is reduced, the edge information after filtering is retained more completely, which solves the problem that the edge of the traditional bilateral filtering algorithm is blurred and cannot meet the accuracy requirements of micro-operation target recognition and positioning.
[0038] Specific implementation method three: This implementation method is different from specific implementation method one or two in that the spatial distance domain weighting coefficient ω of the pixel point (x, y) d (x,y) is:
[0039]
[0040] Among them, σ d is the spatial domain standard deviation.
[0041] The other steps and parameters are the same as those in the first or second embodiment.
[0042] For the set M(x 0 ,y 0 ) is calculated for each pixel in Then calculate the corresponding The calculated standard deviation is used as the spatial domain standard deviation.
[0043] Specific implementation method 4: This implementation method is different from any one of the specific implementation methods 1 to 3 in that the weight value k s The calculation method is:
[0044] Establish the Robert operator ▽f in the x direction x and the Robert operator ▽f in the y direction y They are:
[0045]
[0046] Use ▽f x and ▽f y Construct the gradient image of the original image, calculate the average gray value k of all pixels in the gradient image, and then use k to calculate the weight value k s :
[0047] k s =log k [f(x,y)-f(x 0 ,y 0 )|+1]
[0048] The other steps and parameters are the same as those in Specific Embodiments 1 to 3.
[0049] The weight value k s Substituting the improved gray domain weighting coefficient, we get:
[0050]
[0051] The present invention adds a weight value k to the modified grayscale difference index. s When the grayscale difference is low, the grayscale domain weighting coefficient can be appropriately increased to protect the filtering effect of low grayscale difference.
[0052] Specific implementation method 5: This implementation method is different from the specific implementation methods 1 to 4 in that the improved Otsu algorithm is used to segment the denoised image into micro-operation targets, specifically:
[0053] Step 21: Count the total number of pixels N and the average gray value μ of all pixels in the denoised image:
[0054]
[0055] Among them, n i Represents the number of pixels with gray value i in the denoised image;
[0056] Calculate the proportion of pixels corresponding to each gray value to the total number of pixels N:
[0057]
[0058] Among them, p i Indicates the proportion of pixels with gray value i to the total number of pixels;
[0059] Step 2: According to p i Establish the between-class variance function σ:
[0060] σ=ln(ω 0 ω 1 +1)·exp(μ 0 -μ 1 |)·|μ 0 -μ 1 |
[0061] Among them, μ 0 is the expected gray value of the foreground, μ 1 is the expected gray value of the background, ω 0 is the sum of the gray value probabilities of the background, ω 1 is the sum of the gray value probabilities of the foreground;
[0062]
[0063] Where T is the segmentation threshold;
[0064] Step 2: Find the segmentation threshold that maximizes the inter-class variance function value, segment the pixels whose grayscale values are greater than or equal to the segmentation threshold as foreground, and segment the pixels whose grayscale values are less than the segmentation threshold as background.
[0065] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.
[0066] When the data volume difference between the foreground and the background in the image is large, the threshold value obtained by the traditional Otsu algorithm using the maximum inter-class variance method is always biased towards the background, so that part of the background will be mistaken for the foreground, resulting in low accuracy of threshold segmentation. In order to improve the accuracy of Otsu algorithm segmentation, the present invention improves the inter-class variance function, that is, the weight of the data ratio product part in the inter-class variance formula is weakened by using the natural constant logarithm formula, and the weight of the average grayscale difference part is enhanced by using the natural constant exponential formula, so that the threshold obtained by the improved Otsu threshold segmentation algorithm is relatively stable, basically not affected by the ratio of foreground and background pixels, and the foreground and background can be accurately segmented.
[0067] Specific implementation method six: Combination Figure 2 This embodiment is different from the first to fifth embodiments in that the specific process of step three is as follows:
[0068] Step 3: Establish the first edge detection operator and the second edge detection operator respectively, and convolve the first edge detection operator with the denoised image to obtain the edge gradient image I 1 , convolve the second edge detection operator with the denoised image to obtain the edge gradient image I 2 ;
[0069] The edge gradient image I 1 With edge gradient image I 2 Add the gray values of the corresponding pixels in to obtain the edge gradient image I;
[0070] Step 32: Use the improved Otsu algorithm to perform threshold segmentation on the edge gradient image I (remove the noise generated in the gradient edge detection process), and use the morphological opening operation to expand the edge information in the threshold segmentation result to obtain a binary image after the edge information is diffused;
[0071] Step 3: Perform a bitwise AND operation on the binary image after edge information expansion and the image after denoising, specifically:
[0072] For any pixel in the denoised image, if the pixel corresponding to the pixel in the binary image after edge information expansion is the foreground, the gray value of the pixel is kept unchanged in the denoised image; if the pixel corresponding to the pixel in the binary image after edge information expansion is the background, the gray value of the pixel is set to 0 in the denoised image; each pixel in the denoised image is processed separately to obtain image A;
[0073] Diffuse the black grayscale value at the edge of the foreground object in image A to the inside to obtain the area where the foreground object is located;
[0074] Step 3 and 4: remove the area where the foreground object is located from image A to obtain the residual image B, and then use the improved Otsu algorithm to perform threshold segmentation on the residual image B to obtain the binary image C corresponding to the residual image B; perform a bitwise OR operation on the binary image C and the denoised image (which can retain the foreground information in the image and remove the dark shadow part in the background);
[0075] The specific process of the bitwise OR operation is:
[0076] For any pixel in the binary image C, if the pixel is the background, the grayscale value of the corresponding pixel in the denoised image remains unchanged; if the pixel is the foreground, the grayscale value of the corresponding pixel in the denoised image is set to 255. After processing the pixels in the denoised image respectively, an adjusted denoised image D is obtained (since the foreground object area has been removed from the residual image B, some pixels in the denoised image have no corresponding pixels in the residual image C, so the grayscale values of these pixels in image D remain unchanged. Since these pixels will be removed in the next processing step, they will not affect the final result);
[0077] Use all the pixels corresponding to the binary image C in the image D to form the image E (i.e. the image without the shadow effect);
[0078] Step 35: Use the improved Otsu algorithm to segment image E to obtain the foreground area in image E. The foreground area in image E and the area where the foreground object is located obtained in step 33 are used as the segmented micro-operation target area.
[0079] The other steps and parameters are the same as those in Specific Implementation Methods 1 to 5.
[0080] The present invention can correct the shadows caused by uneven illumination based on the improved edge operator. After removing the shadows around the image, the improved Otsu algorithm is used to perform threshold segmentation on the image, so as to obtain more accurate foreground targets and contour ranges, which is of great significance for high-precision automatic recognition and positioning of micro-operation targets.
[0081] Specific implementation method 7: This implementation method is different from any one of the specific implementation methods 1 to 6 in that the first edge detection operator is The second edge detection operator is
[0082] The other steps and parameters are the same as those in Specific Embodiments 1 to 6.
[0083] As a second-order derivative edge detection operator, Laplacian is sensitive to details, has high edge detection accuracy, is not restricted by direction, and has a fast response speed, but is also sensitive to noise. The Sobel operator calculates the gradient amplitude between pixels in the form of a first-order derivative, and combines the Gaussian formula to design the operator weight, which can suppress the influence of noise in the image while highlighting the edge features. Therefore, in order to ensure the speed and accuracy of edge detection, the first edge detection operator and the second edge detection operator in the diagonal direction are designed by combining the Sobel and Laplacian operators.
[0084] Example
[0085] This embodiment proposes a micro-operation target segmentation method based on improved Otsu and edge operators, and the method specifically includes the following steps:
[0086] Step 1: grayscale the original image containing the micro-operation target to obtain a grayscale image; then use the improved bilateral filtering algorithm to denoise the grayscale image to obtain a denoised image; specifically:
[0087]
[0088] Among them, f Bilateral (x 0 ,y 0 ) is the pixel point (x 0 ,y 0 ), ω(x,y) is the gray value of the pixel (x,y) in the original image;
[0089] ω(x,y)=ω d (x,y)·ω s (x,y)
[0090] Among them, ω d (x,y) is the spatial distance domain weighting coefficient of the pixel point (x,y), ω s (x,y) is the grayscale domain weighting coefficient of the pixel (x,y);
[0091] Spatial distance domain weighting coefficient ω of pixel point (x, y) d (x,y) is:
[0092]
[0093] Among them, σ d is the spatial domain standard deviation.
[0094] The original ω s The grayscale difference parameter f(x,y)-f(x 0 ,y 0 ) is changed to grayscale difference exponent parameter exp(|f(x,y)-f(x 0 ,y 0 )|) to enhance the grayscale difference. The improved grayscale domain weighting coefficient is as follows:
[0095]
[0096] Among them, f(x 0 ,y 0 ) is the pixel point (x) in the grayscale image 0 ,y 0), f(x,y) is the gray value of the pixel (x,y) in the gray image, |·| means calculating the absolute value, (x,y)∈M(x 0 ,y 0 ), M(x 0 ,y 0 ) is a grayscale image with pixels (x 0 ,y 0 ) is the pixel point set in the convolution kernel (the convolution kernel size used in the present invention is 3×3), σ s is the grayscale domain standard deviation (respectively set M(x 0 ,y 0 ) is subtracted from the grayscale value of each pixel in (x, y), and then the standard deviation of all the differences is calculated. s is the weight value;
[0097] And the weight value k s The calculation method is:
[0098] Establish the Robert operator ▽f in the x direction x and the Robert operator ▽f in the y direction y They are:
[0099]
[0100] Use ▽f x and ▽f y Construct the gradient image of the original image, calculate the average gray value k of all pixels in the gradient image, and then use k to calculate the weight value k s :
[0101] k s =log k [f(x,y)-f(x 0 ,y 0 )|+1]
[0102] Step 2: Based on the improved Otsu algorithm, the denoised image is segmented into micro-operation targets to obtain the micro-operation target segmentation result; specifically:
[0103] Step 21: Count the total number of pixels N and the average gray value μ of all pixels in the denoised image:
[0104]
[0105] Among them, n i Represents the number of pixels with gray value i in the denoised image;
[0106] Calculate the proportion of pixels corresponding to each gray value to the total number of pixels N:
[0107]
[0108] Among them, p i Indicates the proportion of pixels with gray value i to the total number of pixels;
[0109] Step 2: According to p i Establish the between-class variance function σ:
[0110] σ=ln(ω 0 ω 1 +1)·exp(μ 0 -μ 1 |)·|μ 0 -μ 1 |
[0111] Among them, μ 0 is the expected gray value of the foreground, μ 1 is the expected gray value of the background, ω 0 is the sum of the gray value probabilities of the background, ω 1 is the sum of the gray value probabilities of the foreground;
[0112]
[0113] Where T is the segmentation threshold;
[0114] Step 2: Find the segmentation threshold that maximizes the inter-class variance function value, segment the pixels whose grayscale values are greater than or equal to the segmentation threshold as foreground, and segment the pixels whose grayscale values are less than the segmentation threshold as background.
[0115] If the number of targets segmented in the micro-operation target segmentation result is consistent with the actual number of micro-operation targets in the original image, the obtained micro-operation target segmentation result is directly used as the final micro-operation target segmentation result;
[0116] If the number of targets segmented in the micro-operation target segmentation result is inconsistent with the actual number of micro-operation targets in the original image, then step three is performed on the denoised image;
[0117] Step 3: Based on the improved edge operator and the improved Otsu algorithm, the denoised image is segmented into micro-operation targets to obtain the final micro-operation target segmentation result; specifically:
[0118] Step 3: 1. Establish the first edge detection operator and the second edge detection operator respectively:
[0119]
[0120] Convolve the first edge detection operator with the denoised image to obtain the edge gradient image I1 , convolve the second edge detection operator with the denoised image to obtain the edge gradient image I 2 ;
[0121] The edge gradient image I 1 With edge gradient image I 2 Add the gray values of the corresponding pixels in to obtain the edge gradient image I;
[0122] Step 32: Use the improved Otsu algorithm to perform threshold segmentation on the edge gradient image I (remove the noise generated in the gradient edge detection process), and use the morphological opening operation to expand the edge information in the threshold segmentation result to obtain a binary image after the edge information is diffused;
[0123] Step 3: Perform a bitwise AND operation on the binary image after edge information expansion and the image after denoising, specifically:
[0124] For any pixel in the denoised image, if the pixel corresponding to the pixel in the binary image after edge information expansion is the foreground, the gray value of the pixel is kept unchanged in the denoised image; if the pixel corresponding to the pixel in the binary image after edge information expansion is the background, the gray value of the pixel is set to 0 in the denoised image; each pixel in the denoised image is processed separately to obtain image A;
[0125] Diffuse the black grayscale value at the edge of the foreground object in image A to the inside to obtain the area where the foreground object is located;
[0126] Step 3 and 4: remove the area where the foreground object is located from image A to obtain the residual image B, and then use the improved Otsu algorithm to perform threshold segmentation on the residual image B to obtain the binary image C corresponding to the residual image B; perform a bitwise OR operation on the binary image C and the denoised image (which can retain the foreground information in the image and remove the dark shadow part in the background);
[0127] The specific process of the bitwise OR operation is:
[0128] For any pixel in the binary image C, if the pixel is the background, the grayscale value of the corresponding pixel in the denoised image remains unchanged; if the pixel is the foreground, the grayscale value of the corresponding pixel in the denoised image is set to 255. After processing the pixels in the denoised image respectively, an adjusted denoised image D is obtained (since the foreground object area has been removed from the residual image B, some pixels in the denoised image have no corresponding pixels in the residual image C, so the grayscale values of these pixels in image D remain unchanged. Since these pixels will be removed in the next processing step, they will not affect the final result);
[0129] Use all the pixels corresponding to the binary image C in the image D to form the image E (i.e. the image without the shadow effect);
[0130] Step 35: Use the improved Otsu algorithm to segment image E to obtain the foreground area in image E. The foreground area in image E and the area where the foreground object is located obtained in step 33 are used as the segmented micro-operation target area.
[0131] The above calculation examples of the present invention are only used to explain the calculation model and calculation process of the present invention in detail, and are not intended to limit the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.
Claims
1. A micro-operation target segmentation method based on improved Otsu and edge operator, characterized in that: The method specifically comprises the following steps: Step 1: grayscale the original image containing the micro-operation target to obtain a grayscale image, and then use an improved bilateral filtering algorithm to denoise the grayscale image to obtain a denoised image; The improved bilateral filtering algorithm specifically improves the grayscale domain weighting coefficient, and the improved grayscale domain weighting coefficient is specifically: Among them, ω s (x,y) is the grayscale domain weighting coefficient of the pixel (x,y), k s is the weight value, f(x0,y0) is the grayscale value of the pixel (x0,y0) in the grayscale image, f(x,y) is the grayscale value of the pixel (x,y) in the grayscale image, |·| represents the calculation of the absolute value, (x,y)∈M(x0,y0), M(x0,y0) is the set of pixels in the convolution kernel centered on the pixel (x0,y0) in the grayscale image, σ s is the grayscale domain standard deviation; Step 2: Based on the improved Otsu algorithm, the denoised image is subjected to micro-operation target segmentation to obtain the micro-operation target segmentation result; If the number of targets segmented in the micro-operation target segmentation result is consistent with the actual number of micro-operation targets in the original image, the obtained micro-operation target segmentation result is directly used as the final micro-operation target segmentation result; If the number of targets segmented in the micro-operation target segmentation result is inconsistent with the actual number of micro-operation targets in the original image, then step three is performed on the denoised image; Step 3: Based on the improved edge operator and the improved Otsu algorithm, the denoised image is subjected to micro-operation target segmentation to obtain the final micro-operation target segmentation result.
2. According to claim 1, a micro-operation target segmentation method based on improved Otsu and edge operator is characterized in that: The specific process of using the improved bilateral filtering algorithm to denoise the original image containing the micro-operation target is as follows: Among them, f Bilateral (x0, y0) is the grayscale value of the pixel (x0, y0) in the denoised image, and ω(x, y) is the bilateral filtering weight function of the pixel (x, y) in the original image; ω(x,y)=ω d (x,y)·ω s (x,y) Among them, ω d (x,y) is the spatial distance domain weighting coefficient of the pixel point (x,y).
3. The micro-operation target segmentation method based on improved Otsu and edge operator according to claim 2 is characterized in that: The spatial distance domain weighting coefficient ω of the pixel point (x, y) d (x,y) is: Among them, σ d is the spatial domain standard deviation.
4. The micro-operation target segmentation method based on improved Otsu and edge operator according to claim 3 is characterized in that: The weight value k s The calculation method is: Establish the Robert operator in the x direction and the Robert operator in the y direction They are: use and Construct the gradient image of the original image, calculate the average gray value k of all pixels in the gradient image, and then use k to calculate the weight value k s : k s =log k [f(x,y)-f(x0,y0) | +1]。 5. The micro-operation target segmentation method based on improved Otsu and edge operator according to claim 4 is characterized in that: The improved Otsu algorithm is used to segment the denoised image into micro-operation targets, specifically: Step 21: Count the total number of pixels N and the average gray value μ of all pixels in the denoised image: Among them, n i Represents the number of pixels with gray value i in the denoised image; Calculate the proportion of pixels corresponding to each gray value to the total number of pixels N: Among them, p i Indicates the proportion of pixels with gray value i to the total number of pixels; Step 2: According to p i Establish the between-class variance function σ: σ=ln(ω0ω1+1)·exp(μ0-μ1|)·|μ0-μ1| Among them, μ0 is the expected gray value of the foreground, μ1 is the expected gray value of the background, ω0 is the sum of the gray value probabilities of the background, and ω1 is the sum of the gray value probabilities of the foreground; Where T is the segmentation threshold; Step 2: Find the segmentation threshold that maximizes the inter-class variance function value, segment the pixels whose grayscale values are greater than or equal to the segmentation threshold as foreground, and segment the pixels whose grayscale values are less than the segmentation threshold as background.
6. The micro-operation target segmentation method based on improved Otsu and edge operator according to claim 5, characterized in that: The specific process of step three is: Step 31: Establish a first edge detection operator and a second edge detection operator respectively, convolve the first edge detection operator with the denoised image to obtain an edge gradient image I1, and convolve the second edge detection operator with the denoised image to obtain an edge gradient image I2; Add the grayscale values of corresponding pixels in the edge gradient image I1 and the edge gradient image I2 to obtain the edge gradient image I; Step 32: Use the improved Otsu algorithm to perform threshold segmentation on the edge gradient image I, and use the morphological opening operation to expand the edge information in the threshold segmentation result to obtain a binary image after the edge information is diffused; Step 3: Perform a bitwise AND operation on the binary image after edge information expansion and the image after denoising, specifically: For any pixel in the denoised image, if the pixel corresponding to the pixel in the binary image after edge information expansion is the foreground, the gray value of the pixel is kept unchanged in the denoised image; if the pixel corresponding to the pixel in the binary image after edge information expansion is the background, the gray value of the pixel is set to 0 in the denoised image; each pixel in the denoised image is processed separately to obtain image A; Diffuse the black grayscale value at the edge of the foreground object in image A to the inside to obtain the area where the foreground object is located; Step 34: Remove the area where the foreground object is located from image A to obtain the residual image B, and then use the improved Otsu algorithm to perform threshold segmentation on the residual image B to obtain the binary image C corresponding to the residual image B; perform a bitwise OR operation on the binary image C and the denoised image; The specific process of the bitwise OR operation is: For any pixel in the binary image C, if the pixel is the background, the grayscale value of the corresponding pixel in the denoised image remains unchanged; if the pixel is the foreground, the grayscale value of the corresponding pixel in the denoised image is set to 255. After processing the pixels in the denoised image respectively, an adjusted denoised image D is obtained; Use all the pixels corresponding to the binary image C in the image D to form the image E; Step 35: Use the improved Otsu algorithm to segment image E to obtain the foreground area in image E. The foreground area in image E and the area where the foreground object is located obtained in step 33 are used as the segmented micro-operation target area.
7. The micro-operation target segmentation method based on improved Otsu and edge operator according to claim 6 is characterized in that: The first edge detection operator is The second edge detection operator is
Citation Information
Patent Citations
Neural network-based method for identifying and classifying visible components in urine
CN101713776A
Method for suppressing noise by image smoothing
CN102005033A
Character segmentation method and device and electronic equipment
CN106446896A
Edge extraction method applied to photoelectric tracking system
CN110853065A
SAR image and visible light image matching method based on improved feature extraction and game theory hypergraphs
CN111783548A