CN115474028B - Industrial camera color correction device and method - Google Patents
Industrial camera color correction device and method Download PDFInfo
- Publication number
- CN115474028B CN115474028B CN202211034858.0A CN202211034858A CN115474028B CN 115474028 B CN115474028 B CN 115474028B CN 202211034858 A CN202211034858 A CN 202211034858A CN 115474028 B CN115474028 B CN 115474028B
- Authority
- CN
- China
- Prior art keywords
- camera
- vector
- color
- correction
- light source
- 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
Classifications
-
- 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)
- Processing Of Color Television Signals (AREA)
- Color Television Image Signal Generators (AREA)
Abstract
The invention relates to an industrial camera color correction device and method, comprising a left light source, a back plate, a color card, a right light source, a bracket guide rail, a camera and a camera bracket; the backboard is vertically arranged, and the color card is arranged on the backboard; the left light source and the right light source are respectively arranged at the left side and the right side of the backboard, and the space brightness of the color card is ensured to be consistent as much as possible under the condition that the shooting of the camera is not influenced by the left light source and the right light source; the support guide rail is arranged right in front of the backboard and is perpendicular to the backboard; the camera support is arranged on the support guide rail and used for installing a camera and adjusting the distance between the camera and the color card, and the camera support can be compatible with cameras with different resolutions; the camera shoots vertical and horizontal color card images; the camera corrects the brightness of the image according to the vertical and horizontal color card images; the camera calculates a correction matrix according to the corrected image and the standard color card value.
Description
Technical Field
The invention relates to the technical field of color correction of industrial cameras, in particular to a color correction device and method of an industrial camera.
Background
The automatic optical detection is an effective detection method for industrial automation, uses machine vision with an industrial camera as a platform as a detection standard technology, and is widely applied to the manufacturing fields of printing and packaging quality control, PCB detection, rapid molding and the like. For example, the system collects image information on the surface of the printed matter through an industrial camera and a lens, and manages and controls the quality of the printed matter through image processing such as positioning, identification, classification and the like.
For industries such as medical treatment, apparel, printing, etc. where color requirements are high, the requirements for the quality of the acquired images of the digital visual components are also increasing. For industrial cameras, it is necessary to correct the output color of the camera to be consistent with a standard color chart before shipping or use. To ensure that the colors of different cameras are the same in shooting the same scene.
At present, a common calibration mode is mostly provided by a community manufacturer, the basic flow is basic, and on the premise that the brightness of the camera is consistent with the gray-scale brightness of a standard color card by adjusting the camera parameters, the captured 18 kinds of color RGB information are corrected to be corresponding RGB colors in the color card through a 3*3 color conversion matrix, so that no description is given on how to adjust and arrange shooting conditions.
For the precondition of correction, namely by adjusting camera parameters, an image with the brightness consistent with the gray-scale brightness of the standard color card is shot, and the actual operation is complicated. Because of the large number of factors affecting the brightness of the image, i.e., light source, exposure, gamma values, etc., especially the non-uniform brightness, the quality of the calibration color is seriously affected.
Disclosure of Invention
The invention provides an industrial camera color correction device, which comprises a left light source, a back plate, a color card, a right light source, a bracket guide rail, a camera and a camera bracket, wherein the left light source is arranged on the back plate;
the back plate is vertically arranged, and the color card is arranged on the back plate; the left light source and the right light source are respectively arranged at the left side and the right side of the backboard, and the space brightness of the color card is ensured to be consistent as much as possible under the condition that the shooting of a camera is not influenced by the left light source and the right light source;
the support guide rail is arranged right in front of the backboard and is perpendicular to the backboard; the camera support is arranged on the support guide rail and used for installing the camera and adjusting the distance from the camera to the color card, and the camera support can be compatible with cameras with different resolutions;
the camera shoots vertical and horizontal color card images;
the camera corrects the brightness of the image according to the vertical and horizontal color card images;
the camera calculates a correction matrix according to the corrected image and the standard color card value.
Also provided is an industrial camera color correction method comprising the steps of:
step 1, shooting vertical and horizontal color card images by using a device;
step 2, correcting the brightness of the image according to the vertical and horizontal color chart images;
and 3, calculating a correction matrix according to the corrected image and the standard color card value.
Further, in step 2, the method comprises the following steps:
step 21, generating a standard value vector according to the gray scale standard value of the color card;
step 22, gray scale and matrix region row-column coordinates of gray scale and matrix region row-column coordinates in the horizontal and vertical images of the color card are obtained;
step 23, calculating correction constants according to gray scales in the acquired horizontal and vertical images of the color card and row coordinates of matrix areas of the gray scales;
step 24, generating an image brightness correction plane according to the correction constant, the standard value vector, the gray scale and the matrix region row-column coordinates thereof;
and step 25, carrying out brightness correction on the image acquired by the camera to be tested.
Further, in step S21, a standard value vector Y is formed from light to dark according to the 6 gray-scale standard values of the 24 color chart.
Further, in step S22, the horizontal image captured by the camera to be tested is acquired from left to right according to the 6 gray levels of the lowest line of the color chart, and the horizontal image is bright from left to rightTo a dark grey value v 1 ~v 6 Component vector V 1 Acquiring the central row coordinate r of the matrix area 1 ~r 6 Column coordinate c 1 ~c 6 Forming a vector C;
the method comprises the steps of obtaining 6 gray scales of the rightmost column of a color card in a vertical image shot by a camera to be tested, and obtaining a gray value v from light to dark from top to bottom 7 ~v 12 Component vector V 2 Acquiring the central row coordinate r of the matrix area 7 ~r 12 Form vector R, column coordinate c 7 ~c 12 ;
Calculating a row average value R according to the vector C and the vector R coordinates avg And column average value c avg :
r avg C is the line average value avg Column average value.
Further, in step S23, the vector Y and the vector V are used for the following 1 And vector C, vector Y, vector V 2 And vector R, calculating a correction constant a in the following equation by using a least square method L ,γ L ,k 1 ,b 1 ,k 2 ,b 2 :
Wherein a is L Representing the brightness linear gain system, gamma L Representing the current Gamma value, k of the camera 1 Representing the brightness of the light source in the horizontal directionSlope of change, b 1 Represents the intercept, k of the change in brightness of the light source in the horizontal direction 2 Representing the slope of the light source brightness variation in the vertical direction, b 2 Representing the intercept of the light source brightness variation in the vertical direction.
Further, in step S24, the column average value c is calculated avg And constant k 1 ,b 1 Calculating a reference L of an image brightness correction plane 0 :
L 0 =k 1 ×c avg +b 1
Reference L 0 That is, when the image coordinates are (c avg ,r avg ) The brightness correction scale value at this point;
based on the mean value, constant k, of vector C and vector R 1 And k 2 Reference L 0 Establishing an image brightness correction plane:
L(x,y)=k 1 (x-c avg )+k 2 (y-r avg )+L 0
l (x, y) represents an image brightness correction plane.
Further, in step S25, brightness correction is performed on the image collected by the camera to be tested, and the corrected image is expressed as:
wherein P is x,y Representing the gray value of a pixel with x column coordinates and y row coordinates in the corrected image; i x,y The gray value of a pixel having a column coordinate x and a row coordinate y in the image before correction is shown.
The beneficial effects achieved by the invention are as follows:
the correction device provided by the invention utilizes the color card characteristics, eliminates the reasons such as light source arrangement through calculation, and avoids uneven brightness when a camera shoots the color card, thereby causing errors in color calibration.
The correction device provided by the invention realizes the adaptation of lenses with different resolutions and different focal lengths through fixed light sources, tracks and other devices.
The correction method provided by the invention realizes automation of the calibration process, simplifies the manual adjustment of parameters of devices such as camera exposure gamma, light source and the like, and improves the calibration efficiency.
Drawings
FIG. 1 is a front view of an industrial camera color correction device in accordance with an embodiment of the present invention;
FIG. 2 is a top view of an industrial camera color correction device in accordance with an embodiment of the present invention;
FIG. 3 is a flow chart of an industrial camera color correction method in an embodiment of the invention;
FIG. 4 is a schematic diagram of a horizontal color chart image in an industrial camera color correction method according to an embodiment of the present invention;
FIG. 5 is a schematic view of a vertical color chart image in an industrial camera color correction method according to an embodiment of the invention;
FIG. 6 is a schematic diagram of brightness correction in an industrial camera color correction method according to an embodiment of the invention;
fig. 7 is a schematic diagram of a corrected image in an industrial camera color correction method according to an embodiment of the present invention.
Detailed Description
The technical scheme of the present invention will be described in more detail with reference to the accompanying drawings, and the present invention includes, but is not limited to, the following examples.
As shown in fig. 1-2, the present invention proposes an industrial camera color correction device comprising a left light source 1, a back plate 2, a color card 3, a right light source 4, a bracket rail 5, a camera 6 and a camera bracket 7.
Wherein, the backboard 2 is vertically arranged, and the color card 3 is arranged on the backboard 2; the left light source 1 and the right light source 4 are respectively arranged at the left side and the right side of the backboard 2, and the left light source 1 and the right light source 4 ensure the consistency of the space brightness of the color card as much as possible under the condition that the shooting of a camera is not influenced.
The bracket guide rail 5 is arranged right in front of the backboard 2 and is arranged vertically to the backboard 2. The camera support 7 is arranged on the support guide rail 5 and is used for installing the camera 6 and adjusting the distance between the camera 6 and the color card 3, and the camera support 7 can be compatible with cameras with different resolutions.
The camera 6 is used for taking horizontal and vertical color chart pictures and correcting the camera colors according to the color chart information.
As shown in fig. 3, the invention provides an industrial camera color correction method, which comprises the following steps:
step 1, shooting vertical and horizontal color card images by using a device;
as shown in fig. 4-5, the white balance setting of the camera to be tested under the current light source is completed, and the color card is divided into horizontal and vertical parts and is placed in the center of the image for two times within the field of view of the camera to be tested, so that two images are shot.
Step 2, correcting the brightness of the image according to the vertical and horizontal color chart images;
the method specifically comprises the following steps:
step 21, generating a standard value vector according to the gray scale standard value of the color card;
according to the 6 gray-scale standard values of the 24 color card, a standard value vector Y is formed from light to dark, and the vector Y is expressed as {245,200,160,120,80,50}.
Step 22, gray scale and matrix region row-column coordinates of gray scale and matrix region row-column coordinates in the horizontal and vertical images of the color card are obtained;
acquiring a gray value v of a horizontal image according to 6 gray scales of the lowest line of a color card in the horizontal image shot by a camera to be detected 1 ~v 6 (from left to right, from light to dark) component vector V 1 Acquiring the central row coordinate r of the matrix area 1 ~r 6 Column coordinate c 1 ~c 6 And a vector C is composed.
The method comprises the steps of obtaining a gray value v of 6 gray scales of the rightmost column of a color card in a vertical image shot by a camera to be tested 7 ~v 12 (from top to bottom, from light to dark) composition vector V 2 Acquiring the central row coordinate r of the matrix area 7 ~r 12 Form vector R, column coordinate c 7 ~c 12 。
Calculating a row average value R according to the vector C and the vector R coordinates avg And column average value c avg :
Step 23, calculating correction constants according to gray scales in the acquired horizontal and vertical images of the color card and row coordinates of matrix areas of the gray scales;
according to vector Y, vector V 1 And vector C, vector Y, vector V 2 And vector R, calculating a correction constant a in the following equation by using a least square method L ,γ L ,k 1 ,b 1 ,k 2 ,b 2 The method comprises the steps of carrying out a first treatment on the surface of the Vector Y, vector V 1 And vector C is a vector with 6 values, 6 equations can be formed by using the 6 value band formulas, and a can be calculated by using a least square method L ,γ L ,k 1 ,b 1 ,k 2 ,b 2 :
Wherein a is L Representing the brightness linear gain system, gamma L Representing the current Gamma value, k of the camera 1 Represents the slope of the light source brightness change in the horizontal direction, b 1 Represents the intercept, k of the change in brightness of the light source in the horizontal direction 2 Representing the slope of the light source brightness variation in the vertical direction, b 2 Representing the intercept of the light source brightness variation in the vertical direction.
Step 24, generating an image brightness correction plane;
according to column average value c avg And constant k 1 ,b 1 Calculating a reference L of an image brightness correction plane 0 :
L 0 =k 1 ×c avg +b 1
Reference L 0 That is, when the image coordinates are (c avg ,r avg ) The brightness correction scale value at this point; if the illumination of the light source is absolutely uniform, the brightness is equal at different pixel coordinate positions, k 1 And k 2 Are all 0, L 0 Always equal to 1.
Based on the mean value, constant k, of vector C and vector R 1 And k 2 Reference L 0 Establishing an image brightness correction plane:
L(x,y)=k 1 (x-c avg )+k 2 (y-r avg )+L 0
step 25, carrying out brightness correction on the image acquired by the camera to be tested;
as shown in fig. 6, the corrected image is expressed as:
wherein P is x,y Representing the gray value of a pixel with x column coordinates and y row coordinates in the corrected image; i x,y The gray value of a pixel having a column coordinate x and a row coordinate y in the image before correction is shown.
Step 3, calculating a correction matrix according to the corrected image and the standard color card value;
as shown in fig. 7, according to the image after brightness correction, 18 color information in the color card and the color corresponding to the standard color card are extracted, and a color conversion matrix is calculated according to a conventional mode in the prior art; the image with brightness correction can meet the condition of consistent brightness, and the subsequent color correction process is a common calibration process in the prior art.
The present invention is not limited to the above embodiments, and those skilled in the art can implement the present invention in various other embodiments according to the examples and the disclosure of the drawings, so that the design of the present invention is simply changed or modified while adopting the design structure and concept of the present invention, and the present invention falls within the scope of protection.
Claims (8)
1. An industrial camera color correction device is characterized by comprising a left light source (1), a back plate (2), a color card (3), a right light source (4), a bracket guide rail (5), a camera (6) and a camera bracket (7);
the backboard (2) is vertically arranged, and the color card (3) is arranged on the backboard (2); the left light source (1) and the right light source (4) are respectively arranged at the left side and the right side of the backboard (2), and the left light source (1) and the right light source (4) ensure the consistent space brightness of the color card as far as possible under the condition that the shooting of a camera is not influenced;
the support guide rail (5) is arranged right in front of the backboard (2) and is perpendicular to the backboard (2); the camera support (7) is arranged on the support guide rail (5) and is used for installing the camera (6) and adjusting the distance between the camera (6) and the color card (3), and the camera support (7) can be compatible with cameras with different resolutions;
the camera (6) shoots vertical and horizontal color card images;
the camera (6) corrects the brightness of the image according to the vertical and horizontal color card images;
the camera (6) calculates a correction matrix from the corrected image and the standard color card values.
2. An industrial camera color correction method based on the industrial camera color correction device of claim 1, characterized in that the industrial camera color correction method comprises the steps of:
step 1, shooting vertical and horizontal color card images by using a device;
step 2, correcting the brightness of the image according to the vertical and horizontal color chart images;
and 3, calculating a correction matrix according to the corrected image and the standard color card value.
3. The industrial camera color correction method according to claim 2, characterized in that in step 2, it comprises the steps of:
step 21, generating a standard value vector according to the gray scale standard value of the color card;
step 22, gray scale and matrix region row-column coordinates of gray scale and matrix region row-column coordinates in the horizontal and vertical images of the color card are obtained;
step 23, calculating correction constants according to gray scales in the acquired horizontal and vertical images of the color card and row coordinates of matrix areas of the gray scales;
step 24, generating an image brightness correction plane according to the correction constant, the standard value vector, the gray scale and the matrix region row-column coordinates thereof;
and step 25, carrying out brightness correction on the image acquired by the camera to be tested.
4. The color correction method of industrial camera as claimed in claim 3, wherein in step S21, a standard value vector Y is formed from light to dark according to 6 gray-scale standard values of 24 color cards.
5. The method according to claim 4, wherein in step S22, the horizontal image is obtained from left to right according to the 6 gray levels of the lowest line of the color chart, and the gray level v is obtained from light to dark 1 ~v 6 Component vector V 1 Acquiring the central row coordinate r of the matrix area 1 ~r 6 Column coordinate c 1 ~c 6 Forming a vector C;
the method comprises the steps of obtaining 6 gray scales of the rightmost column of a color card in a vertical image shot by a camera to be tested, and obtaining a gray value v from light to dark from top to bottom 7 ~v 12 Component vector V 2 Acquiring the central row coordinate r of the matrix area 7 ~r 12 Form vector R, column coordinate c 7 ~c 12 ;
Calculating a row average value R according to the vector C and the vector R coordinates avg And column average value c avg :
r avg C is the line average value avg Column average value.
6. The method according to claim 5, wherein in step S23, the color correction is performed according to a vector Y, a vector V 1 And vector C, vector Y, vector V 2 And vector R, calculating a correction constant a in the following equation by using a least square method L ,γ L ,k 1 ,b 1 ,k 2 ,b 2 :
Wherein a is L Representing the brightness linear gain system, gamma L Representing the current Gamma value, k of the camera 1 Represents the slope of the light source brightness change in the horizontal direction, b 1 Represents the intercept, k of the change in brightness of the light source in the horizontal direction 2 Representing the slope of the light source brightness variation in the vertical direction, b 2 Representing the intercept of the light source brightness variation in the vertical direction.
7. The method according to claim 6, wherein in step S24, the column average value c is used avg And constant k 1 ,b 1 Calculating a reference L of an image brightness correction plane 0 :
L 0 =k 1 ×c avg +b 1
Reference L 0 That is, when the image coordinates are (c avg ,r avg ) The brightness correction scale value at this point;
based on the mean value, constant k, of vector C and vector R 1 And k 2 Reference L 0 Establishing an image brightness correction plane:
L(x,y)=k 1 (x-c avg )+k 2 (y-r avg )+L 0
l (x, y) represents an image brightness correction plane.
8. The method according to claim 7, wherein in step S25, brightness correction is performed on the image collected by the camera to be measured, and the corrected image is expressed as:
wherein P is x,y Representing the gray value of a pixel with x column coordinates and y row coordinates in the corrected image; i x,y The gray value of a pixel having a column coordinate x and a row coordinate y in the image before correction is shown.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211034858.0A CN115474028B (en) | 2022-08-26 | 2022-08-26 | Industrial camera color correction device and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211034858.0A CN115474028B (en) | 2022-08-26 | 2022-08-26 | Industrial camera color correction device and method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115474028A CN115474028A (en) | 2022-12-13 |
CN115474028B true CN115474028B (en) | 2023-10-17 |
Family
ID=84369119
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211034858.0A Active CN115474028B (en) | 2022-08-26 | 2022-08-26 | Industrial camera color correction device and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115474028B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101207832A (en) * | 2006-12-19 | 2008-06-25 | Tcl数码科技(深圳)有限责任公司 | Method for checking digital camera color reduction |
CN103905803A (en) * | 2014-03-18 | 2014-07-02 | 中国科学院国家天文台 | Image color correcting method and device |
WO2015166798A1 (en) * | 2014-04-28 | 2015-11-05 | コニカミノルタ株式会社 | Color measurement device and color measurement method |
CN106903076A (en) * | 2017-04-28 | 2017-06-30 | 安徽捷迅光电技术有限公司 | A kind of forming tea lens correction frock |
CN109348194A (en) * | 2018-11-23 | 2019-02-15 | 北京地平线机器人技术研发有限公司 | Acquire method, apparatus, image capture device and the electronic equipment of image data |
CN111861922A (en) * | 2020-07-21 | 2020-10-30 | 浙江大华技术股份有限公司 | Method and device for adjusting color correction matrix and storage medium |
CN113870146A (en) * | 2021-10-15 | 2021-12-31 | 中国大恒(集团)有限公司北京图像视觉技术分公司 | Method for correcting false color of image edge of color camera |
-
2022
- 2022-08-26 CN CN202211034858.0A patent/CN115474028B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101207832A (en) * | 2006-12-19 | 2008-06-25 | Tcl数码科技(深圳)有限责任公司 | Method for checking digital camera color reduction |
CN103905803A (en) * | 2014-03-18 | 2014-07-02 | 中国科学院国家天文台 | Image color correcting method and device |
WO2015166798A1 (en) * | 2014-04-28 | 2015-11-05 | コニカミノルタ株式会社 | Color measurement device and color measurement method |
CN106903076A (en) * | 2017-04-28 | 2017-06-30 | 安徽捷迅光电技术有限公司 | A kind of forming tea lens correction frock |
CN109348194A (en) * | 2018-11-23 | 2019-02-15 | 北京地平线机器人技术研发有限公司 | Acquire method, apparatus, image capture device and the electronic equipment of image data |
CN111861922A (en) * | 2020-07-21 | 2020-10-30 | 浙江大华技术股份有限公司 | Method and device for adjusting color correction matrix and storage medium |
CN113870146A (en) * | 2021-10-15 | 2021-12-31 | 中国大恒(集团)有限公司北京图像视觉技术分公司 | Method for correcting false color of image edge of color camera |
Non-Patent Citations (1)
Title |
---|
解读数码相机的色彩管理之法;沈志伟;;印刷技术(第11期);第39-41页 * |
Also Published As
Publication number | Publication date |
---|---|
CN115474028A (en) | 2022-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108682365B (en) | OLED color spot detection and repair integrated system and method | |
US7535511B2 (en) | Automatic exposure control method and automatic exposure compensation apparatus | |
CN107507558B (en) | Correction method of LED display screen | |
CN104217666B (en) | Image quality adjustment device, image correction circuit and display panel | |
CN112669394B (en) | Automatic calibration method for vision detection system | |
CN107256689B (en) | Uniformity repairing method for LED display screen after brightness correction | |
CN112848281B (en) | Light compensation method for photocuring 3D printer | |
CN111462693B (en) | Method and system for performing external optical compensation on AMOLED curved screen | |
CN115460386B (en) | Method and system for acquiring color image by black-and-white camera | |
CN114757853A (en) | Flat field correction function acquisition method and system and flat field correction method and system | |
CN115474028B (en) | Industrial camera color correction device and method | |
CN113870355A (en) | Flat field calibration method, flat field calibration device and flat field calibration system of camera | |
CN107635124B (en) | White balancing treatment method, device and the equipment of face shooting | |
CN108010071B (en) | System and method for measuring brightness distribution by using 3D depth measurement | |
CN114281274A (en) | Method for adjusting brightness uniformity, printing method, printing system and equipment | |
US20070053583A1 (en) | Image correcting apparatus, pattern inspection apparatus, and image correcting method, and reticle | |
CN111638042B (en) | DLP optical characteristic test analysis method | |
KR20060068497A (en) | Automatic correction method and apparatus for lens shading | |
CN114745538A (en) | Display screen visual angle and camera dark angle combined correction method and device | |
JP5609459B2 (en) | Binarization processing method and image processing apparatus | |
CN113870146B (en) | Correction method for false color of color camera image edge | |
CN112381896B (en) | Brightness correction method and system for microscopic image and computer equipment | |
CN114071109B (en) | Method for improving white balance instability and camera module | |
CN112333436A (en) | Two-dimensional calibration method of projector, projector and calibration system | |
CN113483655A (en) | PCB detection system and method |
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 |