A micro-operation target segmentation method based on improved Otsu and edge operator
By improving the method of combining Otsu and edge operators, and using the improved bilateral filtering and Otsu threshold segmentation algorithm, the problem of micro-operation target segmentation accuracy under the influence of uneven illumination and noise in microscopic vision is solved, and high-precision and high-robustness target segmentation is achieved.
Patent Information
- Application Number
- CN202411880742.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-12-19
AI Technical Summary
The existing micro-manipulation target segmentation algorithm under microscopic vision has low segmentation accuracy under the influence of uneven lighting and image noise, and it is difficult to meet the requirements of high precision and high robustness.
The improved Otsu and edge operator are combined to remove noise through the improved bilateral filtering algorithm. The improved Otsu threshold segmentation and edge detection operator are combined to eliminate the shadow effect and improve the segmentation accuracy.
The improved method significantly improves the image segmentation accuracy, ensures accurate segmentation of foreground and background, enhances the recognition and positioning accuracy of micro-manipulation targets, has strong adaptability, and reduces the impact of external environmental changes.
Smart Images

Figure CN119693404B_ABST
Abstract
Description
Technical Field
[0001] The present 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 micromanipulation tasks become increasingly complex, the requirements for micromanipulation precision and accuracy are becoming increasingly stringent. Simple manual operation can no longer meet the demands of the operation process. The development of image processing-based target detection and positioning technology and microscopic vision control theory has greatly improved the level of automation in micromanipulation. During micromanipulation pick-up and release, the identification and positioning of the probe tip and the manipulated object are prerequisites for achieving contact pick-up and release. However, uneven lighting, such as shadows and image noise, can significantly affect target threshold segmentation under microscopic vision, further reducing the recognition and positioning accuracy of micromanipulation targets.
[0003] Currently, there are two main approaches to addressing this problem. The first involves using traditional image processing techniques to correct or mitigate the effects of uneven illumination by designing algorithms to enhance the contrast between foreground and background and using filtering techniques to remove shadows caused by uneven illumination. The second approach is to utilize deep learning techniques, combined with current powerful hardware resources and large-scale datasets, to learn the illumination distribution in images to identify and correct shadows. Deep learning methods are highly targeted, simple to implement, and stable, but their recognition accuracy depends on the size and quality of the dataset. Compared to traditional methods, deep learning methods may have better recognition accuracy, but they require a large amount of data support. Traditional image processing methods, while widely applicable, require a certain amount of computing time.
[0004] Although scholars at home and abroad have conducted extensive research on the segmentation of micro-manipulation targets, existing micro-vision target segmentation algorithms still suffer from low image processing accuracy when affected by factors such as shadows caused by uneven illumination and image noise. Therefore, developing a high-precision and robust micro-vision target segmentation algorithm is of great significance for achieving automated micro-manipulation. 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 comprising the following steps:
[0007] Step 1: grayscale the original image containing the micro-operation target to obtain a grayscale image, and then use the 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. 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(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;
[0011] Step 2: Perform micro-operation target segmentation on the denoised image based on the improved Otsu algorithm 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 algorithm of this invention has a more pronounced noise removal effect, resulting in smoother image pixel values. Furthermore, by reducing the convolution kernel weight at edge locations, the edge information after filtering is more completely preserved. The improved bilateral filtering algorithm achieves improved filtering and edge protection compared to the unimproved bilateral filtering algorithm.
[0017] 2. The threshold value 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 This embodiment describes a micro-operation target segmentation method based on an improved Otsu and edge operator, and the method specifically includes the following steps:
[0022] Step 1: grayscale the original image containing the micro-operation target to obtain a grayscale image, and then use the 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 coefficient, and converts the original ω s The grayscale difference parameter f(x,y)-f(x0,y0) in (x,y) is changed to the grayscale difference exponent parameter exp(|f(x,y)-f(x0,y0)|) to enhance the grayscale difference. The improved grayscale domain weighting coefficient is specifically:
[0024]
[0025] 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 (the convolution kernel size used in this invention is 3×3), σ s is the standard deviation of the grayscale domain (the grayscale value of each pixel in the set M(x0,y0) is subtracted from the grayscale value of the pixel (x,y), and the standard deviation of all the differences is calculated);
[0026] Step 2: Perform micro-operation target segmentation on the denoised image based on the improved Otsu algorithm 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] Uneven lighting can cause dark shadows to form at the edges of an image. Since the pixel values of the foreground and the dark shadows at the edges are similar, segmentation can easily confuse the foreground and the dark shadows. This phenomenon is particularly pronounced when the operating tool occupies a relatively small portion of the image. To address this issue, the present invention employs the method of step three to eliminate the impact of these dark shadows on target recognition.
[0031] Specific embodiment 2: This embodiment differs from specific embodiment 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 (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;
[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] 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, solving 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 embodiment three: This embodiment differs from specific embodiment 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] Other steps and parameters are the same as those in the first or second embodiment.
[0042] For each pixel in the set M(x0,y0), calculate Then calculate the corresponding The calculated standard deviation is used as the spatial domain standard deviation.
[0043] Specific embodiment 4: This embodiment differs from any one of specific embodiments 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(x0,y0)|+1]
[0048] The other steps and parameters are the same as those in the first to third embodiments.
[0049] The weight value k s Substituting the improved grayscale 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 embodiment 5: This embodiment differs from any one of specific embodiments 1 to 4 in that the improved Otsu algorithm is used to segment the denoised image into micro-operation targets, specifically:
[0053] Step 2.1: Count the total number of pixels N and the average grayscale 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, and ω1 is the sum of the gray value probabilities of the foreground;
[0062]
[0063] Where T is the segmentation threshold;
[0064] Step 2 and 3: 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 the first to fourth embodiments.
[0066] When the data volume difference between the foreground and background in an 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, thereby mistaking part of the background for the foreground, resulting in low threshold segmentation accuracy. To improve the accuracy of Otsu algorithm segmentation, the present invention improves the inter-class variance function. Specifically, the weight of the data ratio product part in the inter-class variance formula is slightly weakened using the natural constant logarithm formula, while the weight of the mean grayscale difference part is strengthened using the natural constant exponential formula. This makes the threshold value obtained by the improved Otsu threshold segmentation algorithm relatively stable and basically unaffected by the ratio of foreground to background pixels, so that the foreground and background can be accurately separated.
[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 3 is as follows:
[0068] 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;
[0069] 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;
[0070] Step 32: Use the improved Otsu algorithm to perform threshold segmentation on the edge gradient image I (to remove the noise generated during 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 corresponding pixel in the binary image after edge information expansion is the foreground, then the grayscale value of the pixel is kept unchanged in the denoised image; if the corresponding pixel in the binary image after edge information expansion is the background, then the grayscale value of the pixel is set to 0 in the denoised image. After processing each pixel in the denoised image separately, image A is obtained;
[0073] Diffuse the black grayscale value at the edge of the foreground object in image A to the interior to obtain the area where the foreground object is located;
[0074] Steps 3 and 4: Remove the foreground object from image A to obtain a residual image B. Then, perform threshold segmentation on the residual image B using the improved Otsu algorithm to obtain a binary image C corresponding to the residual image B. Perform a bitwise OR operation on the binary image C and the denoised image (this can retain the foreground information in the image and remove the dark shadows 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 background, the grayscale value of the corresponding pixel in the denoised image remains unchanged; if the pixel is foreground, the grayscale value of the corresponding pixel in the denoised image is set to 255. After processing the pixels in the denoised image separately, the adjusted denoised image D is obtained (since the area where the foreground object is located has been removed from the residual image B, some pixels in the denoised image have no corresponding pixels in the residual image C. Therefore, 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 the first to fifth embodiments.
[0080] The improved edge operator based on the present invention can correct the shadows caused by uneven illumination. After removing the shadows around the image, the improved Otsu algorithm is used to perform threshold segmentation on the image, which can obtain more accurate foreground targets and contour ranges, and is of great significance for high-precision automatic recognition and positioning of micro-operation targets.
[0081] Specific embodiment seven: This embodiment differs from any one of specific embodiments one to six 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 the first to sixth embodiments.
[0083] The Laplacian, a second-order derivative edge detection operator, is sensitive to detail, offers high edge detection accuracy, is not restricted by direction, and has a fast response speed. However, it is also sensitive to noise. The Sobel operator, on the other hand, calculates the gradient magnitude between pixels as a first-order derivative and combines it with the Gaussian formula to design operator weights. This allows it to highlight edge features while suppressing the effects of image noise. Therefore, to ensure both speed and accuracy in edge detection, a first and second diagonal edge detection operator were designed, combining the Sobel and Laplacian operators.
[0084] Example
[0085] This embodiment proposes a micro-operation target segmentation method based on an improved Otsu and edge operator, 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 (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;
[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(x0,y0) in (x,y) is changed to the grayscale difference exponent parameter exp(|f(x,y)-f(x0,y0)|) to enhance the grayscale difference. The improved grayscale domain weighting coefficient is specifically:
[0095]
[0096] Where 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 (the convolution kernel size used in this invention is 3×3), σ s is the standard deviation of the grayscale domain (the grayscale value of each pixel in the set M(x0,y0) is subtracted from the grayscale value of the pixel (x,y), and the standard deviation of all the differences is calculated), k 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(x0,y0)|+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 results; specifically:
[0103] Step 2.1: Count the total number of pixels N and the average grayscale 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, and ω1 is the sum of the gray value probabilities of the foreground;
[0112]
[0113] Where T is the segmentation threshold;
[0114] Step 2 and 3: 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. Create 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 an edge gradient image I1, and convolve the second edge detection operator with the denoised image to obtain an edge gradient image I2;
[0121] 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;
[0122] Step 32: Use the improved Otsu algorithm to perform threshold segmentation on the edge gradient image I (to remove the noise generated during 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 corresponding pixel in the binary image after edge information expansion is the foreground, then the grayscale value of the pixel is kept unchanged in the denoised image; if the corresponding pixel in the binary image after edge information expansion is the background, then the grayscale value of the pixel is set to 0 in the denoised image. After processing each pixel in the denoised image separately, image A is obtained;
[0125] Diffuse the black grayscale value at the edge of the foreground object in image A to the interior to obtain the area where the foreground object is located;
[0126] Steps 3 and 4: Remove the foreground object from image A to obtain a residual image B. Then, perform threshold segmentation on the residual image B using the improved Otsu algorithm to obtain a binary image C corresponding to the residual image B. Perform a bitwise OR operation on the binary image C and the denoised image (this can retain the foreground information in the image and remove the dark shadows 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 background, the grayscale value of the corresponding pixel in the denoised image remains unchanged; if the pixel is foreground, the grayscale value of the corresponding pixel in the denoised image is set to 255. After processing the pixels in the denoised image separately, the adjusted denoised image D is obtained (since the area where the foreground object is located has been removed from the residual image B, some pixels in the denoised image have no corresponding pixels in the residual image C. Therefore, 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 examples are merely illustrative of the calculation model and process of the present invention and are not intended to limit the embodiments of the present invention. Persons skilled in the art will readily appreciate that other variations or modifications based on the above description are possible. This list of embodiments is not exhaustive; however, any obvious variations or modifications derived from the technical solution of the present invention remain 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 the 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. The improved grayscale domain weighting coefficient is specifically: in, It's a pixel Gray domain weighting coefficient, is the weight value, is a pixel in the grayscale image The gray value of is a pixel in the grayscale image The gray value of Indicates the calculation of absolute value, , In grayscale images, the pixels The pixel set in the convolution kernel centered at is the grayscale domain standard deviation; The specific process of denoising the original image containing micro-operation targets using the improved bilateral filtering algorithm is as follows: in, is the pixel in the image after denoising The gray value of is the pixel in the original image Bilateral filtering weight function; in, It's a pixel The spatial distance domain weighting coefficient; in, is the spatial domain standard deviation; Weight value The calculation method is: Establish Directional Robert operator as well as Directional Robert operator They are: use and Construct the gradient image of the original image and then calculate the average grayscale value of all pixels in the gradient image , reuse Calculate weight value : Step 2: Perform micro-operation target segmentation on the denoised image based on the improved Otsu algorithm 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. The micro-operation target segmentation method based on improved Otsu and edge operator according to claim 1 is characterized in that: The improved Otsu algorithm is used to perform micro-operation target segmentation on the denoised image, specifically: Step 2.1: Count the total number of pixels in the denoised image The average gray value of all pixels : in, Indicates that the grayscale value of the image after denoising is The number of pixels; Calculate the percentage of pixels corresponding to each gray value in the total number of pixels Ratio: in, Indicates the gray value is The ratio of pixels to the total number of pixels; Step 2: According to Establishing between-class variance function : in, is the expected gray value of the foreground, is the expected gray value of the background, is the sum of the gray value probabilities of the background, is the sum of the gray value probabilities of the foreground; in, is the segmentation threshold; Step 2 and 3: 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.
3. The micro-operation target segmentation method based on improved Otsu and edge operator according to claim 2 is characterized in that: The specific process of step three is: Step 3. Build 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. , convolve the second edge detection operator with the denoised image to obtain the edge gradient image ; The edge gradient image Image with edge gradient Add the grayscale values of the corresponding pixels in to get the edge gradient image ; Step 3.2: Use the improved Otsu algorithm to analyze the edge gradient image Perform threshold segmentation processing and use morphological opening operation to expand the edge information in the threshold segmentation result to obtain a binary image after edge information diffusion; 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 corresponding pixel in the binary image after edge information expansion is the foreground, then the grayscale value of the pixel is kept unchanged in the denoised image; if the corresponding pixel in the binary image after edge information expansion is the background, then the grayscale value of the pixel is set to 0 in the denoised image. After processing each pixel in the denoised image separately, image A is obtained; Diffuse the black grayscale value at the edge of the foreground object in image A to the interior to obtain the area where the foreground object is located; Step 3 and 4: Remove the foreground object area from image A to obtain the residual image B, 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 background, the grayscale value of the corresponding pixel in the denoised image remains unchanged; if the pixel is foreground, the grayscale value of the corresponding pixel in the denoised image is set to 255. After processing the pixels in the denoised image separately, the 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.
4. The micro-operation target segmentation method based on improved Otsu and edge operator according to claim 3 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