Image processing method and device

The method enhances image contrast by adjusting color or gray scale distributions within specific ranges, addressing the challenge of target detection by improving image clarity and accuracy in complex scenarios.

CN119722538APending Publication Date: 2025-03-28VALEO INTERIOR CONTROLS (SHENZHEN) CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202311258565.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Current image processing technologies face challenges in enhancing the contrast of images, particularly in distinguishing targets from their surroundings, which hinders the accuracy and efficiency of target detection in complex scenarios.

Method used

The method involves obtaining an input image's color or gray scale distribution, determining specific ranges within it, and applying distribution stretching to set threshold values for the color or gray scale values outside these ranges, thereby optimizing the image contrast and enhancing the visibility of targets.

Benefits of technology

This approach effectively increases the contrast of images, making target recognition more accurate and efficient by improving the clarity and vividness of image features, thus simplifying the identification process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722538A_ABST
    Figure CN119722538A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method and device, a computer program product and a computer readable storage medium. The method comprises the steps that first color gradation distribution corresponding to an input image is acquired, and the color gradation range of the first color gradation distribution is a first range; a second range and a third range except the second range are determined in the first range, and the third range comprises a color gradation range located on the left side and / or the right side of the second range; performing distribution stretching on the first color gradation distribution in the second range to obtain second color gradation distribution with the minimum color gradation value as a first threshold value and the maximum color gradation value as a second threshold value; obtaining third color gradation distribution based on the color gradation distribution in the third range; and determining an output image based on the second gradation distribution and the third gradation distribution. Through the method disclosed by the invention, the contrast of the image can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and more specifically, to a method, device, computer program product, and storage medium for image processing, as well as a method, device, and vehicle assisted driving system and vehicle for identifying a target object. Background Art

[0002] As one of the most important sources of information for humans, images account for a large proportion of various information databases. With the rapid development of computer technology, image processing has been widely used in all aspects of human social life, such as industrial inspection, medicine, intelligent robots, etc. Images are often used in various fields to describe and express the characteristics and logical relationships of things due to their vividness and intuitiveness. They have a wide range of applications. Therefore, the development of image processing technology and information processing in various fields are extremely important.

[0003] Image processing technology is a technology that uses computers to process image information. It mainly includes image target detection, image enhancement and restoration, image data encoding, image segmentation and image recognition. Among them, image target detection technology is widely used in application scenarios such as security monitoring, autonomous driving, traffic condition monitoring, drone scene analysis, and robot 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. Summary of the invention

[0005] In order to effectively improve the contrast of an image, the present disclosure provides a method for image processing, comprising: obtaining a first color scale distribution corresponding to an input image, wherein the color scale range of the first color scale distribution is a first range; determining a second range and a third range except the second range in the first range, wherein the third range includes a color scale range located on the left and / or right side of the second range; performing distribution stretching on the first color scale distribution within the second range to obtain a second color scale distribution with a minimum color scale value being a first threshold and a maximum color scale value being a second threshold; obtaining a third color scale distribution based on the color scale distribution within the third range, wherein, when the third range includes a color scale range located on the left side of the second range, the color scale value of the color scale distribution within the third range located on the left side of the second range is set to the first threshold, and when the third range includes a color scale range located on the right side of the second range, the color scale value of the color scale distribution within the third range located on the right side of the second range is set to the second threshold; and determining an output image based on the second color scale distribution and the third color scale distribution.

[0006] An embodiment of the present disclosure also provides a method for identifying a target object, comprising: obtaining a first grayscale image containing the target object; obtaining a first grayscale distribution corresponding to the input first grayscale image, wherein the grayscale range of the first grayscale distribution is a first range; determining a second range and a third range other than the second range in the first range, wherein the third range includes a color scale range located on the left and / or right side of the second range; performing distribution stretching on the grayscale distribution within the second range to obtain a second grayscale distribution with a grayscale minimum value being a first threshold and a grayscale maximum value being a second threshold; obtaining a third color scale distribution based on the grayscale distribution within the third range, wherein, when the third range includes a color scale range located on the left side of the second range, the color scale value of the grayscale distribution within the third range located on the left side of the second range is set to the first threshold, and when the third range includes a color scale range located on the right side of the second range, the color scale value of the grayscale distribution within the third range located on the right side of the second range is set to the second threshold; determining a second grayscale image based on the second grayscale distribution and the third grayscale distribution; and identifying the target object based on the second grayscale image.

[0007] An embodiment of the present disclosure further provides an image processing device, comprising: a color scale distribution acquisition module, configured to: acquire a first color scale distribution corresponding to an input image, wherein the color scale range of the first color scale distribution is a first range; a range determination module, configured to: determine a second range and a third range other than the second range in the first range, wherein the third range includes a color scale range located on the left and / or right side of the second range; a color scale distribution optimization module, configured to: perform distribution stretching on the color scale distribution within the second range to obtain a second color scale distribution with a minimum color scale value being a first threshold and a maximum color scale value being a second threshold, and obtain a third color scale distribution based on the color scale distribution within the third range, wherein, when the third range includes a color scale range located on the left side of the second range, the color scale value of the color scale distribution within the third range located on the left side of the second range is set to the first threshold, and when the third range includes a color scale range located on the right side of the second range, the color scale value of the color scale distribution within the third range located on the right side of the second range is set to the second threshold; an image output module, configured to: determine an output image based on the second color scale distribution and the third color scale distribution.

[0008] The embodiment of the present disclosure also provides a device for identifying a target object, comprising: an image acquisition module, configured to: acquire a first grayscale image containing the target object; a grayscale distribution acquisition module, configured to: acquire a first grayscale distribution corresponding to the input first grayscale image, wherein the grayscale range of the first grayscale distribution is a first range; a range determination module, configured to: determine a second range and a third range other than the second range in the first range, wherein the third range includes a color scale range located on the left and / or right side of the second range; a grayscale distribution optimization module, configured to: perform distribution stretching on the grayscale distribution within the second range to obtain a grayscale minimum value being a first threshold value and a grayscale maximum value being a first threshold value. A second grayscale distribution of a second threshold value is obtained based on the grayscale distribution within the third range to obtain a third color scale distribution, wherein, when the third range includes a color scale range located on the left side of the second range, the color scale value of the grayscale distribution within the third range located on the left side of the second range is set to the first threshold, and when the third range includes a color scale range located on the right side of the second range, the color scale value of the grayscale distribution within the third range located on the right side of the second range is set to the second threshold; an image output module is configured to: output a second grayscale image based on the second grayscale distribution and the third grayscale distribution; a target recognition module is configured to: recognize the target object based on the second grayscale image.

[0009] An embodiment of the present disclosure further provides a computer program product, which includes computer software code. When the computer software code is executed by a processor, the above-mentioned method for image processing is provided.

[0010] An embodiment of the present disclosure further provides a computer-readable storage medium having computer-executable instructions stored thereon, and when the instructions are executed by a processor, the above-mentioned method for image processing is provided.

[0011] An embodiment of the present disclosure also provides a vehicle assisted driving system, including: an image acquisition module, configured to: acquire images of the vehicle's surroundings and / or interior, and use the images as input images for an image processing module; an image processing module, configured to: process the input images using the above-mentioned method for image processing to obtain an optimized output image; an image analysis module, configured to: determine the vehicle's assisted driving strategy based on the output image.

[0012] An embodiment of the present disclosure also provides a vehicle, which includes the above-mentioned vehicle assisted driving system.

[0013] The image processing method disclosed in the present invention can effectively improve the contrast of images with any color distribution, and reduce the complexity of image processing, thereby improving the speed of image processing. After the image is processed by the image processing method disclosed in the present invention, the light and dark contrast of the image can be improved, so that the outline and shape of the image are clearer, the color is more vivid and bright, thereby enhancing the layering of the picture, so that it is easier to obtain more accurate results when identifying the target object based on the processed image. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some exemplary embodiments of the present disclosure, and a person of ordinary skill in the art can obtain other drawings based on these drawings without creative work.

[0015] Herein, in the accompanying drawings:

[0016] Figure 1 is a schematic diagram illustrating a method for image processing according to an embodiment of the present disclosure;

[0017] Figure 2A-2D is a schematic diagram showing a color scale distribution according to an embodiment of the present disclosure;

[0018] Figure 3 is a schematic diagram illustrating a method for identifying a target object according to an embodiment of the present disclosure;

[0019] Figure 4A-4B is a schematic diagram showing an image to be processed and its color scale distribution according to an embodiment of the present disclosure;

[0020] Figure 4C-4D It shows that for Figure 4A-4B A schematic diagram of a processed image and its color scale distribution in the illustrated embodiment;

[0021] Figure 5 is a schematic diagram showing the composition of an image processing device according to an embodiment of the present disclosure;

[0022] Figure 6 is a schematic diagram showing the composition of an apparatus for identifying a target object according to an embodiment of the present disclosure;

[0023] Figure 7 is a schematic diagram showing the composition of a vehicle assisted driving system according to an embodiment of the present disclosure; and

[0024] Figure 8 is an illustration of an architecture of a computing device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present disclosure more obvious, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only 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 here.

[0026] Furthermore, in the present 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 description of these steps and elements will be omitted.

[0027] In addition, in this specification and the accompanying drawings, elements are described in singular or plural form, depending on the embodiment. However, the singular and plural forms are appropriately selected for the proposed situation only for the 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.

[0028] In addition, in this specification and the drawings, the terms "first / second" involved 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.

[0029] In addition, in this specification and the drawings, the terms "upper", "lower", "vertical", "horizontal", etc., which are used to refer to orientation or positional relationships, are only used to facilitate description of the embodiments according to the present disclosure, and are not intended to limit the present disclosure thereto. Therefore, they should not be understood as limiting the present disclosure.

[0030] 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.

[0031] To facilitate description of the present disclosure, concepts related to the present disclosure are introduced below.

[0032] Image processing technology is a technology that uses computers to process image information, mainly including image target detection, image enhancement and restoration, image data encoding, image segmentation and image recognition, etc. Among them, image enhancement methods include: histogram equalization, contrast enhancement, sharpening, noise removal, color enhancement, super-resolution reconstruction and color correction, etc.

[0033] Object detection is an important application in artificial intelligence. It involves identifying and locating a certain type of semantic object (such as a person, building, or car) in digital images and videos. Object detection is an important task in computer vision. It involves image segmentation, object tracking, key point detection and other technologies. It is widely used in many fields of modern life, such as security, military, transportation, medical and life. For example, the use of object detection technology can realize security monitoring, intelligent transportation, medical image analysis, unmanned driving, etc.

[0034] The basic process of target detection usually includes the following steps: first, image preprocessing, including noise removal, enhancement and other operations; second, feature extraction, using deep learning or other methods to extract features that can represent the target object from the image; then, classifier design, using training data to train the classifier to achieve recognition of different target objects; finally, target localization and bounding box regression to determine the position and size of the target object in the image.

[0035] In summary, the present disclosure relates to technologies such as image processing and target detection. The embodiments of the present disclosure will be further described below in conjunction with the accompanying drawings.

[0036] Figure 1 is a schematic diagram illustrating a method 100 for image processing according to an embodiment of the present disclosure.

[0037] It should be understood that the method 100 for image processing disclosed in the present invention can be used to achieve image enhancement in various application scenarios such as security monitoring, autonomous driving, traffic condition monitoring, drone scene analysis, robot vision, and medical image analysis.

[0038] In step S110, a first color scale distribution corresponding to the input image is obtained, wherein the color scale range of the first color scale distribution is a first range.

[0039] It should be understood that the image processing method 100 disclosed in the present invention can process both grayscale images and color images.

[0040] Specifically, according to an embodiment of the present disclosure, the input image may be a grayscale image, and the first color scale distribution may be a grayscale distribution (eg, a grayscale histogram).

[0041] According to another embodiment of the present disclosure, the input image may also be a color image. In this case, a distribution corresponding to a channel may be obtained for the input image, and the distribution corresponding to the channel may be used as the first color scale distribution (e.g., a color scale histogram of the channel), wherein the channel is one of a red channel, a green channel, and a blue channel.

[0042] It should be noted that the color level distribution in the present disclosure can be in the form of a color level histogram (for example, the horizontal axis represents the color level value, and the vertical axis represents the number of pixels corresponding to the color level value), or it can be a color level probability distribution (for example, the horizontal axis represents the color level value, and the vertical axis represents the probability corresponding to the color level value).

[0043] In step S120, a second range and a third range other than the second range are determined in the first range, wherein the third range includes a color scale range located on the left and / or right of the second range.

[0044] According to an embodiment of the present disclosure, the third range can be determined based on the product of the total number of pixels corresponding to the input image and a predetermined coefficient, wherein the number of pixels corresponding to the color scale distribution within the third range is not greater than the product of the total number of pixels corresponding to the input image and the predetermined coefficient.

[0045] It should be understood that the predetermined coefficient can be determined based on experience. Optionally, the predetermined coefficient can also be determined based on a neural network model. For example, an image sample in which the target object is displayed more clearly after processing can be used as a positive sample to train the neural network model to determine the model parameters. And based on the trained neural network model, a suitable value of the predetermined coefficient is determined so that the target object in the processed image is displayed more clearly.

[0046] Optionally, in the case that the third range includes color scale ranges located on the left and right sides of the second range at the same time, the first number of pixels can be determined based on the product of the total number of pixels corresponding to the input image and a first predetermined coefficient, and the fourth range located on the left side of the second range can be determined based on the first number of pixels, wherein the number of pixels corresponding to the color scale distribution within the fourth range is not greater than the first number of pixels; and / or the second number of pixels can be determined based on the product of the total number of pixels corresponding to the input image and a second predetermined coefficient, and the fifth range located on the right side of the second range can be determined based on the second number of pixels, wherein the number of pixels corresponding to the color scale distribution within the fifth range is not greater than the second number of pixels; wherein the third range includes the fourth range and the fifth range.

[0047] For example, assuming that the long side of the input image has M pixels and the wide side has N pixels, the total number of pixels corresponding to the input image is M*N. The first number of pixels M*N*C1 can be determined based on the product of the total number of pixels M*N corresponding to the input image and the first predetermined coefficient C1, and the number of pixels in the fourth range located on the left side of the second range is not greater than the first number of pixels M*N*C1. The second number of pixels M*N*C2 can be determined based on the product of the total number of pixels M*N corresponding to the input image and the second predetermined coefficient C2. The number of pixels in the fifth range located on the right side of the second range is not greater than the second number of pixels M*N*C2.

[0048] Optionally, in the case where the third range only includes the color scale range located on the left side of the second range, the third number of pixels can be determined based on the product of the total number of pixels corresponding to the input image and a third predetermined coefficient, and the third range located on the left side of the second range can be determined based on the third number of pixels, wherein the number of pixels corresponding to the color scale distribution within the third range is not greater than the third number of pixels. For example, assuming that the long side of the input image has M pixels and the wide side has N pixels, then the total number of pixels corresponding to the input image is M*N. The third number of pixels M*N*C3 can be determined based on the product of the total number of pixels M*N corresponding to the input image and a third predetermined coefficient C3, and the number of pixels in the third range located on the left side of the second range is not greater than the third number of pixels M*N*C3.

[0049] Optionally, in the case where the third range only includes the color scale range located on the right side of the second range, the fourth number of pixels can be determined based on the product of the total number of pixels corresponding to the input image and a fourth predetermined coefficient, and the third range located on the right side of the second range can be determined based on the fourth number of pixels, wherein the number of pixels corresponding to the color scale distribution within the third range is not greater than the fourth number of pixels. For example, assuming that the long side of the input image has M pixels and the wide side has N pixels, then the total number of pixels corresponding to the input image is M*N. The fourth number of pixels M*N*C4 can be determined based on the product of the total number of pixels M*N corresponding to the input image and a fourth predetermined coefficient C4, and the number of pixels in the third range located on the right side of the second range is not greater than the first number of pixels M*N*C4.

[0050] In step S130, the first color scale distribution within the second range is stretched to obtain a second color scale distribution whose minimum color scale value is a first threshold and whose maximum color scale value is a second threshold.

[0051] According to an embodiment of the present disclosure, the color scale value of the color scale distribution within the second range can be linearly transformed to obtain a second color scale distribution with a minimum color scale value being a first threshold and a maximum color scale value being a second threshold, wherein the first threshold is less than the minimum value of the second range and the second threshold is greater than the maximum value of the second range.

[0052] It should be understood that the distribution stretching based on linear transformation is used as an example here for explanation. In fact, the distribution stretching can also be implemented based on other methods (for example, through various functions that transform the second range into a sixth range, wherein the minimum value of the sixth range is the first threshold value and the maximum value is the second threshold value).

[0053] In step S140, a third color scale distribution is obtained based on the color scale distribution within the third range.

[0054] According to an embodiment of the present disclosure, when the third range includes a color scale range located on the left side of the second range, the color scale value of the color scale distribution within the third range located on the left side of the second range may be set to the first threshold; and when the third range includes a color scale range located on the right side of the second range, the color scale value of the color scale distribution within the third range located on the right side of the second range may be set to the second threshold.

[0055] It should be understood that in order to make the image resolution improvement effect as obvious as possible, the first threshold can be set to 0 and the second threshold can be set to 255. However, in fact, the first threshold can be any value less than the minimum value of the second range, and the second threshold can be any value greater than the maximum value of the second range.

[0056] According to an embodiment of the present disclosure, when the third range includes a color scale range located on the left side of the second range, the color scale value of the grayscale distribution within the third range located on the left side of the second range can be set to the third threshold; and when the third range includes a color scale range located on the right side of the second range, the color scale value of the grayscale distribution within the third range located on the right side of the second range can be set to the fourth threshold, wherein the third threshold is smaller than the first threshold and the fourth threshold is larger than the second threshold.

[0057] In step S150, an output image is determined based on the second color scale distribution and the third color scale distribution.

[0058] According to an embodiment of the present disclosure, when the input image is a color image, the distribution corresponding to the red channel can be used as the first color scale distribution to determine the first output image; the distribution corresponding to the green channel can be used as the first color scale distribution to determine the second output image; the distribution corresponding to the blue channel can be used as the first color scale distribution to determine the third output image. Then, the first output image, the second output image, and the third output image can be superimposed to determine an optimized color image.

[0059] According to an embodiment of the present disclosure, a synthesized color scale distribution may be obtained based on the second color scale distribution and the third color scale distribution, and the output image may be determined based on the synthesized color scale distribution.

[0060] Optionally, the synthesized color scale distribution may be further adjusted, and the output image may be determined based on the adjusted color scale distribution. For example, the brightness range of the synthesized color scale distribution may be adjusted (for example, if the synthesized color scale distribution is concentrated in the dark area (i.e., the corresponding image brightness is low), the synthesized color scale distribution may be adjusted as a whole to a brighter area to increase the brightness of the image; if the synthesized color scale distribution is concentrated in the bright area (i.e., the corresponding image brightness is high), the synthesized color scale distribution may be adjusted as a whole to a darker area to prevent the image from being overexposed), the noise of the synthesized color scale distribution may be adjusted (for example, denoising), and so on.

[0061] By processing an image using method 100, the contrast of an image with any color scale distribution can be effectively improved. That is, whether the color scale is distributed in the entire range of 0-255 or in other ranges between 0-255 (for example, the color scale is distributed in the range of 100-200), the contrast can be improved using the method disclosed in the present invention, while the traditional contrast improvement method can only improve the contrast of images with a color scale distribution between 0-255 (for example, the color scale is distributed in the range of 100-200), but cannot improve the contrast of images with a color scale distribution in the entire range of 0-255. Processing by method 100 can make the outline and shape of the image clearer, and the colors more vivid and colorful, thereby enhancing the layering of the picture. Furthermore, when the target object is identified based on the processed image, more accurate results can be obtained more easily.

[0062] Since the color scale value of the grayscale distribution within the third range is directly set to a predetermined value (for example, the first threshold or the second threshold) in step S140 of method 100 without further transformation processing of the color scale value of the grayscale distribution within the third range, method 100 can reduce the complexity of image processing and improve the speed of image processing while improving image contrast.

[0063] Figure 2Ais a schematic diagram showing a first color scale distribution corresponding to an input image according to an embodiment of the present disclosure.

[0064] like Figure 2A As shown, the minimum value of the first color scale distribution range of the input image is a, the maximum value is d, and the first color scale distribution range may also have color scale values ​​b and c, and satisfy 0 <a<b<c<d<255。

[0065] Optionally, the range between color levels b and c in the first range can be determined as the second color level range, and the range except the second range can be determined as the third range (i.e., the third range includes the fourth range between a and b and the fifth range between c and d).

[0066] According to an embodiment of the present disclosure, the first pixel number M*N*C1 can be determined based on the product of the total number of pixels corresponding to the input image (assuming that the long side of the input image has M pixels and the wide side has N pixels, then the total number of pixels corresponding to the input image is M*N) and a first predetermined coefficient C1 (for example, 4%), and the fourth range can be determined based on the first number of pixels, wherein the number of pixels corresponding to the color scale distribution within the fourth range is not greater than the first number of pixels. And the second pixel number M*N*C2 can be determined based on the product of the total number of pixels M*N corresponding to the input image and a second predetermined coefficient C2 (for example, 5%), and the fifth range can be determined based on the second number of pixels, wherein the number of pixels corresponding to the color scale distribution within the fifth range is not greater than the second number of pixels.

[0067] By stretching the first color scale distribution within the second range, a second color scale distribution with a minimum color scale value of 0 and a maximum color scale value of 255 can be obtained (eg Figure 2B shown).

[0068] By stretching the first color scale distribution within the second range (for example, it can be achieved through linear transformation, but not limited to this), the color scale distribution is no longer concentrated in the range between b and c, but distributed in a larger range between 0 and 255, thereby achieving contrast stretching.

[0069] At the same time, the color scale value of the color scale distribution in the fourth range can be set to 0, and the color scale value of the color scale distribution in the fifth range can be set to 255. Therefore, the color scale distribution in the third range (including the fourth range and the fifth range) is transformed into Figure 2C The color distribution shown.

[0070] That is, the transformation of the first color scale distribution can be achieved by the following formula:

[0071]

[0072] Among them, x represents the color scale value before transformation, and f(x) represents the color scale value after transformation.

[0073] By Figure 2B The color distribution and Figure 2C By superimposing the color distribution shown in Figure 2D The synthesized color scale distribution is shown. Further, an output image can be determined based on the synthesized color scale distribution. The contrast of the output image is improved compared with the above input image.

[0074] Figure 3 is a schematic diagram illustrating a method 300 for identifying a target object according to an embodiment of the present disclosure.

[0075] In step S310, a first grayscale image including the target object is acquired.

[0076] It should be understood that although target objects can also be identified based on color images, in the case where the color of the target object is not the focus of distinction, target identification based on grayscale images can further reduce the complexity of image processing and speed up image processing.

[0077] In step S320, a first grayscale distribution corresponding to the input first grayscale image is obtained, wherein the grayscale range of the first grayscale distribution is a first range.

[0078] According to an embodiment of the present disclosure, the grayscale distribution may be in the form of a grayscale histogram, that is, the abscissa of the grayscale histogram represents the grayscale value (eg, ranging from 0 to 255), and the ordinate represents the number of pixels corresponding to the grayscale value.

[0079] It should be understood that the grayscale distribution of an image may be distributed in the entire range of 0-255, or may be distributed in other ranges between 0-255 (for example, distributed in the range of 100-200). For images with grayscale distribution in any range, the method 300 can effectively improve the contrast of the image and more accurately identify the target object.

[0080] In step S330, a second range and a third range other than the second range are determined in the first range, wherein the third range includes a color scale range located on the left and / or right of the second range.

[0081] That is, the second range can be a low brightness range, a high brightness range, or a medium brightness range. When the second range is any of the above three ranges, the method 300 can effectively improve the contrast of the image and more accurately identify the target object.

[0082] In step S340, the grayscale distribution within the second range is stretched to obtain a second grayscale distribution whose minimum grayscale value is a first threshold and whose maximum grayscale value is a second threshold.

[0083] It should be understood that the first threshold should be smaller than the minimum value of the second range, and the second threshold should be larger than the maximum value of the second range.

[0084] In step S350, a third color scale distribution is obtained based on the grayscale distribution within the third range.

[0085] According to an embodiment of the present disclosure, when the third range includes a color scale range located on the left side of the second range, the color scale value of the grayscale distribution within the third range located on the left side of the second range can be set to the first threshold; and when the third range includes a color scale range located on the right side of the second range, the color scale value of the grayscale distribution within the third range located on the right side of the second range can be set to the second threshold.

[0086] In step S360, a second grayscale image is determined based on the second grayscale distribution and the third grayscale distribution.

[0087] For example, a synthesized grayscale distribution may be obtained based on the second grayscale distribution and the third grayscale distribution, and the second grayscale image may be determined based on the synthesized grayscale distribution.

[0088] It should be understood that Figure 3 The processing of steps S320 to S360 in Figure 1 Steps S110 to S150 are similar and will not be repeated here.

[0089] In step S370, the target object is identified based on the second grayscale image.

[0090] It should be understood that the process of identifying the target object can be implemented based on various target recognition methods. For example, the target recognition method can be implemented based on a neural network model. Optionally, the target object can be identified based on the second grayscale image based on a trained neural network model, and the recognition result of the target object can be displayed, which can include the position and size of the target object in the image (for example, it can be represented by a box at the position of the target object).

[0091] Figure 4A 2 is an image to be processed according to an embodiment of the present disclosure (here a grayscale image is taken as an example for explanation).

[0092] like Figure 4AAs shown in the figure, the camera on the vehicle captures the image of the garage, but because the entire image is gray, the difference between the garage line and the surrounding environment is close. Figure 4A If you use the computer to park, you will not be able to clearly identify the garage line, which may lead to misjudgment.

[0093] Figure 4B yes Figure 4A Schematic diagram of the color level distribution corresponding to the image shown (here the grayscale histogram is used as an example for explanation).

[0094] because Figure 4A The image shown is gray overall, so Figure 4B It can be seen that the grayscale values ​​of the pixels corresponding to the image shown in 4A are all concentrated in the middle.

[0095] pass Figure 1 The method shown is Figure 4B The grayscale histogram shown in FIG. 1 is processed to obtain a processed grayscale histogram (ie, Figure 4C shown).

[0096] pass Figure 4C It can be seen that for the processed grayscale histogram, the grayscale values ​​of the pixels can be distributed in a larger range. Figure 4C The processed image obtained is Figure 4D As shown. Figure 4A and Figure 4D It can be seen from the comparison that after processing, the contrast of the image is significantly improved, and the clarity of the garage line in the image is significantly increased. Therefore, based on the processed image, it is easier to perform operations such as parking, and misjudgment can be prevented, thereby improving driving safety.

[0097] Figure 5 FIG. 5 is a schematic diagram showing the composition of an image processing apparatus 500 according to an embodiment of the present disclosure.

[0098] According to an embodiment of the present disclosure, the image processing apparatus 500 may include: a tone scale distribution acquisition module 510 , a range determination module 520 , a tone scale distribution optimization module 530 , and an image output module 540 .

[0099] The image processing device 500 can process both grayscale images and color images.

[0100] Specifically, the color scale distribution acquisition module 510 may be configured to: acquire a first color scale distribution corresponding to the input image, wherein the color scale range of the first color scale distribution is a first range.

[0101] The range determination module 520 may be configured to: determine a second range and a third range other than the second range in the first range, wherein the third range includes a color scale range located on the left and / or right of the second range.

[0102] The color scale distribution optimization module 530 can be configured to: stretch the color scale distribution within the second range to obtain a second color scale distribution with a minimum color scale value being a first threshold and a maximum color scale value being a second threshold; obtain a third color scale distribution based on the color scale distribution within the third range, wherein, when the third range includes a color scale range located on the left side of the second range, the color scale value of the color scale distribution within the third range located on the left side of the second range is set to the first threshold, and when the third range includes a color scale range located on the right side of the second range, the color scale value of the color scale distribution within the third range located on the right side of the second range is set to the second threshold.

[0103] The image output module 540 may be configured to determine an output image based on the second color scale distribution and the third color scale distribution.

[0104] It should be understood that Figure 5 The image processing apparatus 500 shown can be implemented as for Figure 1 The various image processing methods described are not described in detail here. The image processing device 500 can be located on a server (for example, obtaining an input image sent by a user device via a network, and sending a processed output image to the user device), or on a user terminal (for example, obtaining an input image through a camera on the user device or obtaining an image in a memory of the user device as an input image, and providing the processed output image to a display of the user device).

[0105] Figure 6 is a schematic diagram showing the composition of an apparatus 600 for identifying a target object according to an embodiment of the present disclosure.

[0106] According to an embodiment of the present disclosure, the device 600 for identifying a target object may include: an image acquisition module 610 , a grayscale distribution acquisition module 620 , a range determination module 630 , a grayscale distribution optimization module 640 , an image output module 650 and a target recognition module 660 .

[0107] Specifically, the image acquisition module 610 may be configured to: acquire a first grayscale image containing the target object.

[0108] The grayscale distribution acquisition module 620 may be configured to: acquire a first grayscale distribution corresponding to the input first grayscale image, wherein a grayscale range of the first grayscale distribution is a first range.

[0109] The range determination module 630 may be configured to determine a second range and a third range other than the second range in the first range, wherein the third range includes a color scale range located on the left and / or right of the second range.

[0110] The grayscale distribution optimization module 640 can be configured to: stretch the grayscale distribution within the second range to obtain a second grayscale distribution with a minimum grayscale value of a first threshold and a maximum grayscale value of a second threshold, and obtain a third color scale distribution based on the grayscale distribution within the third range.

[0111] The image output module 650 may be configured to output a second grayscale image based on the second grayscale distribution and the third grayscale distribution.

[0112] The target recognition module 660 may be configured to recognize the target object based on the second grayscale image.

[0113] It should be noted that Figure 6 The device 600 for identifying a target object can be implemented as follows: Figure 3 The various image processing methods described are not described in detail here. The device 600 for identifying a target object can be located on a server or on a user terminal.

[0114] It should be understood that the image processing device 500 and the device for identifying the target object 600 can be deployed in scenarios such as security monitoring, autonomous driving, traffic condition monitoring, drone scene analysis, robot vision, and medical image analysis.

[0115] Figure 7 is a schematic diagram showing the composition of a vehicle assisted driving system 700 according to an embodiment of the present disclosure.

[0116] It should be understood that different types of vehicle assistance systems may be provided on a vehicle according to different application scenarios. For example, the vehicle assisted driving system 700 in the present disclosure may be either an automatic driving (AD) system of the vehicle or an assisted driving (AP) system of the vehicle, which may be used to implement functions such as automatic tracking, automatic parking, assisted parking, and line crossing alarm of the vehicle.

[0117] According to an embodiment of the present disclosure, the vehicle assisted driving system 700 may include: an image acquisition module 710 , an image processing module 720 and an image analysis module 730 .

[0118] Specifically, the image acquisition module 710 may be configured to acquire images of the surroundings and / or interior of the vehicle and use the images as input images of the image processing module.

[0119] It should be understood that the image acquisition module 710 can acquire images of the vehicle's surroundings (e.g., lane lines, front and rear vehicles, etc.) and / or images of the vehicle's interior (e.g., the driver, the dashboard, etc.) through a camera. For low-speed application scenarios and high-speed application scenarios, cameras with different performances can be selected.

[0120] Depending on the required performance, the image acquired by the image acquisition module 710 can be either a grayscale image or a color image.

[0121] The image processing module 720 may be configured to process the input image to obtain an optimized output image.

[0122] The image processing module 720 can Figure 1 Use any of the methods shown to process the image.

[0123] The image analysis module 730 may be configured to determine the assisted driving strategy of the vehicle based on the output image.

[0124] For example, the image analysis module 730 can provide automatic parking service when a garage is detected based on the output image. Alternatively, the image analysis module 730 can issue an alarm when it is recognized that the car is running into a lane line to remind the driver to pay attention.

[0125] By applying the method disclosed in the present invention to a vehicle assisted driving system on a vehicle, images around and / or inside the vehicle can be analyzed more accurately to provide more accurate assisted driving services, thus making it possible for the vehicle to become intelligent.

[0126] In general, various example embodiments of the present disclosure may be implemented in hardware or dedicated circuits, software, firmware, logic, or any combination thereof. Certain aspects may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device. When various aspects of the embodiments of the present disclosure are illustrated or described as block diagrams, flow charts, or using some other graphical representation, it will be understood that the blocks, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general purpose hardware or controllers or other computing devices, or some combination thereof as non-limiting examples.

[0127] For example, the method or device according to the embodiment of the present disclosure may also be implemented by Figure 8 The architecture of the computing device 3000 shown in FIG. Figure 8As shown, the computing device 3000 may include a bus 3010, one or more CPUs 3020, a read-only memory (ROM) 3030, a random access memory (RAM) 3040, a communication port 3050 connected to a network, an input / output component 3060, a hard disk 3070, etc. The storage device in the computing device 3000, such as the ROM 3030 or the hard disk 3070, may store various data or files used for processing and / or communication of the method provided in the present disclosure and program instructions executed by the CPU. The computing device 3000 may also include a user interface 3080. Of course, Figure 8 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 8 One or more components of a computing device are shown.

[0128] According to another aspect of the present disclosure, a computer-readable storage medium is also provided. Computer-readable instructions are stored on the computer storage medium. When the computer-readable instructions are executed by the processor, the method according to the embodiment of the present disclosure described with reference to the above figures can be executed. The computer-readable storage medium in the embodiment of the present disclosure can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of exemplary but not limiting description, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous connection dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM). It should be noted that memory of the methods described herein is intended to include, but is not limited to, these and any other suitable types of memory. It should be noted that memory of the methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0129] The embodiments of the present disclosure also provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method according to the embodiments of the present disclosure.

[0130] In summary, an embodiment of the present disclosure provides a method for image processing, including: obtaining a first color scale distribution corresponding to an input image, wherein the color scale range of the first color scale distribution is a first range; determining a second range and a third range other than the second range in the first range, wherein the third range includes a color scale range located on the left and / or right side of the second range; performing distribution stretching on the first color scale distribution within the second range to obtain a second color scale distribution with a minimum color scale value being a first threshold and a maximum color scale value being a second threshold; obtaining a third color scale distribution based on the color scale distribution within the third range, wherein, in a case where the third range includes a color scale range located on the left side of the second range, the color scale value of the color scale distribution within the third range located on the left side of the second range is set to the first threshold, and in a case where the third range includes a color scale range located on the right side of the second range, the color scale value of the color scale distribution within the third range located on the right side of the second range is set to the second threshold; and determining an output image based on the second color scale distribution and the third color scale distribution.

[0131] The image processing method disclosed in the present invention can effectively improve the contrast of images with any color distribution, and reduce the complexity of image processing, thereby improving the speed of image processing. After the image is processed by the image processing method disclosed in the present invention, the light and dark contrast of the image can be improved, so that the outline and shape of the image are clearer, the color is more vivid and bright, thereby enhancing the layering of the picture, so that it is easier to obtain more accurate results when identifying the target object based on the processed image.

[0132] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible 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, a program segment, or a part of a code, and the module, program segment, or a part of the code contains at least one executable instruction for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order 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 with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0133] The present disclosure uses specific words 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 related to at least one embodiment of the present disclosure. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more 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.

[0134] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the 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 extremely formal sense, unless explicitly defined as such herein.

[0135] The above is an explanation of the present invention and should not be considered as a limitation thereof. Although several exemplary embodiments of the present invention have been described, it will be readily appreciated 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 in the claims. It should be understood that the above is an explanation 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: Obtaining a first color scale distribution corresponding to an input image, wherein a color scale range of the first color scale distribution is a first range; Determine a second range and a third range other than the second range in the first range, wherein the third range includes a color scale range located on the left and / or right of the second range; Stretching the first color scale distribution within the second range to obtain a second color scale distribution whose minimum color scale value is a first threshold and whose maximum color scale value is a second threshold; A third color scale distribution is obtained based on the color scale distribution within the third range, wherein, when the third range includes a color scale range located on the left side of the second range, the color scale value of the color scale distribution within the third range located on the left side of the second range is set to the first threshold value, and when the third range includes a color scale range located on the right side of the second range, the color scale value of the color scale distribution within the third range located on the right side of the second range is set to the second threshold value; and An output image is determined based on the second color scale distribution and the third color scale distribution.

2. The method of claim 1, wherein: Determining a second range and a third range other than the second range in the first range includes: The third range is determined based on the product of the total number of pixels corresponding to the input image and a predetermined coefficient, wherein the number of pixels corresponding to the color scale distribution within the third range is not greater than the product of the total number of pixels corresponding to the input image and the predetermined coefficient.

3. The method of claim 2, wherein: In the case where the third range includes the color scale ranges located on the left and right sides of the second range, determining that the third range includes based on the product of the total number of pixels corresponding to the input image and a predetermined coefficient: Determine a first pixel number based on the product of the total number of pixels corresponding to the input image and a first predetermined coefficient, and determine a fourth range located on the left side of the second range based on the first pixel number, wherein the number of pixels corresponding to the color scale distribution within the fourth range is not greater than the first pixel number; and / or Determine a second number of pixels based on the product of the total number of pixels corresponding to the input image and a second predetermined coefficient, and determine a fifth range located on the right side of the second range based on the second number of pixels, wherein the number of pixels corresponding to the color scale distribution within the fifth range is not greater than the second number of pixels; Wherein, the third range includes the fourth range and the fifth range.

4. The method of claim 1, wherein: Stretching the color scale distribution within the second range to obtain a second color scale distribution with a minimum color scale value of a first threshold and a maximum color scale value of a second threshold includes: Performing a linear transformation on the color scale values ​​of the color scale distribution within the second range to obtain a second color scale distribution whose minimum color scale value is a first threshold value and whose maximum color scale value is a second threshold value, The first threshold is smaller than the minimum value of the second range, and the second threshold is larger than the maximum value of the second range.

5. The method of claim 1, wherein: The input image is a grayscale image, and the first color scale distribution, the second color scale distribution and the third color scale distribution are grayscale distributions.

6. The method of claim 1, wherein: The input image is a color image, Obtaining a first color scale distribution corresponding to the input image includes: A distribution corresponding to a channel is obtained for the input image, and the distribution corresponding to the channel is used as the first color scale distribution, wherein the channel is one of a red channel, a green channel, and a blue channel.

7. The method of claim 6, wherein: Using the distribution corresponding to the red channel as the first color scale distribution to determine a first output image; Using the distribution corresponding to the green channel as the first color scale distribution to determine the second output image; Using the distribution corresponding to the blue channel as the first color scale distribution to determine a third output image; The image processing method further includes: superimposing the first output image, the second output image, and the third output image to determine an optimized color image, The output images include the first output image, the second output image and the third output image.

8. The method of claim 1, wherein: Determining an output image based on the second color scale distribution and the third color scale distribution includes: Obtaining a synthesized color scale distribution based on the second color scale distribution and the third color scale distribution; and The output image is determined based on the synthesized color scale distribution, or the synthesized color scale distribution is adjusted and the output image is determined based on the adjusted color scale distribution, wherein adjusting the synthesized color scale distribution includes: adjusting at least one of the light and dark range of the synthesized color scale distribution and adjusting the noise of the synthesized color scale distribution.

9. A method for identifying a target object, comprising: Acquire a first grayscale image containing the target object; Acquire a first grayscale distribution corresponding to the input first grayscale image, wherein a grayscale range of the first grayscale distribution is a first range; Determine a second range and a third range other than the second range in the first range, wherein the third range includes a color scale range located on the left and / or right of the second range; Stretching the grayscale distribution within the second range to obtain a second grayscale distribution whose grayscale minimum value is a first threshold and whose grayscale maximum value is a second threshold; A third color scale distribution is obtained based on the grayscale distribution within the third range, wherein, when the third range includes a color scale range located on the left side of the second range, the color scale value of the grayscale distribution within the third range located on the left side of the second range is set to the first threshold value, and when the third range includes a color scale range located on the right side of the second range, the color scale value of the grayscale distribution within the third range located on the right side of the second range is set to the second threshold value; determining a second grayscale image based on the second grayscale distribution and the third grayscale distribution; The target object is identified based on the second grayscale image.

10. The method of claim 9, wherein: Determining a second range and a third range other than the second range in the first range includes: The third range is determined based on the product of the total number of pixels corresponding to the first grayscale image and a predetermined coefficient, wherein the number of pixels corresponding to the color scale distribution within the third range is not greater than the product of the total number of pixels corresponding to the input image and the predetermined coefficient.

11. The method of claim 10, wherein: In the case where the third range includes the color scale ranges located on the left and right of the second range, the third range is determined based on the product of the total number of pixels corresponding to the first grayscale image and a predetermined coefficient: Determine a first pixel number based on the product of the total number of pixels corresponding to the first grayscale image and a first predetermined coefficient, and determine a fourth range located on the left side of the second range based on the first pixel number, wherein the number of pixels corresponding to the color scale distribution within the fourth range is not greater than the first pixel number; Determine a second number of pixels based on the product of the total number of pixels corresponding to the first grayscale image and a second predetermined coefficient, and determine a fifth range located on the right side of the second range based on the second number of pixels, wherein the number of pixels corresponding to the color scale distribution within the fifth range is not greater than the second number of pixels; Wherein, the third range includes the fourth range and the fifth range.

12. An image processing device, comprising: The color scale distribution acquisition module is configured to: acquire a first color scale distribution corresponding to the input image, wherein the color scale range of the first color scale distribution is a first range; A range determination module is configured to: determine a second range and a third range other than the second range in the first range, wherein the third range includes a color scale range located on the left and / or right of the second range; The color distribution optimization module is configured as follows: Stretching the color scale distribution within the second range to obtain a second color scale distribution whose minimum color scale value is a first threshold and whose maximum color scale value is a second threshold; A third color scale distribution is obtained based on the color scale distribution within the third range, wherein, when the third range includes a color scale range located on the left side of the second range, the color scale value of the color scale distribution within the third range located on the left side of the second range is set as the first threshold value, and when the third range includes a color scale range located on the right side of the second range, the color scale value of the color scale distribution within the third range located on the right side of the second range is set as the second threshold value; The image output module is configured to determine an output image based on the second color scale distribution and the third color scale distribution.

13. A computer program product, comprising computer software code, which is used to implement the method according to any one of claims 1 to 11 when executed by a processor.

14. A computer-readable storage medium having computer-executable instructions stored thereon, wherein the instructions are used to implement the method according to any one of claims 1 to 11 when executed by a processor.

15. A vehicle assisted driving system, comprising: An image acquisition module is configured to: acquire an image of the surroundings and / or the interior of the vehicle, and use the image as an input image for the image processing module; An image processing module, configured to: process the input image by the method according to any one of claims 1 to 8 to obtain an optimized output image; The image analysis module is configured to determine the assisted driving strategy of the vehicle based on the output image.

16. A vehicle comprising the vehicle assisted driving system as claimed in claim 15.

Citation Information

Cited By

  • Road total element model rapid establishment method based on image recognition

    CN121435361A

  • Systems and methods for detecting support members of product storage structures at product storage facilities

    US12524902B2

  • Systems and methods for detecting support members of product storage structures at product storage facilities

    US20240257380A1