CN108282620B - Image color correction method comprising traffic signal lamp - Google Patents
Image color correction method comprising traffic signal lamp Download PDFInfo
- Publication number
- CN108282620B CN108282620B CN201810156982.1A CN201810156982A CN108282620B CN 108282620 B CN108282620 B CN 108282620B CN 201810156982 A CN201810156982 A CN 201810156982A CN 108282620 B CN108282620 B CN 108282620B
- Authority
- CN
- China
- Prior art keywords
- gain
- pixel
- image
- amplification
- overflow
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000012937 correction Methods 0.000 title claims description 21
- 230000003321 amplification Effects 0.000 claims description 20
- 238000003199 nucleic acid amplification method Methods 0.000 claims description 20
- 238000006243 chemical reaction Methods 0.000 claims description 18
- 238000004364 calculation method Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 239000000306 component Substances 0.000 description 5
- 230000008859 change Effects 0.000 description 4
- 230000002238 attenuated effect Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000004040 coloring Methods 0.000 description 2
- 230000000670 limiting effect Effects 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 230000002829 reductive effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 239000008358 core component Substances 0.000 description 1
- 238000002845 discoloration Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 229910052736 halogen Inorganic materials 0.000 description 1
- 125000001475 halogen functional group Chemical group 0.000 description 1
- 150000002367 halogens Chemical class 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000036961 partial effect Effects 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000009897 systematic effect Effects 0.000 description 1
- 230000002087 whitening effect Effects 0.000 description 1
- 238000004383 yellowing Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/73—Circuitry for compensating brightness variation in the scene by influencing the exposure time
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/741—Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/77—Circuits for processing the brightness signal and the chrominance signal relative to each other, e.g. adjusting the phase of the brightness signal relative to the colour signal, correcting differential gain or differential phase
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a method for correcting the color of an image containing a traffic signal lamp, which comprises the following steps: and calculating a truncation coefficient for each pixel in the target image data, and adjusting each channel data through the truncation coefficient so that each channel data does not exceed the dynamic range after the gain is amplified. According to the invention, the original image is acquired by reducing the exposure time and simulating the gain, the color component proportion of each pixel is recorded, and the color component proportion of the overexposed pixel is kept unchanged when the digital gain of the image is increased, so that the problems of yellow and white red light caused by over-brightness of the red light are solved without affecting the overall brightness of the image.
Description
Technical Field
The invention relates to the field of image processing, in particular to a method for correcting images shot with red traffic signal lamps.
Background
The electronic police is a modern traffic law enforcement system for automatically recording traffic violations such as red light running, reverse running, overspeed running and the like of a motor vehicle by using a high-definition camera, and GA/T496-2009 general technical conditions of an automatic red light running recording system puts requirements on recording pictures of the electronic police system: the picture definition can meet the requirement of manual identification of the number plate of the vehicle, and the manual judgment of the red light signal cannot be influenced by color distortion such as whitening and halo of the red light signal. "
Traffic signal lamps can be generally classified into incandescent lamps, halogen lamps and Light Emitting Diodes (LEDs) according to the difference of light sources, and the LED traffic signal lamps are widely applied in recent years due to the advantages of low power consumption, high brightness, no flicker of direct current and the like. The industrial camera is used as a core component of an electronic police recording system, and due to the limitations of signal lamp brightness, external light, shooting angle, self dynamic range and the like, in the night shooting process, under the premise of not influencing the brightness of surrounding scenes, the red signal lamp is easy to yellow, whiten and even completely overflow, and because the brightness of the LED signal lamp does not change along with time, the brightness of the signal lamp at the moment of shooting cannot be changed by adopting a camera and a synchronous mode thereof.
At present, most of the conventional red light correction methods adopt an image processing algorithm for reducing the exposure time of a camera, changing the brightness of ambient light, or replacing a red light region. The method in which the ambient light brightness is changed by reducing the exposure time of the camera or by adding an optical structure suppresses the discoloration of the red light, but causes the ambient brightness to decrease at the same time, making it difficult to meet the requirements. However, the method of identifying the red light region and then coloring the region makes the red light region appear hard and lack of reality, as shown in fig. 1, the picture obtained by the processing method is a picture, and it can be seen from the picture that the signal lamp has been processed to be deformed, and such an image is processed in a later stage, so that the image is relatively natural and has obvious fake marks, and is not allowed to be used for punishing evidences in principle.
Disclosure of Invention
The applicant has made intensive studies with respect to the problems of the conventional signal lamp correction method. The applicant has found that the prior art methods of colour correction for traffic lights do not address the cause of the colour change of the signal, and indeed none of the prior art solutions has found a root cause of the colour change of the red signal. The processing mode in the prior art is based on the processing of the whole image, but the invention provides a correction mode based on the dynamic range of pixels in the image, and the problem of yellowing of a red signal lamp is solved microscopically.
The invention provides a color overflow unbalance correction method based on original image restoration, which increases the digital-to-analog conversion precision and furthest ensures the original color proportion information of an image by reducing the exposure time of an acquisition system. When the system digital gain is adopted to increase the overall brightness of the image, the color proportion of the red overexposure pixel points is ensured, and therefore the problem that the red signal lamp is over-bright to cause partial yellow and white is solved. Specifically, the invention provides an image color correction method comprising a traffic signal lamp, which is characterized by comprising the following steps: and calculating a truncation coefficient for each pixel in the target image data, and adjusting the data of each channel of each pixel through the truncation coefficient so that the data of each channel does not exceed the dynamic range after the gain is amplified.
In a preferred implementation, the method comprises the steps of:
step S1: acquiring an image with a traffic signal lamp shot by a sensor;
step S2: performing analog-to-digital conversion on the acquired image to obtain corresponding image data;
step S3: respectively acquiring R, G, B channel pixel values of each pixel in the image data;
step S4: judging whether the R channel pixel value has amplification overflow or not;
step S5: calculating a truncation coefficient in different cases based on the overflow condition judgment in step S4;
step S6: and (4) multiplying the R, G, B channel pixel value of each pixel point by different truncation coefficients for differential amplification.
In another preferred implementation, the method further comprises shortening an exposure time of a sensor used to photograph the traffic signal light.
In another preferred implementation, the method further comprises reducing an analog gain of the analog-to-digital conversion module.
In another preferred implementation, the method further performs the amplification overflow determination by:
if Pr>2N1, determining that amplification overflow exists; if Pr<=2N1, then it is determined that there is no amplification overflow, where: "Pr" represents the gray value of the red channel component of the pixel; "N" denotes D/A conversion accuracy(ii) a "Gain-number" indicates the Gain amplification factor.
In another preferred implementation, the method further performs truncation coefficient calculation by:
for the case of amplification overflow, P _ Gain is 2N/Pr;
For the case where there is no amplification overflow: p _ Gain < ═ Gain, where P _ Gain represents the digital Gain value of the current pixel.
In another preferred implementation, the traffic signal lamps include at least a red signal lamp.
In another preferred implementation, the method is performed by an FPGA.
Technical effects
The invention collects the original image by reducing the exposure time and the analog gain, records the color component proportion of each pixel, keeps the color component proportion of the overexposed pixel unchanged when the digital gain of the image is amplified, and solves the problems of yellow and white red light caused by over-brightness of the red light without influencing the overall brightness of the image.
Compared with the traditional red signal lamp correction method, the method starts from the source of color proportion unbalance caused by dynamic range attenuation, and solves the problem that the environmental brightness and the red light color cast cannot be combined together on the premise of not losing the overall brightness of the image by retaining the original image color proportion information, so that the red light information is more real, and the problem that a pure post-coloring picture cannot be used as law enforcement evidence is effectively solved.
Drawings
FIG. 1 is a diagram: in the prior art, a region replacement processing mode is adopted to process the processed image processing result;
FIG. 2 is a diagram of: a dynamic range chain of image acquisition and display processes;
FIG. 3 is a diagram of: the color channel ratio of the pixel;
FIG. 4 is a diagram of: color channel ratio after dynamic range decay;
FIG. 5 is a diagram: setting a red light correction link of the camera;
FIG. 6 is a diagram of: a corrected color channel ratio after dynamic range attenuation;
FIG. 7 is a diagram of: images that have not been corrected by the method of the invention;
FIG. 8 is a diagram of: the image is corrected by the color correction method of the invention.
Detailed Description
The invention is described in detail below with reference to the drawings and the embodiments thereof, but the scope of the invention is not limited thereto.
The principle of the traffic signal color correction method of the present invention and the specific process of the correction will be described in detail below.
1. Dynamic range attenuation
In the research and development process, the applicant notices that the scene is gradually attenuated in the dynamic range in the whole process from the collection to the display of the camera, and the dynamic range of the whole system is determined by a link with the lowest dynamic range, as shown in fig. 2. For an industrial camera, the dynamic range of each pixel value in the sensor is determined by the characteristics of the sensor, the dynamic range of the pixel after ADC conversion by the analog-to-digital conversion device depends on the sampling width (for example, 14-bit AD is adopted) and the analog gain, the dynamic range of the pixel of the image processing part depends on data interception caused by the digital gain, and the dynamic range of the pixel of the display part depends on the response characteristics of the display.
2. Red light color cast due to pixel dynamic range attenuation
As shown in fig. 3, the color channel value ratios of the three pixels P1, P2, and P3 in the figure are not attenuated by any dynamic range, and if the three pixels are attenuated by a series of dynamic ranges and then truncated from the positions of the dotted lines, the color channel value ratios of the three pixels are as shown in fig. 4, it can be seen that the two pixels P1 and P2 have serious color channel ratio imbalance, which indicates that the color change occurs in the image.
The reason for this is that the red signal light is: due to the attenuation of the dynamic range of pixels in the industrial camera, overflow cut-off occurs in a red channel in the attenuation process, so that the proportion of color channels is unbalanced, and the phenomenon of color cast of red light occurs.
3. Adjustment of exposure time, analog gain, and digital gain
In the dynamic range chain of fig. 2, in order to prevent the dynamic range attenuation after AD and further cause the color channel scale imbalance, so that each channel of the stage can fall below the dotted line of fig. 3, the applicant proposes a new systematic correction method from image acquisition and analog-to-digital conversion to gain amplification.
Specifically, applicants first adjust the exposure time for the image sensor to capture the image, i.e., shorten the exposure time of the image sensor to reduce the dynamic range attenuation of the pixels in the image sensor (sensor); for example, the exposure time is adjusted to 1ms or 500us
Then, when performing analog-to-digital conversion, the applicant adjusts the analog gain value of the analog-to-digital conversion module, that is, the analog gain value of the analog-to-digital conversion is reduced to reduce the attenuation of the dynamic range of the pixels in a digital-to-analog conversion (AD) link; for example, the analog gain value is set to 0DB (amplification factor of 1)
The digital image data output by the AD enters the red light correction module, and because the exposure time and the analog gain value of the sensor and the analog-to-digital conversion module are reduced, in order to ensure the image sharpness, the applicant adjusts the digital gain to compensate, that is, increases the digital gain to ensure the overall brightness of the image, but this will cause the dynamic range of the pixel of the stage of digital amplification to have a larger attenuation, so the applicant designs a new overexposure pixel processing mode at this stage to perform overexposure processing, as shown in fig. 5.
4. Correction process
(1) It is determined for each pixel whether there is magnification overflow of the red channel, e.g., whether the magnified pixel gray scale exceeds 4095 for a 12-bit digital image
Overflow condition: pr (Pr) of>2N/Gain-1
No overflow condition: pr (Pr) of<=2N/Gain-1
Wherein: pr-pixel red channel component gray value; n: D/A conversion precision; gain-digital Gain amplification. (Note: Gain is magnification factor, N is digital-to-analog conversion accuracy of digital image, for example, 12-bit image, N is 12)
(2) Calculating truncation coefficients
Overflow condition: p _ Gain 2N/Pr
No overflow condition: p _ Gain ═ Gain (normally set Gain)
Wherein: p _ Gain represents the digital Gain value of the current pixel
(3) Digital amplification process
Pr’=Pr*Gain
Pg’=Pg*Gain
Pb’=Pb*Gain
Wherein: pr ', Pg ', Pb ' -processed RGB component gray scale value of the pixel
Taking a 12-bit original image as an example, the 12-bit image needs to be amplified by 4 times and then output by 8 bits (i.e. 2-9 bit image data is taken), the processing method is to first determine whether the 12 red channel value of each pixel is greater than 1023, if so, the truncation coefficient is calculated:
p _ Gain is 4096/Pr, where Pr is the red channel value of the pixel.
If less than or equal to 1023, a truncation coefficient is calculated:
P_Gain=4;
and then, the green-blue channel numerical value of the same pixel point is multiplied by the truncation coefficient of the pixel point for distinguishing and amplifying, so that the overall brightness of the image is improved, the color channel proportion of the red light region is kept unchanged, and the original color is kept, as shown in fig. 6.
TS Intelligent industrial camera
Because the correction method of the invention has small calculation amount and good correction effect, in an ITS intelligent industrial camera, the correction method of the invention can be completed by using an FPGA, and images before and after correction are as shown in figures 7 and 8. The overall brightness of the images in both figures is comparable, but in fig. 8 the color information of the red light is well preserved. Although the color picture is converted into a gray image in consideration of the requirements for the drawings in the patent, it can be seen that the display effect of the red light region in fig. 8 is significantly better than that of fig. 7 even from the gray image.
The foregoing is considered as illustrative and not restrictive, and all changes that come within the spirit and scope of the invention are intended to be embraced therein.
While the principles of the invention have been described in detail in connection with the preferred embodiments thereof, it will be understood by those skilled in the art that the foregoing embodiments are merely illustrative of exemplary implementations of the invention and are not limiting of the scope of the invention. The details of the embodiments are not to be interpreted as limiting the scope of the invention, and any obvious changes, such as equivalent alterations, simple substitutions and the like, based on the technical solution of the invention, can be interpreted without departing from the spirit and scope of the invention.
Claims (2)
1. A method of color correcting an image containing a red traffic signal, the method comprising: calculating a truncation coefficient for each pixel in the target image data, and adjusting data of each channel of each pixel through the truncation coefficient so that the data of each channel does not exceed a dynamic range after gain after amplification, wherein the method comprises the following steps:
step S1: acquiring an image with a traffic light shot by a sensor, wherein the exposure time of the sensor for shooting the traffic light is shortened during shooting;
step S2: performing analog-to-digital conversion on the acquired image to acquire corresponding image data, and reducing analog gain of an analog-to-digital conversion module during analog-to-digital conversion;
step S3: respectively acquiring R, G, B channel pixel values of each pixel in the image data;
step S4: judging whether the R channel pixel value has amplification overflow or not;
step S5: calculating a truncation coefficient in different cases based on the overflow condition judgment in step S4;
step S6: multiplying the R, G, B channel pixel value of each pixel point by different truncation coefficients for distinguishing and amplifying;
the method also performs an amplification overflow determination by:
if Pr>2N1, determining that amplification overflow exists; if Pr<=2N1, then it is determined that there is no amplification overflow, where: "Pr" represents the gray value of the red channel component of the pixel; "N" denotes digital to analog conversion accuracy; "Gain" represents the Gain magnification;
the method also performs truncation coefficient calculation by:
for the case of amplification overflow, P _ Gain is 2N/Pr;
For the case where there is no amplification overflow: p _ Gain < ═ Gain, where P _ Gain represents the digital Gain value of the current pixel.
2. The image color correction method according to claim 1, characterized in that the method is performed by an FPGA.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810156982.1A CN108282620B (en) | 2018-02-24 | 2018-02-24 | Image color correction method comprising traffic signal lamp |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810156982.1A CN108282620B (en) | 2018-02-24 | 2018-02-24 | Image color correction method comprising traffic signal lamp |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108282620A CN108282620A (en) | 2018-07-13 |
CN108282620B true CN108282620B (en) | 2020-09-04 |
Family
ID=62808659
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810156982.1A Active CN108282620B (en) | 2018-02-24 | 2018-02-24 | Image color correction method comprising traffic signal lamp |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108282620B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111565283A (en) * | 2019-02-14 | 2020-08-21 | 初速度(苏州)科技有限公司 | Traffic light color identification method, correction method and device |
CN111935414B (en) * | 2019-05-13 | 2021-11-23 | 杭州海康威视数字技术股份有限公司 | Image acquisition method, light-emitting control method, related equipment and system |
CN113298066B (en) * | 2021-05-13 | 2022-04-05 | 广州文远知行科技有限公司 | Image acquisition control method and device, sensor and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101102438A (en) * | 2006-07-07 | 2008-01-09 | 帆宣系统科技股份有限公司 | Contrast stretching and overflow compensation system and method for image signal |
CN102663892A (en) * | 2012-05-29 | 2012-09-12 | 四川川大智胜软件股份有限公司 | Method for correcting discoloration and enlarging of red light in night red-light-running vehicle picture |
CN104036467A (en) * | 2014-06-18 | 2014-09-10 | 北京航空航天大学 | Image color cast correction method based on channel gain coefficient weighting |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4405942B2 (en) * | 2005-06-14 | 2010-01-27 | キヤノン株式会社 | Image processing apparatus and method |
-
2018
- 2018-02-24 CN CN201810156982.1A patent/CN108282620B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101102438A (en) * | 2006-07-07 | 2008-01-09 | 帆宣系统科技股份有限公司 | Contrast stretching and overflow compensation system and method for image signal |
CN102663892A (en) * | 2012-05-29 | 2012-09-12 | 四川川大智胜软件股份有限公司 | Method for correcting discoloration and enlarging of red light in night red-light-running vehicle picture |
CN104036467A (en) * | 2014-06-18 | 2014-09-10 | 北京航空航天大学 | Image color cast correction method based on channel gain coefficient weighting |
Also Published As
Publication number | Publication date |
---|---|
CN108282620A (en) | 2018-07-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112752023B (en) | Image adjusting method and device, electronic equipment and storage medium | |
TWI389559B (en) | Foreground image separation method | |
US7084907B2 (en) | Image-capturing device | |
CN108282620B (en) | Image color correction method comprising traffic signal lamp | |
CN109785240B (en) | A low-illuminance image enhancement method, device and image processing device | |
KR100478064B1 (en) | Illumination light color estimating method of obtaining white balance and image sensing apparatus | |
CN103391412B (en) | The method for displaying image of a kind of light-source brightness Automatic adjusument and device | |
CN100579243C (en) | A method and system for correcting white balance | |
CN1925559A (en) | Device and method for processing images | |
KR20190116077A (en) | Image processing | |
KR100967091B1 (en) | How to adjust the white balance of a digital imaging device | |
CN108282619B (en) | Image acquisition system with red light color correction function | |
JP4955235B2 (en) | Digital camera and gain calculation method | |
CN113822826A (en) | Low-illumination image brightness enhancement method | |
US11445127B2 (en) | Leveraging HDR sensors for handling mixed illumination auto white balance | |
US7336314B2 (en) | Image acquiring method and image acquiring apparatus | |
CN117197004B (en) | Low-illumination image optimization enhancement method and system | |
CN110086997A (en) | Facial image exposes luminance compensation method and device | |
CN112532872B (en) | Method and device for adjusting camera parameters, storage medium and electronic equipment | |
JP2000197070A (en) | White balance adjustment device | |
JP6196882B2 (en) | Multi-area white balance control device, multi-area white balance control method, multi-area white balance control program, computer recording multi-area white balance control program, multi-area white balance image processing device, multi-area white balance image processing method, multi-area White balance image processing program, computer recording multi-area white balance image processing program, and imaging apparatus provided with multi-area white balance image processing device | |
CN111050087B (en) | Infrared anti-overexposure method based on RGB statistical information and system and device thereof | |
CN115002356A (en) | Night vision method based on digital video photography | |
JP3466167B2 (en) | Light source color estimation method for white balance and imaging apparatus using the estimation method | |
JP2019040382A (en) | Image processing device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |