Image binarization processing method and system based on HSV color space and storage medium

By converting the image into HSV color space and determining the threshold range using manual interaction, the limitations and lighting impact problems of image binarization methods in the traditional RGB color space are solved, and higher image segmentation accuracy and efficiency are achieved.

CN119832018APending Publication Date: 2025-04-15HANGZHOU HUICUI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411737199.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The traditional image binarization method based on RGB color space has limitations when dealing with color separation, and it is difficult to directly perform accurate binarization based on color characteristics, and is greatly affected by light.

Method used

Image binarization processing method based on HSV color space is adopted, and the image binarization processing is performed through RGB to HSV format conversion, and a method of manually interacting to determine the threshold range is introduced.

Benefits of technology

It effectively overcomes the disadvantages of the binarization method under the traditional RGB color space being greatly affected by lighting, and improves the accuracy and efficiency of image segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832018A_ABST
    Figure CN119832018A_ABST
Patent Text Reader

Abstract

The invention discloses an HSV color space-based image binarization processing method and system and a storage medium, and the method comprises the steps: reading an input image which is an RGB format image; format conversion is carried out on the input image to obtain a target image, and the target image is in an HSV format; image processing is carried out on the target image based on operation selection of a user side, and the operation selection comprises selection, exclusion, returning, automatic expansion, parameter resetting and parameter range setting; and selecting and completing all image processing steps based on the operation to obtain an image after binarization processing. According to the method, the HSV color space and the method for determining the threshold range through human interaction are introduced, the defect that a binarization method under a traditional RGB color space is greatly influenced by illumination is effectively overcome, and the accuracy and efficiency of image segmentation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and more specifically, to an image binarization processing method, system and storage medium based on HSV color space. Background Art

[0002] Traditional image binarization methods are mostly based on the RGB (Red, Green, Blue) color space, but the RGB color space has limitations when processing color separation, and it is difficult to perform accurate binarization processing directly based on color features.

[0003] In contrast, the HSV color space describes color through three components: hue, saturation, and value, which is more in line with human perception of color and facilitates color separation and extraction. Therefore, image binarization based on HSV needs to be further limited. Summary of the invention

[0004] The purpose of the present invention is to provide an image binarization processing method, system and storage medium based on the HSV color space. By introducing the HSV color space and the method of manually interacting to determine the threshold range, the disadvantage of the traditional RGB color space binarization method being greatly affected by light is effectively overcome, and the accuracy and efficiency of image segmentation are improved.

[0005] The first aspect of the present invention provides an image binarization processing method based on the HSV color space, comprising the following steps:

[0006] Reading an input image, wherein the input image is an RGB format image;

[0007] Convert the input image into a target image, wherein the target image is in HSV format.

[0008] Performing image processing on the target image based on the operation selection of the user end, wherein the operation selection includes selection, exclusion, return, automatic expansion, parameter reset and parameter range setting;

[0009] After all the image processing steps are completed based on the operation selection, a binarized image is obtained.

[0010] In this solution, converting the format of the input image to obtain the target image specifically includes:

[0011] Extract the conversion formula from RGB image format to HSV image format;

[0012] The input image is format-converted based on the conversion formula to obtain the target image, wherein H, S, and V of the HSV color space are normalized to [0, 255].

[0013] In this solution, image processing is performed on the target image based on the selected operation, specifically including:

[0014] Get the HSV value of the current coordinate point based on the click data of the left mouse button;

[0015] In combination with the first threshold update principle, the low and high thresholds of H, S, and V of the current HSV value are updated;

[0016] The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

[0017] In this solution, image processing is performed on the target image based on the exclusion operation, specifically including:

[0018] Get the HSV value of the current coordinate point based on the click data of the left mouse button;

[0019] In combination with the second threshold update principle, the low threshold and high threshold of H, S, and V of the current HSV value are updated;

[0020] The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

[0021] In this solution, image processing is performed on the target image based on the automatic expansion operation, specifically including:

[0022] Extracting a first update parameter and a second update parameter based on the first threshold update principle and the second threshold update principle;

[0023] Automatic expansion is performed based on the first update parameter and the second update parameter to update the low threshold value and the high threshold value of the HSV value.

[0024] In this solution, image processing is performed on the target image based on parameter resetting and parameter range setting operations, specifically including:

[0025] A reset parameter is obtained based on the input data of the user end, so as to prepare to reset the parameter based on the reset parameter, wherein:

[0026] Based on the reset parameters, new low thresholds and new high thresholds are extracted for parameter range setting.

[0027] The second aspect of the present invention further provides an image binarization processing system based on the HSV color space, comprising a memory and a processor, wherein the memory comprises an image binarization processing method program based on the HSV color space, and when the image binarization processing method program based on the HSV color space is executed by the processor, the following steps are implemented:

[0028] Reading an input image, wherein the input image is an RGB format image;

[0029] Convert the input image into a target image, wherein the target image is in HSV format.

[0030] Performing image processing on the target image based on the operation selection of the user end, wherein the operation selection includes selection, exclusion, return, automatic expansion, parameter reset and parameter range setting;

[0031] After all the image processing steps are completed based on the operation selection, a binarized image is obtained.

[0032] In this solution, converting the format of the input image to obtain the target image specifically includes:

[0033] Extract the conversion formula from RGB image format to HSV image format;

[0034] The input image is format-converted based on the conversion formula to obtain the target image, wherein H, S, and V of the HSV color space are normalized to [0, 255].

[0035] In this solution, image processing is performed on the target image based on the selected operation, specifically including:

[0036] Get the HSV value of the current coordinate point based on the click data of the left mouse button;

[0037] In combination with the first threshold update principle, the low and high thresholds of H, S, and V of the current HSV value are updated;

[0038] The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

[0039] In this solution, image processing is performed on the target image based on the exclusion operation, specifically including:

[0040] Get the HSV value of the current coordinate point based on the click data of the left mouse button;

[0041] In combination with the second threshold update principle, the low threshold and high threshold of H, S, and V of the current HSV value are updated;

[0042] The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

[0043] In this solution, image processing is performed on the target image based on the automatic expansion operation, specifically including:

[0044] Extracting a first update parameter and a second update parameter based on the first threshold update principle and the second threshold update principle;

[0045] Automatic expansion is performed based on the first update parameter and the second update parameter to update the low threshold value and the high threshold value of the HSV value.

[0046] In this solution, image processing is performed on the target image based on parameter resetting and parameter range setting operations, specifically including:

[0047] A reset parameter is obtained based on the input data of the user end, so as to prepare to reset the parameter based on the reset parameter, wherein:

[0048] Based on the reset parameters, new low thresholds and new high thresholds are extracted for parameter range setting.

[0049] A third aspect of the present invention provides a computer-readable storage medium, which includes a machine program for an image binarization processing method based on an HSV color space. When the image binarization processing method based on an HSV color space is executed by a processor, the steps of an image binarization processing method based on an HSV color space as described in any one of the above items are implemented.

[0050] The present invention discloses an image binarization processing method, system and storage medium based on HSV color space, which effectively overcomes the disadvantage that the traditional binarization method under RGB color space is greatly affected by illumination by introducing HSV color space and a method for manually interacting to determine a threshold range, and improves the accuracy and efficiency of image segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A flow chart of an image binarization processing method based on HSV color space of the present invention is shown;

[0052] Figure 2 The gray value image of the input image in the image binarization processing method based on the HSV color space of the present invention is shown;

[0053] Figure 3 The gray value image of the target image in the image binarization processing method based on the HSV color space of the present invention is shown;

[0054] Figure 4A schematic diagram showing the binarization effect of selected coordinate points in an image binarization processing method based on HSV color space of the present invention is shown;

[0055] Figure 5 A schematic diagram showing the binarization effect of excluding coordinate points in an image binarization processing method based on HSV color space of the present invention is shown;

[0056] Figure 6 A schematic diagram showing the image binarization effect after the return operation in an image binarization processing method based on the HSV color space of the present invention is shown;

[0057] Figure 7 A schematic diagram showing the effect of image binarization after automatic expansion in an image binarization processing method based on HSV color space of the present invention is shown;

[0058] Figure 8 A schematic diagram showing the image binarization effect after parameter reset in an image binarization processing method based on HSV color space of the present invention is shown;

[0059] Fig. 9 A block diagram of an image binarization processing system based on the HSV color space of the present invention is shown. DETAILED DESCRIPTION

[0060] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0061] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0062] Figure 1 A flowchart of an image binarization processing method based on the HSV color space of the present application is shown.

[0063] like Figure 1 As shown, the present application discloses an image binarization processing method based on the HSV color space, comprising the following steps:

[0064] S102, reading an input image, wherein the input image is an image in RGB format;

[0065] S104, converting the input image into a target image, wherein the target image is in HSV format;

[0066] S106, performing image processing on the target image based on the operation selection of the user terminal, wherein the operation selection includes selection, exclusion, return, automatic expansion, parameter reset and parameter range setting;

[0067] S108, completing all image processing steps based on the operation selection to obtain a binarized image.

[0068] It should be noted that, in this embodiment, Figure 2 As shown, it is displayed as a grayscale value image of the input image, wherein, when the present application is applied, the input image is first read, and accordingly, the input image read is an RGB format image, and further, the input image is format-converted to obtain a target image, and the format conversion is specifically performed based on a conversion formula, wherein the converted target image is in HSV format, and after obtaining the target image, the target image can be processed based on the operation selection of the user end, and the specific operation selection includes selection, exclusion, return, automatic expansion, parameter reset and parameter range setting, and the specific image processing steps will be described in the subsequent instructions, and finally, after all the image processing steps are completed based on the operation selection, a binary processed image can be obtained.

[0069] According to an embodiment of the present invention, converting the format of the input image to obtain a target image specifically includes:

[0070] Extract the conversion formula from RGB image format to HSV image format;

[0071] The input image is format-converted based on the conversion formula to obtain the target image, wherein H, S, and V of the HSV color space are normalized to [0, 255].

[0072] It should be noted that, in this embodiment, the conversion formula is RGB to HSV. This formula is a prior art and is a technical means that can be directly applied by those skilled in the art. Therefore, it is not described in detail in this embodiment. It is only used as an application means. Therefore, the conversion formula from RGB image format to HSV image format can be extracted, and the input image is format converted based on the conversion formula to obtain the target image. Specifically, Figure 3 As shown, it is displayed as a grayscale value image of the target image, wherein H, S, and V of the HSV color space are all normalized to [0, 255].

[0073] According to an embodiment of the present invention, performing image processing on the target image based on the selection operation specifically includes:

[0074] Get the HSV value of the current coordinate point based on the click data of the left mouse button;

[0075] In combination with the first threshold update principle, the low and high thresholds of H, S, and V of the current HSV value are updated;

[0076] The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

[0077] It should be noted that, in this embodiment, when performing image processing, the first operation corresponds to a selection operation. Specifically, the user clicks the image with the left mouse button to obtain the HSV value at the current coordinate point, that is, the HSV value at the current coordinate point is obtained based on the click data of the left mouse button, and the low and high thresholds of H, S, and V are further updated. The first threshold update principle corresponds to: if the bottom and high thresholds of H, S, and V are all initial values, the HSV value of the current coordinate point is subtracted from a sensitivity value to obtain a low threshold, and the high threshold is obtained by adding this sensitivity value, wherein,

[0078] Low threshold H_Low=(256+H–Sensitivity Value)%256;

[0079] High threshold H_High=(H+Sensitivity Value)%256;

[0080] Furthermore, the pixels between the low threshold and the high threshold are defined as foreground pixels to complete binarization, wherein the coordinate point (58, 11) is selected as an example, as Figure 4 As shown, it is a schematic diagram of the binarization effect of the selected coordinate point, where the HSV value of the current coordinate point is [90, 120, 224], the updated low threshold H_Low: [87, 117, 221], and the updated high threshold H_High: [93, 123, 227].

[0081] According to an embodiment of the present invention, performing image processing on the target image based on the exclusion operation specifically includes:

[0082] Get the HSV value of the current coordinate point based on the click data of the left mouse button;

[0083] In combination with the second threshold update principle, the low threshold and high threshold of H, S, and V of the current HSV value are updated;

[0084] The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

[0085] It should be noted that, in this embodiment, the exclusion operation corresponds to the second threshold update principle, wherein the second threshold update principle corresponds to: obtain the HSV value at the current coordinate point, and check whether the current S value is between the corresponding low and high thresholds. If it is not between them, no processing is performed; if it is between them, calculate the distance difference dst1 and dst2 between the current value and the low threshold and the high threshold respectively, if dst1 is less than or equal to dst2, then S_Low=S+1; otherwise S_High=S-1; the V value update is consistent with S.

[0086] Among them, because the H value is updated cyclically between "0-255", H_Low may be greater than or equal to H_High value, check whether the current H value is between H_Low and H_High thresholds. If not, no processing is done; if between them, there are two cases, specifically,

[0087] The first type, H_Low is less than or equal to H_High, and the processing method is the same as S and V;

[0088] The second type, H_Low is greater than H_High. If the current H is greater than H_Low and less than "256", then the distance difference between the current value and the low threshold and the high threshold is calculated as dst1=H-H_Low, dst2=256-H+H_High; if the current H is greater than or equal to zero and less than or equal to H_High, then the distance difference between the current value and the low threshold and the high threshold is calculated as dst1=256-H_Low+H, dst2=H_High-H, and the corresponding H threshold is updated according to the principle of smaller distance.

[0089] Furthermore, the pixels between the lower threshold and the upper threshold are defined as foreground pixels to complete binarization. In the above embodiment, based on the selection of the coordinate point (58, 11), the coordinate point (288, 149) is excluded as an example in this embodiment. Figure 5 As shown, it is a schematic diagram of the binarization effect of excluding coordinate points. First, the HSV value [232, 221, 223] of the current excluded coordinate point is obtained, and the second threshold update principle is used to obtain the updated low threshold HSV_Low: [87, 117, 224] and the updated high threshold HSV_High: [93, 123, 227].

[0090] It is worth mentioning that, based on the above two steps, a return operation is performed, in which the state of the first step is directly returned to update the corresponding low threshold and high threshold. Figure 6 As shown, it is a schematic diagram of the image binarization effect after the return operation, wherein the updated low threshold HSV_Low: [87, 117, 224], and the high threshold HSV_High: [93, 123, 227].

[0091] According to an embodiment of the present invention, performing image processing on the target image based on the automatic expansion operation specifically includes:

[0092] Extracting a first update parameter and a second update parameter based on the first threshold update principle and the second threshold update principle;

[0093] Automatic expansion is performed based on the first update parameter and the second update parameter to update the low threshold value and the high threshold value of the HSV value.

[0094] It should be noted that, in this embodiment, when automatic expansion is performed, it is necessary to extract the first update parameter and the second update parameter based on the first threshold update principle and the second threshold update principle, wherein the current HSV_Low = HSV_Low-Sensitivity Value; HSV_High = HSV_High+sensitivity Value, the low threshold HSV_Low: [86, 114, 218] and the high threshold HSV_High: [94, 126, 230] obtained by updating based on all the above operation steps, the specific schematic diagram of the image binarization effect after automatic expansion is as follows Figure 7 shown.

[0095] According to an embodiment of the present invention, performing image processing on the target image based on parameter resetting and parameter range setting operations specifically includes:

[0096] A reset parameter is obtained based on the input data of the user end, so as to prepare to reset the parameter based on the reset parameter, wherein:

[0097] Based on the reset parameters, new low thresholds and new high thresholds are extracted for parameter range setting.

[0098] It should be noted that, in this embodiment, the steps in the above embodiment show that there are differences in the image processing processes corresponding to different low and high thresholds. Therefore, the user can set different threshold parameters in actual application. Specifically, a reset parameter is obtained based on the input data of the user end, and the parameter reset is prepared based on the reset parameter, so that a new low threshold and a new high threshold are extracted based on the reset parameter to set the parameter range. Figure 8 As shown, it is a schematic diagram of the image binarization effect after the parameters are reset, corresponding to the new low threshold HSV_Low': [89,118,219] and the new high threshold HSV_High': [95,125,228].

[0099] Fig. 9 A block diagram of an image binarization processing system based on the HSV color space of the present invention is shown.

[0100] like Fig. 9 As shown, the present invention discloses an image binarization processing system based on HSV color space, including a memory and a processor, wherein the memory includes an image binarization processing method program based on HSV color space, and when the image binarization processing method program based on HSV color space is executed by the processor, the following steps are implemented:

[0101] Reading an input image, wherein the input image is an RGB format image;

[0102] Convert the input image into a target image, wherein the target image is in HSV format.

[0103] Performing image processing on the target image based on the operation selection of the user end, wherein the operation selection includes selection, exclusion, return, automatic expansion, parameter reset and parameter range setting;

[0104] After all the image processing steps are completed based on the operation selection, a binarized image is obtained.

[0105] It should be noted that, in this embodiment, Figure 2 As shown, it is displayed as a grayscale value image of the input image, wherein, when the present application is applied, the input image is first read, and accordingly, the input image read is an RGB format image, and further, the input image is format-converted to obtain a target image, and the format conversion is specifically performed based on a conversion formula, wherein the converted target image is in HSV format, and after obtaining the target image, the target image can be processed based on the operation selection of the user end, and the specific operation selection includes selection, exclusion, return, automatic expansion, parameter reset and parameter range setting, and the specific image processing steps will be described in the subsequent instructions, and finally, after all the image processing steps are completed based on the operation selection, a binary processed image can be obtained.

[0106] According to an embodiment of the present invention, converting the format of the input image to obtain a target image specifically includes:

[0107] Extract the conversion formula from RGB image format to HSV image format;

[0108] The input image is format-converted based on the conversion formula to obtain the target image, wherein H, S, and V of the HSV color space are normalized to [0, 255].

[0109] It should be noted that, in this embodiment, the conversion formula is RGB to HSV. This formula is a prior art and is a technical means that can be directly applied by those skilled in the art. Therefore, it is not described in detail in this embodiment. It is only used as an application means. Therefore, the conversion formula from RGB image format to HSV image format can be extracted, and the input image is format converted based on the conversion formula to obtain the target image. Specifically, Figure 3 As shown, it is displayed as a grayscale value image of the target image, wherein H, S, and V of the HSV color space are all normalized to [0, 255].

[0110] According to an embodiment of the present invention, performing image processing on the target image based on the selection operation specifically includes:

[0111] Get the HSV value of the current coordinate point based on the click data of the left mouse button;

[0112] In combination with the first threshold update principle, the low and high thresholds of H, S, and V of the current HSV value are updated;

[0113] The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

[0114] It should be noted that, in this embodiment, when performing image processing, the first operation corresponds to a selection operation. Specifically, the user clicks the image with the left mouse button to obtain the HSV value at the current coordinate point, that is, the HSV value at the current coordinate point is obtained based on the click data of the left mouse button, and the low and high thresholds of H, S, and V are further updated. The first threshold update principle corresponds to: if the bottom and high thresholds of H, S, and V are all initial values, the HSV value of the current coordinate point is subtracted from a sensitivity value to obtain a low threshold, and the high threshold is obtained by adding this sensitivity value, wherein,

[0115] Low threshold H_Low=(256+H–Sensitivity Value)%256;

[0116] High threshold H_High=(H+Sensitivity Value)%256;

[0117] Furthermore, the pixels between the low threshold and the high threshold are defined as foreground pixels to complete binarization, wherein the coordinate point (58, 11) is selected as an example, as Figure 4 As shown, it is a schematic diagram of the binarization effect of the selected coordinate point, where the HSV value of the current coordinate point is [90, 120, 224], the updated low threshold H_Low: [87, 117, 221], and the updated high threshold H_High: [93, 123, 227].

[0118] According to an embodiment of the present invention, performing image processing on the target image based on the exclusion operation specifically includes:

[0119] Get the HSV value of the current coordinate point based on the click data of the left mouse button;

[0120] In combination with the second threshold update principle, the low threshold and high threshold of H, S, and V of the current HSV value are updated;

[0121] The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

[0122] It should be noted that, in this embodiment, the exclusion operation corresponds to the second threshold update principle, wherein the second threshold update principle corresponds to: obtain the HSV value at the current coordinate point, and check whether the current S value is between the corresponding low and high thresholds. If it is not between them, no processing is performed; if it is between them, calculate the distance difference dst1 and dst2 between the current value and the low threshold and the high threshold respectively, if dst1 is less than or equal to dst2, then S_Low=S+1; otherwise S_High=S-1; the V value update is consistent with S.

[0123] Among them, because the H value is updated cyclically between "0-255", H_Low may be greater than or equal to H_High value, check whether the current H value is between H_Low and H_High thresholds. If not, no processing is done; if between them, there are two cases, specifically,

[0124] The first type, H_Low is less than or equal to H_High, and the processing method is the same as S and V;

[0125] The second type, H_Low is greater than H_High. If the current H is greater than H_Low and less than "256", then the distance difference between the current value and the low threshold and the high threshold is calculated as dst1=H-H_Low, dst2=256-H+H_High; if the current H is greater than or equal to zero and less than or equal to H_High, then the distance difference between the current value and the low threshold and the high threshold is calculated as dst1=256-H_Low+H, dst2=H_High-H, and the corresponding H threshold is updated according to the principle of smaller distance.

[0126] Furthermore, the pixels between the lower threshold and the upper threshold are defined as foreground pixels to complete binarization. In the above embodiment, based on the selection of the coordinate point (58, 11), the coordinate point (288, 149) is excluded as an example in this embodiment. Figure 5As shown, it is a schematic diagram of the binarization effect of excluding coordinate points. First, the HSV value [232, 221, 223] of the current excluded coordinate point is obtained, and the second threshold update principle is used to obtain the updated low threshold HSV_Low: [87, 117, 224] and the updated high threshold HSV_High: [93, 123, 227].

[0127] It is worth mentioning that, based on the above two steps, a return operation is performed, in which the state of the first step is directly returned to update the corresponding low threshold and high threshold. Figure 6 As shown, it is a schematic diagram of the image binarization effect after the return operation, wherein the updated low threshold HSV_Low: [87, 117, 224], and the high threshold HSV_High: [93, 123, 227].

[0128] According to an embodiment of the present invention, performing image processing on the target image based on the automatic expansion operation specifically includes:

[0129] Extracting a first update parameter and a second update parameter based on the first threshold update principle and the second threshold update principle;

[0130] Automatic expansion is performed based on the first update parameter and the second update parameter to update the low threshold value and the high threshold value of the HSV value.

[0131] It should be noted that, in this embodiment, when automatic expansion is performed, it is necessary to extract the first update parameter and the second update parameter based on the first threshold update principle and the second threshold update principle, wherein the current HSV_Low = HSV_Low-Sensitivity Value; HSV_High = HSV_High+sensitivity Value, the low threshold HSV_Low: [86, 114, 218] and the high threshold HSV_High: [94, 126, 230] obtained by updating based on all the above operation steps, the specific schematic diagram of the image binarization effect after automatic expansion is as follows Figure 7 shown.

[0132] According to an embodiment of the present invention, performing image processing on the target image based on parameter resetting and parameter range setting operations specifically includes:

[0133] A reset parameter is obtained based on the input data of the user end, so as to prepare to reset the parameter based on the reset parameter, wherein:

[0134] Based on the reset parameters, new low thresholds and new high thresholds are extracted for parameter range setting.

[0135] It should be noted that, in this embodiment, the steps in the above embodiment show that there are differences in the image processing processes corresponding to different low and high thresholds. Therefore, the user can set different threshold parameters in actual application. Specifically, a reset parameter is obtained based on the input data of the user end, and the parameter reset is prepared based on the reset parameter, so that a new low threshold and a new high threshold are extracted based on the reset parameter to set the parameter range. Figure 8 As shown, it is a schematic diagram of the image binarization effect after the parameters are reset, corresponding to the new low threshold HSV_Low': [89,118,219] and the new high threshold HSV_High': [95,125,228].

[0136] A third aspect of the present invention provides a computer-readable storage medium, which includes a program for an image binarization processing method based on an HSV color space. When the program for the image binarization processing method based on an HSV color space is executed by a processor, the steps of an image binarization processing method based on an HSV color space as described in any one of the above items are implemented.

[0137] The present invention discloses an image binarization processing method, system and storage medium based on HSV color space, which effectively overcomes the disadvantage that the traditional binarization method under RGB color space is greatly affected by illumination by introducing HSV color space and a method for manually interacting to determine a threshold range, and improves the accuracy and efficiency of image segmentation.

[0138] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0139] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0140] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0141] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0142] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Claims

1. An image binarization processing method based on HSV color space, characterized in that: The following steps are involved: Reading an input image, wherein the input image is an RGB format image; Convert the input image into a target image, wherein the target image is in HSV format. Performing image processing on the target image based on the operation selection of the user end, wherein the operation selection includes selection, exclusion, return, automatic expansion, parameter reset and parameter range setting; After all the image processing steps are completed based on the operation selection, a binarized image is obtained.

2. The image binarization processing method based on HSV color space according to claim 1, characterized in that: The step of converting the input image into a target image specifically includes: Extract the conversion formula from RGB image format to HSV image format; The input image is format-converted based on the conversion formula to obtain the target image, wherein H, S, and V of the HSV color space are normalized to [0, 255].

3. The image binarization processing method based on HSV color space according to claim 2 is characterized in that: Performing image processing on the target image based on the selected operation specifically includes: Get the HSV value of the current coordinate point based on the click data of the left mouse button; In combination with the first threshold update principle, the low and high thresholds of H, S, and V of the current HSV value are updated; The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

4. The image binarization processing method based on HSV color space according to claim 3 is characterized in that: Performing image processing on the target image based on the exclusion operation specifically includes: Get the HSV value of the current coordinate point based on the click data of the left mouse button; In combination with the second threshold update principle, the low threshold and high threshold of H, S, and V of the current HSV value are updated; The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

5. The image binarization processing method based on HSV color space according to claim 4, characterized in that: Performing image processing on the target image based on the automatic expansion operation specifically includes: Extracting a first update parameter and a second update parameter based on the first threshold update principle and the second threshold update principle; Automatic expansion is performed based on the first update parameter and the second update parameter to update the low threshold value and the high threshold value of the HSV value.

6. The image binarization processing method based on HSV color space according to claim 5, characterized in that: Performing image processing on the target image based on parameter resetting and parameter range setting operations specifically includes: A reset parameter is obtained based on the input data of the user end, so as to prepare to reset the parameter based on the reset parameter, wherein: Based on the reset parameters, new low thresholds and new high thresholds are extracted for parameter range setting.

7. An image binarization processing system based on HSV color space, characterized in that: The invention comprises a memory and a processor, wherein the memory comprises an image binarization processing method program based on the HSV color space, and when the image binarization processing method program based on the HSV color space is executed by the processor, the following steps are implemented: Reading an input image, wherein the input image is an RGB format image; Convert the input image into a target image, wherein the target image is in HSV format. Performing image processing on the target image based on the operation selection of the user end, wherein the operation selection includes selection, exclusion, return, automatic expansion, parameter reset and parameter range setting; After all the image processing steps are completed based on the operation selection, a binarized image is obtained.

8. The image binarization processing system based on HSV color space according to claim 7, characterized in that: The step of converting the input image into a target image specifically includes: Extract the conversion formula from RGB image format to HSV image format; The input image is format-converted based on the conversion formula to obtain the target image, wherein H, S, and V of the HSV color space are normalized to [0, 255].

9. The image binarization processing system based on HSV color space according to claim 8, characterized in that: Performing image processing on the target image based on the selected operation specifically includes: Get the HSV value of the current coordinate point based on the click data of the left mouse button; In combination with the first threshold update principle, the low and high thresholds of H, S, and V of the current HSV value are updated; The pixels between the low threshold and the high threshold are defined as foreground pixels to complete the binarization.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a program for an image binarization processing method based on an HSV color space. When the program for the image binarization processing method based on an HSV color space is executed by a processor, the steps of an image binarization processing method based on an HSV color space as described in any one of claims 1 to 6 are implemented.