Method and apparatus for image processing
By performing gain processing and compensation processing for specific colors and specific indicators on the image, the problem of insignificant differences between the target to be detected in the image and the environment is solved, and the object detection after image processing is achieved is more accurate and easy to use.
Patent Information
- Application Number
- PCT/CN2024/121714
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-28
- Filing Date
- 2024-09-27
- Publication Date
- 2025-04-03
AI Technical Summary
In complex object detection application scenarios, how to properly process the image so that the difference between the object to be detected and the surrounding environment is more significant, thereby improving the accuracy and ease of use of object detection.
By processing the input image, the color dimension of the image is operated using the gain function and the compensation function to highlight specific colors, specific indicators, or specific features, thereby generating an output image. The specific method includes converting the RGB image into an HSV image, determining the gain function of the tone value and the compensation function of the saturation value, combining these functions to generate a new brightness value, and then generating the processed HSV image.
Through this method, the brightness of specific colors in the output image can be significantly improved, making the pixels of these colors more prominent and easy to identify in the image, thereby improving the accuracy of subsequent object detection.
Smart Images

Figure CN2024121714_03042025_PF_FP_ABST
Abstract
Description
Method and apparatus for image processing Technical Field
[0001] The present disclosure relates to a method for image processing, an apparatus for image processing, an image processing apparatus for a vehicle, a computer program product, and a computer-readable storage medium. Background Art
[0002] Images, as one of the most important sources of information for humans, account for a significant portion of various databases. With the rapid development of computer technology, image processing has been widely applied to various aspects of human life, such as industrial inspection, medicine, and intelligent robotics. Due to their vividness and intuitiveness, images are often used in various fields to describe and express the characteristics and logical relationships of objects. Therefore, the development of image processing technology and its application in various fields are extremely important.
[0003] Image processing technology uses computers to process image information. It primarily includes image object detection, image enhancement and restoration, image data encoding, image segmentation, and image recognition. Image object detection technology is widely used in applications such as security monitoring, autonomous driving, traffic monitoring, drone scene analysis, and robotic vision.
[0004] As target detection application scenarios become more and more complex, how to properly process images so that the difference between the target to be detected and the surrounding environment in the image is more obvious, thereby making target detection easier and more accurate, is one of the important research directions in the field of image processing and target detection.
[0005] Summary of the Invention
[0006] According to the method and apparatus for image processing disclosed herein, the obtained original image, especially the color image, is processed so that specific colors, specific indicators or specific features in the processed image are highlighted or enhanced to be suitable for subsequent image processing.
[0007] The present disclosure provides a method for image processing, which includes: acquiring an input image, wherein the color of each pixel of the input image is presented by values of three dimensions; determining a gain function in a first dimension, wherein the gain function causes values within a first range of the first dimension to obtain gain; determining a compensation function in a second dimension, wherein the value of the compensation function increases as the value of the second dimension increases; determining a third dimension function based on the gain function and the compensation function; using the third dimension function, determining the value of the third dimension of each pixel based on the value of the first dimension and the value of the second dimension; and generating an output image based on the value of the first dimension, the value of the second dimension, and the value of the third dimension of each pixel.
[0008] In an embodiment of the present disclosure, obtaining the input image includes: obtaining an RGB image and converting the RGB image into an input image, wherein the input image is an HSV image, and the color of each pixel of the HSV image is presented by a hue value, a saturation value, and a brightness value.
[0009] In an embodiment of the present disclosure, determining a gain function in the first dimension includes: determining a gain function for the hue value; determining a compensation function in the second dimension includes: determining a compensation function for the saturation value; determining a third dimension function based on the gain function and the compensation function includes: determining a brightness function based on the gain function and the compensation function; using the third dimension function, determining the value of the third dimension of each pixel based on the value of the first dimension and the value of the second dimension includes: using the brightness function, determining the processed brightness value of each pixel based on the hue value and the saturation value; and generating an output image based on the value of the first dimension, the value of the second dimension and the value of the third dimension of each pixel includes: generating a processed HSV image based on the hue value, the saturation value and the processed brightness value of each pixel.
[0010] In an embodiment according to the present disclosure, determining the brightness function according to the gain function and the compensation function includes: multiplying the gain function and the compensation function to determine the brightness function.
[0011] In an embodiment of the present disclosure, using the brightness function to determine the processed brightness value of each pixel according to the hue value and the saturation value includes: using the brightness function to determine the brightness increment of each pixel according to the hue value and the saturation value, and adding the brightness increment to the brightness value of each pixel to determine the processed brightness value.
[0012] In an embodiment of the present disclosure, the gain function enables the target value within the first range of the first dimension to have the maximum gain, and the gains of the first dimension values on both sides of the target value gradually decrease.
[0013] In an embodiment of the present disclosure, the gain function is a parabolic function or a normal distribution function.
[0014] In an embodiment according to the present disclosure, the first range of the first dimension includes hue values from 26 to 34.
[0015] In an embodiment according to the present disclosure, the slope of the compensation function increases as the value of the second dimension increases.
[0016] In an embodiment of the present disclosure, the compensation function is an exponential function or a gamma function.
[0017] An embodiment of the present disclosure further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it is used to execute the above method.
[0018] An embodiment of the present disclosure further provides a computer-readable storage medium having computer-executable instructions stored thereon. When the instructions are executed by a processor, they are used to execute the above method.
[0019] An embodiment of the present disclosure also provides a device for image processing, which includes an image acquisition unit for acquiring an input image, wherein the color of each pixel of the input image is presented by values of three dimensions; an image processing unit for determining a gain function in a first dimension, wherein the gain function causes values within a first range of the first dimension to obtain a gain, determining a compensation function in a second dimension, wherein the value of the compensation function increases as the value of the second dimension increases, determining a third dimension function based on the gain function and the compensation function, and determining a corresponding third dimension value based on the value of the first dimension and the value of the second dimension using the third dimension function; and an image output unit for generating an output image based on the values of the first dimension, the second dimension, and the third dimension of each pixel.
[0020] An embodiment of the present disclosure also provides an image processing device for a vehicle, the image processing device for a vehicle comprising: an image acquisition unit for acquiring an RGB image; an image conversion unit for converting the RGB image into an HSV image, the color of each pixel of the HSV image being presented by a hue value, a saturation value, and a brightness value; an image processing unit for determining a gain function for the hue value, the gain function causing a value within a specific hue value range to obtain a gain, determining a compensation function for the saturation, the value of the compensation function increasing as the saturation value increases, multiplying the gain function and the compensation function to determine a brightness function, and using the brightness function to determine a corresponding processed brightness value according to the hue value and the saturation value; an image output unit for generating a processed HSV image according to the hue value, the saturation value, and the processed brightness value of each pixel; and a grayscale image conversion unit for converting the processed HSV image into a grayscale image.
[0021] Embodiments of the present disclosure further provide a motor vehicle, comprising the computer-readable storage medium according to the embodiments of the present disclosure described above, and / or the apparatus for image processing according to the embodiments of the present disclosure described above, and / or the image processing apparatus for a vehicle according to the embodiments of the present disclosure described above. The features of the motor vehicle according to the embodiments of the present disclosure are described in the corresponding sections above and are not further detailed here for the sake of simplicity.
[0022] Compared to the input image, in the output image processed by the method for image processing according to the present disclosure, colors whose values on the first dimension are within the first range and whose values on the second dimension are larger will be assigned a larger value of the third dimension. Based on the larger value of the third dimension, the color will be highlighted, that is, the pixels with the color in the output image will be highlighted and easy to identify. In the case where the input image is an HSV image, in the HSV output image processed by the method for image processing according to the present disclosure, the colors with high saturation within the first range of hue have significantly improved brightness compared to the input image, that is, the original image. This processed HSV output image can still highlight the corresponding colors, that is, the colors with high saturation within the first range of hue after grayscale conversion. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some exemplary embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0024] Herein, in the accompanying drawings:
[0025] FIG1 shows a flow chart of a method for image processing according to an embodiment of the present disclosure;
[0026] FIG2 shows a flowchart of a method for image processing according to another embodiment of the present disclosure;
[0027] FIG3 shows a graph of a gain function according to an embodiment of the present disclosure,
[0028] FIG4 shows a graph of a compensation function according to an embodiment of the present disclosure,
[0029] FIG5 shows a chromatogram according to an embodiment of the present disclosure and a chromatogram processed by a graphics processing method according to an embodiment of the present disclosure.
[0030] FIG6 shows a block diagram of an image processing apparatus for a vehicle according to an embodiment of the present disclosure.
[0031] FIG7 shows an effect diagram after grayscale conversion is performed on an image acquired by an image acquisition unit of an image processing apparatus for a vehicle according to an embodiment of the present disclosure, and FIG8 shows an effect diagram of grayscale conversion of an image acquired by an image acquisition unit of an image processing apparatus for a vehicle according to an embodiment of the present disclosure, and
[0032] FIG8 shows an effect diagram after grayscale conversion is performed on an image processed by the image processing apparatus for a vehicle according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the present disclosure more apparent, the following will describe in detail exemplary embodiments of the present disclosure with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described herein.
[0034] Furthermore, in this specification and the drawings, steps and elements having substantially the same or similar features are denoted by the same or similar reference numerals, and repeated descriptions of these steps and elements will be omitted.
[0035] In addition, in this specification and the drawings, elements are described in singular or plural form, depending on the embodiment. However, the singular and plural forms are appropriately selected for the situations presented merely for convenience of explanation and are not intended to limit the present disclosure thereto. Therefore, the singular form may include the plural form, and the plural form may also include the singular form, unless the context clearly indicates otherwise.
[0036] In addition, in this specification and the drawings, the terms "first / second" are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein.
[0037] Furthermore, in this specification and the accompanying drawings, terms such as "upper," "lower," "vertical," and "horizontal" that relate to orientation or positional relationships are used merely to facilitate description of the embodiments of the present disclosure and are not intended to limit the present disclosure thereto. Therefore, they should not be construed as limiting the present disclosure.
[0038] Furthermore, in this specification and the drawings, unless expressly stated otherwise, “connection” does not necessarily mean “direct connection” or “direct contact”; here, “connection” may refer to both a fixed function and electrical connectivity.
[0039] Figure 1 shows a flowchart of a method 100 for image processing according to an embodiment of the present disclosure. In method 100, an input image is first acquired in step 110. The acquired input image is composed of multiple pixels, and the color of each pixel is represented by values in three dimensions. In embodiments of the present disclosure, the input image may be, for example, an RGB (R: red, G: green, B: blue) image, a CIE XYZ image, a Lab color image, an HSV (H: hue, S: saturation, V: brightness) image, or the like. Regardless of the input image format, the color representation or color display effect of each pixel in the input image is based on the magnitude of the values in the three dimensions. In step S120, a gain function is determined in the first dimension, wherein the gain function gains values within a first range of the first dimension. Thus, the gain function can enhance or emphasize values within the first range of the first dimension. In step S130, a compensation function is determined in the second dimension, wherein the value of the compensation function increases as the value of the second dimension increases. The compensation function can provide greater compensation for larger values in the second dimension and less compensation for smaller values in the second dimension. In step S140, a third dimension function is determined based on the gain function and the compensation function. In step S150, the third dimension function is used to determine the value of the third dimension of each pixel based on the value of the first dimension and the value of the second dimension. In an embodiment of the present disclosure, the value of the third dimension can, for example, replace the value of the third dimension of the input image. Finally, in step S160, an output image is generated based on the value of the first dimension, the value of the second dimension, and the value of the third dimension of each pixel.
[0040] Compared to the input image, in an output image processed by the image processing method according to the present disclosure, a color whose value in the first dimension is within the first range and whose value in the second dimension is larger is assigned a larger value in the third dimension. Based on the larger value in the third dimension, the color is highlighted, that is, pixels having the color in the output image are highlighted and easily identifiable.
[0041] In an embodiment of the present disclosure, for example, when the input image is an HSV image, the color of each pixel of the HSV image is represented by a hue value, a saturation value, and a brightness value. In an embodiment of the present disclosure, for example, the hue value is a value of a first dimension, the saturation value is a value of a second dimension, and the brightness value is a value of a third dimension.
[0042] FIG2 illustrates a flow chart of a method 200 for image processing according to another embodiment of the present disclosure. In this embodiment, before obtaining an input image as an HSV image, an additional step S210 may be provided for acquiring an RGB image. In a subsequent step S220, the RGB image is converted to an HSV image to obtain the input image. Since images recorded by common image sensors are typically in RGB color format, steps S210 and S220 are highly significant in this embodiment and in practice.
[0043] Subsequently, in step S230, a gain function for the hue value is determined. Hue (abbreviated h) can be understood as the primary colors of a color, such as blue, yellow, green, and red, as well as the transition colors between these colors. Depending on different standards or data formats, the hue can vary within a range of 0 to 360° or a range of 0 to 180°. In the case of a hue range of 0 to 360°, for example, h=0° is the red primary color, i.e., spectral red, h=60° is the yellow primary color, i.e., spectral yellow, and h=240° is the blue primary color, i.e., spectral blue. In the case of a hue range of 0 to 180°, for example, h=5 is the red primary color, h[0, 10] is the red range, h=30 is the yellow primary color, h[26, 34] is the yellow range, h=112 is the blue primary color, and h[100, 124] is the blue range. The gain function gains the values within the first dimension, i.e., the first range of the hue. For example, the gain function can be a step function or a square wave function, so that the gain within the first range is different from the gain within the remaining ranges. In an implementation according to the present disclosure, the gain function can, for example, cause the target value within the first range of the first dimension to have the maximum gain, and the gain of the first dimension values on both sides of the target value to gradually decrease. This results in the gain being maximum at the target value of the first dimension, such as the target value of the hue, and the gain gradually decreasing on both sides of the target value. This form can both achieve gain for the desired hue range and weight the values of the hue range differently so that the target value, i.e., a specific hue, is given the maximum weight, thereby highlighting the specific hue the most.
[0044] In an embodiment according to the present disclosure, the gain function may be, for example, a parabolic function or a normal distribution function. In an embodiment according to the present disclosure, the gain function may also be constructed by, for example, a piecewise function. FIG3 shows a graph of a gain function according to an embodiment of the present disclosure. In FIG3 , the horizontal axis represents the value of the hue h, and the hue value h varies in the range of 0 to 180. The vertical axis represents the magnitude of the gain. As can be seen from FIG3 , the gain function is constructed, for example, as a parabolic function f(h)=ah 2+bh+c, 0≤h≤180, where a, b and c are constants. By selecting appropriate values of a, b and c, a parabolic shape as shown in FIG3 can be obtained. In order to set the gain outside the first range, i.e., the range between the intersection of the parabola and the horizontal axis to 0, the parabolic function is further constructed as f(h)=MAX(0,ah 2 +bh+c), 0≤h≤180. MAX function means taking 0 and ah 2 +bh+c. In the embodiment shown in FIG3 , the parabolic function provides gain for hue values in the first range, i.e., 26 to 34, with the gain at hue value 30 being the maximum, equal to 2, and the gain for hue values outside the range 26 to 34 being 0. The gain function shown in FIG3 can provide gain for broadly defined yellow, i.e., yellow within the yellow range h[26, 34], and achieves the maximum gain for hue h=30, i.e., the primary yellow color.
[0045] Subsequently, in step S240, a compensation function for the saturation value is determined. Saturation can be understood as the degree to which a color approaches a primary color or a spectral color. In other words, saturation can be understood as the degree to which white is mixed into a primary color. The higher the saturation, the closer the color is to the primary color, while the lower the saturation, the closer the color is to white. Depending on different standards or data formats, saturation can range from 0 to 100%, or from 0 to 255. The value of the compensation function increases with the value of the second dimension, i.e., saturation. In other words, the closer the color is to the primary color or spectral color, the greater the compensation. In embodiments of the present disclosure, the value of the compensation function increases non-linearly with increasing saturation. In embodiments of the present disclosure, the slope of the compensation function increases with increasing second dimension, for example. This allows colors close to the primary color or spectral color to achieve greater gain, while colors further away from the primary color or spectral color achieve less gain.
[0046] In an embodiment according to the present disclosure, the compensation function may be, for example, an exponential function or a gamma function. In an embodiment according to the present disclosure, the compensation function may also be constructed by, for example, a piecewise function. FIG4 shows a graph of a compensation function according to an embodiment of the present disclosure. In FIG4 , the horizontal axis represents the value of saturation S, and the saturation value S varies in the range of 0 to 255, and the vertical axis represents the magnitude of compensation. It can be seen from FIG4 that the gain function is constructed as, for example, a gamma function g(s)=255*(s / 255)Y, 0≤s≤255, where γ is a constant. By selecting a suitable γ and a suitable size, a gamma curve shape as shown in FIG4 can be obtained. Preferably, γ may be, for example, 1.8. In order to limit the maximum value of the compensation function, the gamma function is further constructed as, for example, g(s)=MIN(255*(s / 255) γ , 255), 0≤s≤255. The MIN function represents 255 and 255*(s / 255) γ In the embodiment shown in FIG4 , the gamma function provides only minimal compensation for smaller saturations, while due to the nonlinear growth of the gamma function, larger saturations receive very large compensation values. Combined with the previous description, this means that colors closer to the spectral color receive larger compensation values, while colors with more white mixed in receive smaller compensation values.
[0047] In step S250, a brightness function B(h, s) is determined based on the hue value gain function f(h) and the saturation value compensation function g(s). In an embodiment of the present disclosure, for example, the brightness function can be determined by multiplying the gain function f(h) and the compensation function g(s), i.e., B(h, s) = f(h)·g(s).
[0048] In step S260, the brightness function B(h, s) is used to determine the processed brightness value v of each pixel according to the hue value h and the saturation value s. new In the embodiment of the present disclosure, the brightness function B(h, s) is used to determine the brightness increment B(h, s) = Δv of each pixel according to the hue value h and the saturation value s, and the brightness increment Δv is respectively compared with the brightness value v of each pixel. orig Add, that is, v new =v orig +Δv, to determine the processed brightness value v new Brightness value V orig and the processed brightness value v new For example, it varies in the range of 0 to 225. In order to convert the processed brightness value v new The maximum value is limited to 255, using the MIN function, that is, v new =MIN(vorig +Δv, 255), MIN function means taking v orig Minimum value between +Δv and 255.
[0049] In step S270, the hue value h, the saturation value s and the processed brightness value v of each pixel are processed. new A processed HSV image is generated. In an embodiment according to the present disclosure, through the aforementioned steps S210 to S260, only colors with high saturation within the first range of hues have a large brightness increment. As described in the aforementioned embodiment, the yellow with the highest saturation and closest to the spectral color in the "generalized yellow" described within the range of hue h[26, 34] has the largest brightness increment. Yellow with lower saturation within the range of hue h[26, 34] has a relatively small brightness increment, while colors outside the range of hue h[26, 34] have no brightness increment. Therefore, in the output image processed by the method for image processing according to the present disclosure, the colors with high saturation within the first range of hues have significantly improved brightness compared to the input image, that is, the original image. Therefore, in the output image, pixels with the desired color will have very high brightness, and the pattern or graphic formed by these pixels can be highlighted and thus clearly identified.
[0050] Figure 5 shows a chromatogram according to an embodiment of the present disclosure and a chromatogram processed by a graphics processing method according to an embodiment of the present disclosure. It should be noted that the chromatogram should be in color; it is shown here in grayscale. However, the brightness of different colors can be seen from this grayscale "chromatogram." The left image in Figure 5 shows a chromatogram. Different regions in the chromatogram represent different colors, namely, different hues with different saturations. The depth of color in the image can reflect brightness: lighter, whiter areas indicate higher brightness, while darker, blacker areas indicate lower brightness. The chromatogram shows that there is not much difference in brightness between different colors. The right image in Figure 5 shows a chromatogram processed by a graphics processing method according to an embodiment of the present disclosure. In the processed chromatogram, it is clearly visible that only one region has colors with very high brightness. According to an embodiment of the present disclosure, this region corresponds to the first range of hues, for example, the yellow range h[26, 34]. In contrast, colors in other regions have almost no brightness, approaching black. Superimposing these two images can make the colors in the first range of hues have high brightness, thereby highlighting them.
[0051] The present disclosure also provides a device for image processing, which is used to perform the above-mentioned method for image processing according to an embodiment of the present disclosure. The device for image processing includes an image acquisition unit, which is used to acquire an input image, wherein the color of each pixel of the input image is presented by values of three dimensions; an image processing unit, which is used to determine a gain function in a first dimension, wherein the gain function causes a value within a first range of the first dimension to obtain a gain, determine a compensation function in a second dimension, wherein the value of the compensation function increases as the value of the second dimension increases, determine a third dimension function based on the gain function and the compensation function, and use the third dimension function to determine the corresponding third dimension value based on the value of the first dimension and the value of the second dimension, and an image output unit, which is used to generate an output image based on the value of the first dimension, the value of the second dimension, and the value of the third dimension of each pixel.
[0052] FIG6 shows a block diagram of an image processing apparatus 600 for a vehicle according to an embodiment of the present disclosure. The image processing apparatus 600 for a vehicle includes an image acquisition unit 610 for acquiring an RGB image; an image conversion unit 620 for converting the RGB image into an HSV image, wherein the color of each pixel in the HSV image is represented by a hue value, a saturation value, and a brightness value; an image processing unit 630 for determining a gain function for the hue value, wherein the gain function increases a value within a specific hue value range; determining a compensation function for the saturation value, wherein the value of the compensation function increases as the saturation value increases; multiplying the gain function and the compensation function to determine a brightness function, and using the brightness function to determine a corresponding processed brightness value based on the hue value and the saturation value; an image output unit 640 for generating a processed HSV image based on the hue value, the saturation value, and the processed brightness value of each pixel; and a grayscale image conversion unit 650 for converting the processed HSV image into a grayscale image.
[0053] The image acquisition unit 610 can be, for example, an image capture device, such as a camera. The RGB image, i.e., the color image, acquired by the image acquisition unit 610 can be used for subsequent image recognition, thereby realizing or helping to realize the automatic driving or assisted driving function of the vehicle. In the image recognition process, grayscale images are generally used because grayscale images have a very small amount of data, which can reduce storage space, increase computing speed, and speed up the image recognition process. However, the disadvantage of grayscale images relative to color images is the loss of image information. For example, objects that can be clearly distinguished by different colors become difficult to distinguish in grayscale images. For this purpose, the RGB image acquired by the image acquisition unit 610 needs to be preprocessed.
[0054] The vehicle image processing device 600 according to the embodiment of the present disclosure is capable of implementing the image processing method described above according to the embodiment of the present disclosure. Therefore, the vehicle image processing device 600 according to the embodiment of the present disclosure is capable of preprocessing the RGB image acquired by the image acquisition unit 610, so that in the processed HSV image generated by the image output unit 640, a specific range of colors, i.e., hues within a specific range with high saturation, achieves very high brightness. After the processed HSV image is converted to a grayscale image, the highlighted colors are highlighted, so that the image information related to the colors is not lost, thereby not affecting the recognition of the related images.
[0055] The image processing device 600 for a vehicle according to an embodiment of the present disclosure is used, for example, to highlight lane markings of a specific color, such as yellow lane lines or parking space lines. FIG7 shows the effect of grayscale conversion on an image acquired by the image acquisition unit 610 of the image processing device 600 for a vehicle according to an embodiment of the present disclosure. As can be seen from FIG7 , after directly grayscale conversion is performed on the RGB image acquired by the image acquisition unit 610, or after the RGB image is converted into an HSV image and then grayscale conversion is performed, the lane lines or parking space lines have a color similar to the ground, such as gray ground, in the grayscale image, making it difficult to identify the lane lines or parking space lines.
[0056] The image processing device 600 for a vehicle according to an embodiment of the present disclosure can significantly increase the brightness of a highly saturated yellow hue, such as a highly saturated hue [26, 34], in an original RGB image or an original HSV image. FIG8 shows the effect of grayscale conversion on an image processed by the image processing device 600 for a vehicle according to an embodiment of the present disclosure. As can be seen from FIG8 , after the processed HSV image is converted to a grayscale image, the yellow lane markings or parking space markings are very distinct in the grayscale image. Therefore, the yellow lane markings or parking space markings can be easily identified during image recognition.
[0057] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of the code, and the module, program segment, or a part of the code contains at least one executable instruction for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0058] This disclosure uses specific terms to describe the embodiments of the present disclosure. For example, "first / second embodiment," "one embodiment," and / or "some embodiments" refer to a certain feature, structure, or characteristic associated with at least one embodiment of the present disclosure. Therefore, it should be emphasized and noted that "one embodiment," "an embodiment," or "an alternative embodiment" mentioned two or more times in different locations in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of the present disclosure may be appropriately combined.
[0059] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It should also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology and should not be interpreted in an idealized or highly formal sense, unless expressly defined as such herein.
[0060] The above is an illustration of the present invention and should not be considered as limiting thereof. Although several exemplary embodiments of the present invention have been described, it will be readily understood by those skilled in the art that many modifications may be made to the exemplary embodiments without departing from the novel teachings and advantages of the present invention. Therefore, all such modifications are intended to be included within the scope of the present invention as defined by the claims. It should be understood that the above is an illustration of the present invention and should not be considered as being limited to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are intended to be included within the scope of the appended claims. The present invention is defined by the claims and their equivalents.
Claims
1. A method for image processing, comprising: Acquire an input image, wherein the color of each pixel of the input image is represented by values of three dimensions; determining a gain function in a first dimension, wherein the gain function causes values within a first range of the first dimension to gain; determining a compensation function in the second dimension, wherein a value of the compensation function increases as a value of the second dimension increases; Determine a third dimension function according to the gain function and the compensation function; Determine the value of the third dimension of each pixel according to the value of the first dimension and the value of the second dimension by using the third dimension function; and An output image is generated according to the value of the first dimension, the value of the second dimension, and the value of the third dimension of each pixel.
2. The method for image processing according to claim 1, wherein: Acquiring the input image comprises: An RGB image is acquired and converted into an input image, wherein the input image is an HSV image, and the color of each pixel of the HSV image is presented by a hue value, a saturation value, and a brightness value.
3. The method for image processing according to claim 2, wherein: Determining a gain function in the first dimension includes: determining a gain function of the hue value; Determining the compensation function in the second dimension includes: determining the compensation function of the saturation value; Determining the third dimension function according to the gain function and the compensation function comprises: determining a brightness function according to the gain function and the compensation function; Determining the value of the third dimension of each pixel according to the value of the first dimension and the value of the second dimension using the third dimension function includes: determining a processed brightness value of each pixel according to the hue value and the saturation value using the brightness function; and According to the value of the first dimension, the value of the second dimension and the value of the third dimension of each pixel The method of generating an output image by using the values of the HSV image processing method comprises: generating a processed HSV image according to the hue value, the saturation value and the processed brightness value of each pixel.
4. The method for image processing according to claim 3, wherein: Determining a brightness function according to the gain function and the compensation function includes multiplying the gain function and the compensation function to determine the brightness function.
5. The method for image processing according to claim 3, wherein: Using the brightness function to determine the processed brightness value of each pixel according to the hue value and the saturation value includes: using the brightness function to determine the brightness increment of each pixel according to the hue value and the saturation value, and adding the brightness increment to the brightness value of each pixel to determine the processed brightness value.
6. The method for image processing according to claim 1, wherein: The gain function enables a target value within a first range of the first dimension to have a maximum gain, and the gains of first dimension values on both sides of the target value gradually decrease.
7. The method for image processing according to claim 6, wherein: The gain function is a parabolic function or a normal distribution function.
8. The method for image processing according to claim 2 or 3, wherein: The first range of the first dimension includes hue values from 26 to 34.
9. The method for image processing according to claim 1, wherein: The slope of the compensation function increases as the value of the second dimension increases. 10 . The method for image processing according to claim 9 , wherein the compensation function is an exponential function or a gamma function.
11. A computer program product, comprising a computer program for executing the method according to any one of claims 1 to 10 when the computer program is executed by a processor. 12 . A computer-readable storage medium having computer-executable instructions stored thereon, wherein the instructions are used to perform the method according to claim 1 when executed by a processor.
13. A device for image processing, comprising An image acquisition unit, configured to acquire an input image, wherein the color of each pixel of the input image is presented by values of three dimensions; an image processing unit, configured to determine a gain function in a first dimension, wherein the gain function causes values within a first range of the first dimension to obtain a gain, determine a compensation function in a second dimension, wherein a value of the compensation function increases as a value of the second dimension increases, determine a third dimension function according to the gain function and the compensation function, and determine a corresponding third dimension value according to a value of the first dimension and a value of the second dimension using the third dimension function; and An image output unit is used to generate an output image according to the value of the first dimension, the value of the second dimension and the value of the third dimension of each pixel.
14. An image processing device for a vehicle, comprising: An image acquisition unit, used for acquiring an RGB image; An image conversion unit, used for converting the RGB image into an HSV image, wherein the color of each pixel of the HSV image is presented by a hue value, a saturation value, and a brightness value; an image processing unit, configured to determine a gain function for the hue value, the gain function causing a value within a specific hue value range to obtain a gain, determine a compensation function for the saturation, the value of the compensation function increasing as the saturation value increases, multiply the gain function and the compensation function to determine a brightness function, and use the brightness function to determine a corresponding processed brightness value according to the hue value and the saturation value; An image output unit, configured to generate a processed HSV image according to the hue value, the saturation value and the processed brightness value of each pixel; and A grayscale image conversion unit is used to convert the processed HSV image into a grayscale image.
15. A motor vehicle comprising the computer-readable storage medium according to claim 12 and / or the device for image processing according to claim 13 and / or the image processing device for a vehicle according to claim 14.
Citation Information
Patent Citations
Image processing device and method
CN101072363A
Image enhancing method and apparatus
CN107424124A
Brightness compensation value obtaining method, computer equipment and computer readable medium
CN110264972A
Color enhancement method and device
CN111899182A
Image processing device, image processing method, and image processing program
JP2009253474A