Image segmentation methods, apparatus, computer equipment, and readable storage media

By obtaining the chroma histogram of the chroma channel image and setting different saturation segmentation thresholds according to the characteristics of the image under the setting sun, the problem of unclear segmentation of the image under the setting sun is solved, and higher segmentation accuracy and lower false positive rate are achieved.

CN117095015BActive Publication Date: 2026-03-10SUZHOU CLEVA PRECISION MACHINERY & TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-12
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Images captured under the setting sun have a yellowish tint, and existing technologies using fixed segmentation thresholds result in unclear and inaccurate image segmentation, leading to misclassification of grassy and non-grassy areas.

Method used

By obtaining the chroma histogram of the chroma channel image, the target parameter value is determined, and different saturation segmentation threshold ranges are set according to preset conditions. A higher saturation segmentation threshold range is used for segmentation of the image under the setting sun.

Benefits of technology

It improves the clarity and accuracy of image segmentation and reduces the misclassification rate of grass areas and non-grass areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117095015B_ABST
    Figure CN117095015B_ABST
Patent Text Reader

Abstract

This application relates to the field of image processing technology, specifically disclosing an image segmentation method, apparatus, computer device, and readable storage medium. The method includes: obtaining a chroma histogram corresponding to the chroma channel image based on the original image; determining a target parameter value based on the chroma histogram; if the target parameter value meets a preset condition, determining a saturation segmentation threshold as a first threshold range, otherwise determining the saturation segmentation threshold as a second threshold range, wherein the minimum value of the first threshold range is greater than the minimum value of the second threshold range; and performing image segmentation by combining the first threshold range or the second threshold range. Instead of using a fixed saturation threshold range for segmentation, different saturation segmentation thresholds are used for different images to improve the clarity and accuracy of segmentation, especially in accurately segmenting grass areas and non-grass areas from images yellowed by the setting sun.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to an image segmentation method and device, computer equipment and a readable storage medium. BACKGROUND

[0002] Image segmentation technology is one of the key technologies in the field of image processing and computer vision recognition, which determines the quality of digital image analysis and the result of visual information processing.

[0003] Taking an intelligent mower as an example, it will collect image information of the ground in real time during the marching process, and then perform segmentation processing on the collected image to obtain the lawn area and the non-lawn area (such as cement ground), so as to clean the lawn area. However, when the oblique sun shines on the ground, the ground image collected under the oblique sun will be yellowish compared with the ground image under normal light. If a conventional image segmentation method is used, it may cause unclear and inaccurate segmentation effect, and further cause misjudgment of the lawn area and the non-lawn area.

[0004] Therefore, how to clearly and accurately segment the image collected under the oblique sun is one of the problems urgently to be solved in the field. SUMMARY

[0005] Therefore, it is necessary to provide an image segmentation method, image segmentation device, computer equipment and computer readable storage medium in view of the above problems.

[0006] According to a first aspect of an embodiment of the present application, an image segmentation method is provided, comprising:

[0007] Obtaining a chroma histogram corresponding to a chroma channel image based on an original image;

[0008] Determining a target parameter value based on the chroma histogram;

[0009] If the target parameter value meets a preset condition, determining that a saturation segmentation threshold is a first threshold range, otherwise determining that the saturation segmentation threshold is a second threshold range, the minimum value of the first threshold range is greater than the minimum value of the second threshold range;

[0010] Performing image segmentation in combination with the first threshold range or the second threshold range.

[0011] In one of the embodiments, the step of obtaining a chroma histogram corresponding to a chroma channel image based on an original image comprises:

[0012] Converting the original image into an HSV image;

[0013] Separating the HSV image to obtain a chroma channel image and a corresponding chroma histogram.

[0014] In one of the embodiments, after the step of obtaining the chroma histogram corresponding to the chroma channel image based on the original image, the image segmentation method further comprises:

[0015] Preprocessing the chroma histogram, the preprocessing comprising filtering and smoothing.

[0016] In one of the embodiments, the target parameter value comprises at least one of a pixel amount peak value, a chroma value corresponding to the pixel amount peak value, a pixel amount corresponding to zero chroma, and a rightmost effective chroma value on the horizontal axis.

[0017] In one of the embodiments, the preset condition comprises any one of the following:

[0018] Condition A: the pixel amount peak value is greater than a first peak value, the chroma value corresponding to the pixel amount peak value is less than a first chroma value, the rightmost effective chroma value on the horizontal axis is less than a second chroma value, and the pixel amount corresponding to zero chroma is greater than a preset pixel amount;

[0019] Condition B: the pixel amount peak value is greater than a second peak value, the second peak value is greater than the first peak value, the chroma value corresponding to the pixel amount peak value is less than the first chroma value, and the rightmost effective chroma value on the horizontal axis is less than the second chroma value.

[0020] In one of the embodiments, the first peak value comprises 1000, the second peak value comprises 3000, the first chroma value comprises 25°, the second chroma value comprises 45°, and the preset pixel amount comprises 100.

[0021] In one of the embodiments, the first threshold range comprises 108-255, and the second threshold range comprises 38-255.

[0022] In one of the embodiments, the step of segmenting the image in combination with the first threshold range or the second threshold range comprises:

[0023] Segmenting a lawn area and a non-lawn area from the HSV image in combination with the first threshold range or the second threshold range.

[0024] According to a second aspect of the embodiments of the present application, an image segmentation device is provided, comprising:

[0025] An acquisition module, configured to acquire a chroma histogram corresponding to a chroma channel image based on an original image;

[0026] A first determination module, configured to determine a target parameter value based on the chroma histogram.

[0027] determining the saturation degree segmentation threshold as a first threshold range when the target parameter value meets the preset condition, and determining the saturation degree segmentation threshold as a second threshold range when the target parameter value does not meet the preset condition, wherein a minimum value of the first threshold range is greater than a minimum value of the second threshold range;

[0028] performing image segmentation in combination with the first threshold range or the second threshold range.

[0029] According to a third aspect of the embodiments of the present application, a computer device is provided, comprising a memory and a processor, the memory stores a computer program, and the processor implements the image segmentation method as described above when executing the computer program.

[0030] According to a fourth aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the image segmentation method as described above.

[0031] The image segmentation method, device, computer device and computer readable storage medium provided by the embodiments of the present application can obtain a chroma histogram corresponding to a chroma channel based on an original image, determine a target parameter value based on the chroma histogram, and then judge whether the target parameter value meets a preset condition. If yes, the saturation degree segmentation threshold is determined as a first threshold range, and if not, the saturation degree segmentation threshold is determined as a second threshold range. The minimum value of the first threshold range is greater than the minimum value of the second threshold range. Finally, image segmentation is performed in combination with the first threshold range or the second threshold range.

[0032] That is, for the collected image, a fixed saturation threshold range is not used for segmentation, but different saturation segmentation thresholds are used for different images to improve the clarity and accuracy of segmentation. The preset condition and the saturation segmentation threshold can be set according to the actual scene, for example, the preset condition and the saturation segmentation threshold are set in advance according to the yellowing feature of the image collected under the slanting sun. Then, it is judged whether the current image meets the preset condition. If yes, it is indicated that the current image is a yellowing image collected under the slanting sun, and the first threshold range matched therewith is used as the saturation cutting threshold to segment the image. The minimum value of the first threshold range is greater than the minimum value of the second threshold range, so as to adapt to the feature that the lawn area has high saturation under the slanting sun. Thus, the image can be segmented into lawn and non-lawn clearly and accurately, the cutting effect is not poor due to the yellowing of the image, and the subsequent misjudgment rate is reduced. BRIEF DESCRIPTION OF DRAWINGS

[0033] Figure 1 a flowchart of the image segmentation method provided by an embodiment of the present application;

[0034] Figure 2 A flow chart of step S200 in the image segmentation method provided by an embodiment of the present application is shown in the figure;

[0035] Figure 3 A schematic diagram of the chroma histogram obtained in the image segmentation method provided by an embodiment of the present application is shown in the figure;

[0036] Figure 4 A schematic diagram of the original image, the channel images, and the chroma histogram obtained in a specific example is shown in the figure;

[0037] Figure 5 A comparison of the results of image segmentation with different saturation segmentation thresholds in a specific example is shown in the figure;

[0038] Figure 6 A structural schematic diagram of the image segmentation device provided by an embodiment of the present application is shown in the figure;

[0039] Figure 7 A structural schematic diagram of the computer device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0040] In order to facilitate the understanding of the present application, the present application will be described more fully below with reference to the accompanying drawings. The preferred embodiments of the present application are shown in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0041] In the present application, unless otherwise explicitly specified and limited, the terms "mounting", "connection", "connecting", "fixing" and the like should be understood in a broad sense, for example, can be fixedly connected, or can be detachably connected, or can be integrated; can be mechanically connected, or can be electrically connected; can be directly connected, or can be indirectly connected through an intermediate medium; can be the internal communication of two elements or the interaction relationship between two elements, unless otherwise explicitly limited. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0042] The terms "first", "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "multiple" is at least two, for example, two, three, etc., unless otherwise explicitly specified and limited.

[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing particular embodiments only and is not intended to be limiting of the application. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0044] As described in the background, image segmentation technology is one of the key technologies in the field of image processing and computer vision recognition, which is widely used in various intelligent devices. For example, an intelligent mower can collect image information of the ground in real time during its travel and perform segmentation processing thereon. The segmentation processing is mainly to segment the lawn area and the non-lawn area such as the cement ground, so as to go to the lawn area to perform cleaning tasks. Therefore, the accuracy of segmentation of the lawn area and the non-lawn area directly affects the working performance of the intelligent mower.

[0045] At present, the segmentation of the lawn area and the non-lawn area usually adopts a fixed segmentation threshold. However, the features of images obtained under different light scenes are not the same. For example, the image collected under the oblique sun is often yellow relative to the image collected under normal light. If the image collected under the oblique sun is segmented by using the segmentation threshold suitable for the image collected under normal light, the segmentation effect is not clear and not accurate, which is easy to cause misjudgment of the lawn area and the non-lawn area, and thus affects the efficient work of the intelligent mower.

[0046] Therefore, the embodiments of the present application provide an image segmentation method, an image segmentation device, a computer device and a computer readable storage medium, to clearly and accurately segment the image collected under the oblique sun, and reduce the misjudgment rate of the lawn area and the non-lawn area.

[0047] In one embodiment, an image segmentation method is provided, which can be used to segment the lawn area and the non-lawn area according to the collected image.

[0048] Reference Figure 1 The image segmentation method provided in the embodiment includes the following steps:

[0049] Step S200: Obtain a chrominance histogram corresponding to a chrominance channel image based on an original image.

[0050] An image is acquired by an acquisition device, and when the image is acquired, the acquired image is obtained from the acquisition device. In this embodiment of the present application, the image is defined as an original image, and the original image can include a lawn area and a non-lawn area. The image has various characteristics, such as saturation, chroma, brightness, and the like, and each characteristic has a corresponding channel image. In this embodiment, a chroma channel image can be obtained after the original image is processed accordingly, and a chroma histogram can be generated based on the chroma channel image for subsequent processing.

[0051] In step S400, a target parameter value is determined based on the chroma histogram.

[0052] The horizontal axis of the chroma histogram is generally a chroma value, and the vertical axis is generally a pixel quantity, which is referred to as a pixel amount. The chroma histogram can be used to determine the chroma distribution range in the current image and the pixel amount contained by the chroma of any point. In this embodiment, the target parameter value can be determined based on the chroma histogram, where the target parameter value is a numerical value of a judgment parameter for determining whether the image is yellowed due to the influence of the slanting sun. For example, the pixel amount peak value in the chroma histogram, the chroma value corresponding to the pixel amount peak value, the pixel amount corresponding to the chroma of 0, the last valid chroma value in the horizontal axis, and the like. If the image is yellowed due to the influence of the slanting sun, the numerical value of the above target parameter is generally different from the numerical value of the target parameter corresponding to a normal image, where the normal image refers to an image that is not yellowed due to the influence of the slanting sun. Based on this, in this embodiment, the target parameter value of the current image can be first determined, so that whether the current image is yellowed due to the influence of the slanting sun can be inferred based on the target parameter value.

[0053] In step S600, if the target parameter value meets a preset condition, the saturation segmentation threshold is determined as a first threshold range, otherwise the saturation segmentation threshold is determined as a second threshold range, and the minimum value of the first threshold range is greater than the minimum value of the second threshold range.

[0054] Since the numerical value of the target parameter in the chroma histogram corresponding to the image yellowed due to the influence of the slanting sun has a corresponding rule, in this embodiment, the preset condition can be set in advance according to the corresponding rule. When the target parameter value corresponding to the current image is determined, the current target parameter value is compared with the preset condition to determine whether the target parameter value meets the preset condition. If yes, it can be inferred that the current image is yellowed due to the influence of the slanting sun, and if not, it can be inferred that the current image is not yellowed due to the influence of the slanting sun. The preset condition can be that the pixel amount peak value in the chroma histogram is greater than a certain numerical value, the chroma value corresponding to the pixel amount peak value is less than a certain numerical value, and the like. The specific preset condition can be set according to the actual situation, as long as the preset condition meets the characteristics of the image yellowed due to the influence of the slanting sun.

[0055] If the image affected by the sun is segmented by the segmentation threshold of the normal image, the segmentation effect is not clear and not accurate, and misjudgment of the lawn area and the non-lawn area is easy to occur. In the embodiment, different saturation segmentation thresholds are set according to different characteristics of the normal image and the image affected by the sun. When it is determined that the current image is affected by the sun, the first threshold range matched therewith is used as the saturation segmentation threshold. When it is determined that the current image is not affected by the sun, the second threshold range matched therewith is used as the saturation segmentation threshold. Since the saturation of the lawn in the image collected under the sun is usually higher than that of the lawn in the normal image, the minimum value of the first threshold range is greater than that of the second threshold range, which helps to improve the accuracy of segmentation of the lawn area and the non-lawn area from the image affected by the sun.

[0056] In step S800, image segmentation is performed in combination with the first threshold range or the second threshold range.

[0057] After the saturation segmentation threshold is determined, image segmentation can be performed in combination with the saturation segmentation threshold (the first threshold range or the second threshold range) and the chroma channel threshold and the brightness channel threshold to segment the lawn area and the non-lawn area.

[0058] The image segmentation method provided by the embodiment of the application can obtain the chroma histogram corresponding to the chroma channel based on the original image, determine the target parameter value based on the chroma histogram, and then judge whether the target parameter value meets the preset condition. If yes, the saturation segmentation threshold is determined as the first threshold range. If not, the saturation segmentation threshold is determined as the second threshold range. The minimum value of the first threshold range is greater than that of the second threshold range. Finally, image segmentation is performed in combination with the first threshold range or the second threshold range.

[0059] That is, for the collected image, a fixed saturation threshold range is not used for segmentation, but different saturation segmentation thresholds are used for different images to improve the clarity and accuracy of segmentation. The preset condition and the saturation segmentation threshold can be set according to the actual scene. For example, the preset condition and the saturation segmentation threshold are set in advance according to the yellowing characteristics of the image collected under the sun. Then, it is judged whether the current image meets the preset condition. If yes, it is indicated that the current image is the yellowing image collected under the sun. The first threshold range matched therewith is used as the saturation segmentation threshold to segment the image. The minimum value of the first threshold range is greater than that of the second threshold range to adapt to the high saturation of the lawn area under the sun. Thus, the lawn and the non-lawn can be clearly and accurately segmented from the image, the segmentation effect is not poor due to the yellowing of the image, and the misjudgment rate is reduced.

[0060] In one of the embodiments, reference is made toFigure 2 The step S200 of obtaining the chroma histogram corresponding to the chroma channel image based on the original image comprises:

[0061] The step S210 of converting the original image into an HSV image.

[0062] The original image collected by the collection device such as a camera is usually an RGB format image. First, the RGB format image is converted into an HSV format image (referred to as an HSV image) for subsequent analysis. Of course, the original image has different sources, and the image format is also different, that is, the original image can also be other image formats, which can be uniformly converted into an HSV image.

[0063] The HSV format is a color space, which includes chroma H, saturation S, and brightness V. The chroma H is measured by an angle, and the value range is 0°-180°. The saturation S represents the degree of color close to the spectrum color. The larger the proportion of the spectrum color, the higher the degree of color close to the spectrum color, and the higher the saturation of the color. The value range is 0%-100%. The brightness V represents the degree of color brightness. For object color, the brightness value V is related to the transmission ratio or reflectivity of the object. The value range is 0%-100%, 0% is black, and 100% is white.

[0064] The step S220 of separating the HSV image to obtain the chroma channel image and the corresponding chroma histogram.

[0065] After obtaining the HSV image, it can be separated and processed. As described above, the HSV image includes three channels of chroma, saturation, and brightness. In this embodiment, it is necessary to determine whether the image is affected by the oblique sun and yellow. Therefore, the chroma channel image is obtained, and the corresponding chroma histogram of the chroma channel image is obtained.

[0066] In one embodiment, after the step S200 of obtaining the chroma histogram corresponding to the chroma channel image based on the original image, the image segmentation method provided by the embodiment further comprises the following steps:

[0067] The step S300 of pre-processing the chroma histogram, the pre-processing comprising filtering and smoothing.

[0068] After obtaining the chroma histogram, the filtering and smoothing pre-processing operations are first performed to reduce the interference signals in the chroma histogram and further reduce the false segmentation.

[0069] In one embodiment, the target parameter value includes at least one of a pixel amount peak value, a chroma value corresponding to the pixel amount peak value, a pixel amount corresponding to zero chroma, and a rightmost effective chroma value on the horizontal axis.

[0070] wherein, referring to Figure 3 , the pixel quantity peak is the highest value of the number of pixel points in the chroma histogram (maxColor in Figure 3 ), the chroma value corresponding to the pixel quantity peak is the chroma value corresponding to the highest value of the number of pixel points in the chroma histogram (maxColorH in Figure 3 ), the pixel quantity corresponding to zero chroma is the number of pixel points corresponding to zero chroma in the chroma histogram (hZero in Figure 3 ), and the rightmost effective chroma value on the horizontal axis is the chroma value corresponding to the first point with a pixel quantity greater than 30 from right to left on the horizontal axis (lastH in Figure 3 ). In this embodiment, the above target parameter values are used as the main basis for determining whether the image is affected by the setting sun and yellowing.

[0071] In one of the embodiments, the preset condition includes any one of the following:

[0072] Condition A: the pixel quantity peak is greater than the first peak value, the chroma value corresponding to the pixel quantity peak is less than the first chroma value, the rightmost effective chroma value on the horizontal axis is less than the second chroma value, and the pixel quantity corresponding to zero chroma is greater than the preset pixel quantity;

[0073] Condition B: the pixel quantity peak is greater than the second peak value, the second peak value is greater than the first peak value, the chroma value corresponding to the pixel quantity peak is less than the first chroma value, and the rightmost effective chroma value on the horizontal axis is less than the second chroma value.

[0074] Based on a large number of images collected as data analysis basis, the chroma histogram of each image is analyzed to obtain the histogram distribution characteristics, for example, under the setting sun, the number of pixel points with chroma 0 in the non-lawn area (such as cement ground) is relatively large, the number of orange-yellow pixel points is relatively large, and so on. On this basis, the above two histogram distribution rules can be summarized, and when any one of the above two histogram distribution rules is satisfied, it can be considered that the image is affected by the setting sun and yellowing. The above preset condition is relatively accurate, which is helpful for accurately determining the saturation segmentation threshold value.

[0075] In one of the embodiments, the first peak value includes 1000, the second peak value includes 3000, the first chroma value includes 25°, the second chroma value includes 45°, and the preset pixel quantity includes 100.

[0076] In a specific example, the preset condition A is that the pixel quantity peak is greater than 1000, the chroma value corresponding to the pixel quantity peak is less than 25°, the rightmost effective chroma value on the horizontal axis is less than 45°, and the pixel quantity corresponding to zero chroma is greater than 100; and the preset condition B is that the pixel quantity peak is greater than 3000, the chroma value corresponding to the pixel quantity peak is less than 25°, and the rightmost effective chroma value on the horizontal axis is less than 45°.

[0077] The selection of the first peak value, the second peak value, the first chroma value, the second chroma value and the preset pixel amount can be determined according to actual conditions, and is not limited herein.

[0078] In one embodiment, the first threshold range includes 108-255, and the second threshold range includes 38-255.

[0079] That is, for the image affected by the slanting sun, the saturation segmentation threshold is 108-255, and for the image under normal light, the saturation segmentation threshold is 38-255. For the image under normal light, the grassland region and the non-grassland region can be effectively segmented by the saturation segmentation threshold of 38-255. For the image affected by the slanting sun, the saturation of the grassland is increased, and the saturation segmentation threshold of 38-255 cannot accurately segment the grassland region and the non-grassland region. Therefore, the saturation segmentation threshold is adjusted to 108-255, and the grassland region and the non-grassland region can be effectively segmented by the saturation segmentation threshold of 108-255.

[0080] Of course, the first threshold range and the second threshold range can be adjusted according to actual conditions to adapt to the characteristics of the current image.

[0081] In one embodiment, the step S800, i.e., the step of segmenting the image in combination with the first threshold range or the second threshold range, includes: segmenting the grassland region and the non-grassland region from the HSV image in combination with the first threshold range or the second threshold range. That is, the HSV image is color segmented according to the saturation segmentation threshold, the chroma segmentation threshold and the brightness segmentation threshold, and then the grassland region and the non-grassland region are segmented.

[0082] The image segmentation method provided in the embodiment is described below with a specific example:

[0083] Referring to Figure 4 , first, the original image orgMat is obtained, which is converted into an HSV image, and then the saturation channel image sMat, the chroma channel image hMat and the brightness channel image vMat are separated.

[0084] According to the chroma channel image hMat, the chroma histogram is obtained. According to the chroma histogram, it can be determined that the pixel amount corresponding to zero chroma hZero=403, the pixel amount peak maxColor=1874, the chroma value corresponding to the pixel amount peak maxColorH=17, and the effective chroma value on the rightmost side of the horizontal axis lastH=38.

[0085] The preset condition A is maxColor>1000 and maxColorH<25 and lastH<45 and hZero>100, and the preset condition B is maxColor>3000 and maxColorH<25 and lastH<45.

[0086] As can be seen from the target parameter value and the preset condition, if the target parameter value satisfies the preset condition A, it is determined that the current image is affected by the setting sun and is yellow, and the saturation segmentation threshold [sLTH, sHTH]=[108, 255] (i.e., the first threshold range) is set.

[0087] At the same time, the chroma segmentation threshold [hLTH, hHTH]=[15, 115] is set, and the luminance segmentation threshold [vLTH, vHTH]=[10, 255] is set. The HSV image is segmented in combination with the saturation segmentation threshold [sLTH, sHTH] and the chroma segmentation threshold [hLTH, hHTH] and the luminance segmentation threshold [vLTH, vHTH], to obtain a target image prevObstacleMat, which is referred to in (a) of FIG. 6. Figure 5 As can be seen from the target image prevObstacleMat, the segmentation of the lawn area and the non-lawn area is clear and accurate.

[0088] For comparison, the saturation segmentation threshold [sLTH, sHTH]=[38, 255] (i.e., the second threshold range) is set, and the chroma segmentation threshold and the luminance segmentation threshold remain unchanged, and finally the target image prevObstacleMat is obtained, which is referred to in (b) of FIG. 6. Figure 5 As can be seen from the target image prevObstacleMat, the segmentation of the lawn area and the non-lawn area is relatively blurred and has a low accuracy.

[0089] It should be understood that although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow indication, these steps are not necessarily executed in sequence according to the arrow indication. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.

[0090] Based on the same inventive concept, another embodiment of the present application further provides an image segmentation device for implementing the image segmentation method as described above. The implementation scheme of the image segmentation device for solving the problem is similar to the implementation scheme described in the above method, so the specific limitations in one or more image segmentation device embodiments provided below can refer to the limitations of the image segmentation method in the above, which will not be repeated here.

[0091] With reference to Figure 6 The image segmentation device provided by the embodiment includes an acquisition module 200, a first determination module 400, a second determination module 600, and an image segmentation module 800. Wherein:

[0092] The acquisition module 200 is configured to acquire a chroma histogram corresponding to the chroma channel image based on the original image.

[0093] The first determination module 400 is configured to determine a target parameter value based on the chroma histogram.

[0094] The second determination module 600 is configured to determine the saturation segmentation threshold as a first threshold range when the target parameter value meets a preset condition, and otherwise determine the saturation segmentation threshold as a second threshold range, wherein the minimum value of the first threshold range is greater than the minimum value of the second threshold range.

[0095] The image segmentation module 800 is configured to perform image segmentation in combination with the first threshold range or the second threshold range.

[0096] The image segmentation device provided by the embodiment acquires the chroma histogram corresponding to the chroma channel based on the original image, determines the target parameter value based on the chroma histogram, and then judges whether the target parameter value meets the preset condition. If it meets, the saturation segmentation threshold is determined as the first threshold range, and if it does not meet, the saturation segmentation threshold is determined as the second threshold range, wherein the minimum value of the first threshold range is greater than the minimum value of the second threshold range. Finally, image segmentation is performed in combination with the first threshold range or the second threshold range.

[0097] That is, for the collected image, a fixed saturation threshold range is not used for segmentation, but different saturation segmentation thresholds are used for different images to improve the clarity and accuracy of segmentation. Specifically, the preset condition and the saturation segmentation threshold can be set according to the actual scene, for example, the preset condition and the saturation segmentation threshold are set according to the yellowing feature of the image collected under the slanting sun, and then it is judged whether the current image meets the preset condition. If it meets, it means that the current image is a yellowing image collected under the slanting sun, and the first threshold range matched therewith is used as the saturation cutting threshold to segment the image. The minimum value of the first threshold range is greater than the minimum value of the second threshold range to adapt to the feature that the lawn area has high saturation under the slanting sun. Thus, the image can be clearly and accurately segmented into lawn and non-lawn, the cutting effect is not poor due to the yellowing of the image, and the subsequent misjudgment rate is reduced.

[0098] In one of the embodiments, the acquisition module 200 includes a conversion unit and an acquisition unit. Wherein:

[0099] The conversion unit is configured to convert the original image into an HSV image.

[0100] The acquisition unit is configured to separate the HSV image to obtain a chroma channel image and a corresponding chroma histogram.

[0101] In one of the embodiments, the image segmentation device provided by the embodiment further includes a preprocessing module 300, and the preprocessing module 300 is configured to pre-process the chroma histogram, and the pre-processing includes filtering processing and smoothing processing.

[0102] In one of the embodiments, the target parameter value includes at least one of a pixel amount peak value, a chroma value corresponding to the pixel amount peak value, a pixel amount corresponding to zero chroma, and a rightmost effective chroma value on the horizontal axis.

[0103] In one of the embodiments, the preset condition includes any one of the following:

[0104] Condition A: the pixel amount peak value is greater than a first peak value, the chroma value corresponding to the pixel amount peak value is less than a first chroma value, the rightmost effective chroma value on the horizontal axis is less than a second chroma value, and the pixel amount corresponding to zero chroma is greater than a preset pixel amount;

[0105] Condition B: the pixel amount peak value is greater than a second peak value, the second peak value is greater than the first peak value, the chroma value corresponding to the pixel amount peak value is less than the first chroma value, and the rightmost effective chroma value on the horizontal axis is less than the second chroma value.

[0106] In one of the embodiments, the first peak value includes 1000, the second peak value includes 3000, the first chroma value includes 25°, the second chroma value includes 45°, and the preset pixel amount includes 100.

[0107] In one embodiment, the first threshold range includes 108 to 255, and the second threshold range includes 38 to 255.

[0108] In one embodiment, the image segmentation module 800 is used to segment grass areas and non-grass areas from an HSV image by combining a first threshold range and a second threshold range.

[0109] Each module in the aforementioned image segmentation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0110] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps in the above method embodiments.

[0111] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores various types of data involved in the image segmentation method. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements an image segmentation method.

[0112] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0113] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0114] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, database or other medium used in each embodiment provided by the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0115] Each technical feature of the above-mentioned embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of each technical feature in the above-mentioned embodiments are not described, but as long as the combination of these technical features does not exist, it should be considered as the scope of the present application.

[0116] The above-mentioned embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the patent scope. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. An image segmentation method characterized by, The method comprises: obtaining a chroma histogram corresponding to a chroma channel image based on an original image; determining a target parameter value based on the chroma histogram, the target parameter value being a numerical value of a determination parameter of whether the original image is affected by a yellowing of the original image caused by a sunbeam; if the target parameter value satisfies a preset condition, determining a saturation segmentation threshold to be a first threshold range, otherwise determining the saturation segmentation threshold to be a second threshold range, a minimum value of the first threshold range being greater than a minimum value of the second threshold range; the preset condition comprises any one of the following conditions: condition A: a pixel amount peak value is greater than a first peak value, and a chroma value corresponding to the pixel amount peak value is less than a first chroma value, and a rightmost effective chroma value on a horizontal axis is less than a second chroma value, and a pixel amount corresponding to zero chroma is greater than a preset pixel amount; condition B: a pixel amount peak value is greater than a second peak value, the second peak value being greater than the first peak value, and a chroma value corresponding to the pixel amount peak value is less than the first chroma value, and a rightmost effective chroma value on the horizontal axis is less than the second chroma value; performing image segmentation on the original image in combination with the saturation segmentation threshold, a chroma channel threshold and a lightness channel threshold, the saturation segmentation threshold being the first threshold range or the second threshold range.

2. The image segmentation method of claim 1, wherein, The step of obtaining a chroma histogram corresponding to a chroma channel image based on an original image comprises: converting the original image into an HSV image; after the step of obtaining a chroma histogram corresponding to a chroma channel image based on an original image, the image segmentation method further comprises: preprocessing the chroma histogram, the preprocessing comprising filtering processing and smoothing processing.

3. The image segmentation method of claim 1, wherein, The first peak value is 1000, the second peak value is 3000, the first chroma value is 25°, the second chroma value is 45°, and the preset pixel amount is 100.

4. The image segmentation method of claim 1, wherein, The first threshold range is 108-255, and the second threshold range is 38-255.

5. The image segmentation method of claim 2, wherein, The step of performing image segmentation on the original image in combination with the saturation segmentation threshold, a chroma channel threshold and a lightness channel threshold comprises: segmenting a lawn area and a non-lawn area from the HSV image in combination with the saturation segmentation threshold, the chroma channel threshold and the lightness channel threshold.

6. An image segmentation apparatus characterized by comprising: The method comprises: an acquisition module configured to obtain a chroma histogram corresponding to a chroma channel image based on an original image; a first determination module configured to determine a target parameter value based on the chroma histogram, the target parameter value being a numerical value of a determination parameter of whether the original image is affected by a yellowing of the original image caused by a sunbeam; The second determining module is configured to determine the saturation segmentation threshold as a first threshold range when the target parameter value satisfies a preset condition, and otherwise determine the saturation segmentation threshold as a second threshold range, wherein a minimum value of the first threshold range is greater than a minimum value of the second threshold range; the preset condition includes any one of the following conditions: condition A: a pixel quantity peak value is greater than a first peak value, a color value corresponding to the pixel quantity peak value is less than a first color value, a rightmost effective color value on a horizontal axis is less than a second color value, and a pixel quantity corresponding to zero color is greater than a preset pixel quantity; condition B: a pixel quantity peak value is greater than a second peak value, the second peak value is greater than the first peak value, a color value corresponding to the pixel quantity peak value is less than the first color value, and a rightmost effective color value on the horizontal axis is less than the second color value. The image segmentation module is configured to perform image segmentation on the original image in combination with the saturation segmentation threshold, the color channel threshold, and the brightness channel threshold, wherein the saturation segmentation threshold is the first threshold range or the second threshold range. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The processor executes the computer program to implement the image segmentation method in any one of claims 1-5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the image segmentation method in any one of claims 1-5.

Citation Information

Patent Citations

  • A grassland boundary identification method and an intelligent mowing device applying the same

    CN109584258A