CN109819242B - Flare testing method and system and readable storage medium - Google Patents

Flare testing method and system and readable storage medium Download PDF

Info

Publication number
CN109819242B
CN109819242B CN201910020545.1A CN201910020545A CN109819242B CN 109819242 B CN109819242 B CN 109819242B CN 201910020545 A CN201910020545 A CN 201910020545A CN 109819242 B CN109819242 B CN 109819242B
Authority
CN
China
Prior art keywords
pixel
bright
dot matrix
area
matrix light
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
Application number
CN201910020545.1A
Other languages
Chinese (zh)
Other versions
CN109819242A (en
Inventor
林挺
李山萌
刘兴
郑怀玺
施士杰
樊劼
郑瑞建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Truly Opto Electronics Ltd
Original Assignee
Truly Opto Electronics Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Truly Opto Electronics Ltd filed Critical Truly Opto Electronics Ltd
Priority to CN201910020545.1A priority Critical patent/CN109819242B/en
Publication of CN109819242A publication Critical patent/CN109819242A/en
Application granted granted Critical
Publication of CN109819242B publication Critical patent/CN109819242B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)
  • Studio Devices (AREA)

Abstract

The invention discloses a flare testing method, which comprises the following steps: step 1: shooting a dot matrix light source by a camera to be detected to obtain a dot matrix light image; step 2: and calculating the farthest bright point distance value of each bright area in the acquired dot matrix light image. The flare test method can be used for carrying out flare test on the camera to be tested so as to screen qualified products and carry out quality control. The invention also discloses a flare testing system and a readable storage medium.

Description

Flare testing method and system and readable storage medium
Technical Field
The invention relates to the field of camera shooting, in particular to a flare testing method and system and a readable storage medium.
Background
When the camera to be measured shoots a light source or a strong light object, some halos, shadows or flare spots radiating outwards appear on the edge, and the halos and the flare spots are collectively called flare. The flare can seriously affect the quality of the image, so that the flare of the camera to be tested needs to be tested before leaving a factory so as to screen qualified products and control the quality.
Disclosure of Invention
In order to solve the defects of the prior art, the invention provides a flare testing method which can test the flare of a camera to be tested so as to screen qualified products and control quality.
The invention also provides a flare testing system and a readable storage medium.
The technical problem to be solved by the invention is realized by the following technical scheme:
a flare testing method, comprising:
step 1: shooting a dot matrix light source by a camera to be detected to obtain a dot matrix light image;
step 2: and calculating the farthest bright point distance value of each bright area in the acquired dot matrix light image.
Further, step 2 comprises:
step 2.1: calculating the neighborhood contrast of each pixel in the obtained dot matrix light image;
step 2.2: carrying out binarization on each pixel according to the neighborhood contrast of each pixel to obtain a binarized image;
step 2.3: and calculating the farthest bright point distance value of each binarized bright area in the acquired binarized image as the farthest bright point distance value of the corresponding bright area.
Further, step 2.1 comprises:
step 2.1.1: selecting a first area containing the pixel as a corresponding foreground of each pixel, selecting a second area containing the pixel as a corresponding background of each pixel, wherein the second area of the same pixel contains and is larger than the first area;
step 2.1.2: calculating a first average luminance value of the first region and a second average luminance value of the second region Y2 for each pixel;
step 2.1.3: calculating the neighborhood contrast of each pixel
Figure DEST_PATH_IMAGE001
Where (i, j) is the coordinate of each pixel, Ave _ Y1 is the pixel (i, j) corresponding to the first average luminance value, and Ave _ Y2 is the pixel (i, j) corresponding to the second average luminance value.
Further, in step 2.2, the neighborhood contrast of each pixel is compared with the preset contrast, if the neighborhood contrast is greater than the preset contrast, the brightness value of the corresponding pixel is set to 255, and if the neighborhood contrast is less than or equal to the preset contrast, the brightness value of the corresponding pixel is set to 0.
Further, step 2.3 comprises:
step 2.3.1: in the obtained binary image, calculating the distance value between each binary bright point and the centroid of the corresponding bright area;
step 2.3.2: and in the same binarization bright area, comparing the calculated distance values to obtain the maximum distance value as the farthest bright point distance value of the corresponding bright area.
Further, before performing step 2, the method further comprises:
in the acquired dot matrix light image, the centroid of each bright area is acquired.
Further, obtaining the centroid of each bright area comprises the following steps:
s1: extracting each bright area in the obtained dot matrix light image according to a preset brightness threshold value;
s2: and acquiring the centroids corresponding to the bright areas in the extracted bright areas.
Further, after step 2, the method further comprises:
and step 3: and if any farthest bright spot distance value is larger than the preset distance value, judging that the flare test of the camera to be tested is unqualified.
A flare test system comprising:
the dot matrix light source is used for shooting by the camera to be detected to obtain a dot matrix light image;
and the calculation module is used for processing the dot matrix light image acquired by the camera to be tested so as to carry out the step 2 in the flare testing method.
A readable storage medium storing a computer program for execution by a processor, wherein the computer program, when executed by the processor, performs step 2 of the flare testing method.
The invention has the following beneficial effects: according to the flare test method, a to-be-tested camera is shot towards the dot matrix light source to obtain a dot matrix light image for testing, the farthest bright point distance value of each bright area is calculated according to the dot matrix light image, the flare performance of the to-be-tested camera is measured according to the farthest bright point distance value, flare test is carried out on the to-be-tested camera, qualified products are screened, and quality control is carried out.
Drawings
FIG. 1 is a block diagram of the steps of a test method provided by the present invention;
FIG. 2 is a block diagram of step 2 of the test method shown in FIG. 1;
FIG. 3 is a schematic view of an acquired dot matrix light image;
FIG. 4 is a schematic diagram of foreground and background when calculating neighborhood contrast of a pixel;
FIG. 5 is a schematic diagram of an acquired binarized image;
FIG. 6 is a schematic front view of a lattice light source according to the present invention;
fig. 7 is a schematic side view of a dot matrix light source according to the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and examples.
Example one
As shown in fig. 1, a flare test method includes:
step 1: shooting a dot matrix light source by a camera to be detected to obtain a dot matrix light image;
in step 1, as shown in fig. 6 and 7, the dot matrix light source includes a substrate 11 and a plurality of dot light sources 12 disposed on one side of the substrate 11, and the plurality of dot light sources 12 are arranged in a uniform dot matrix manner on the substrate 11; the point light source 12 is preferably, but not limited to, an LED lamp. The other surface of the substrate 11 is provided with a driving module 13 for driving the switch of each point light source 12, and the output end of the driving module 13 is electrically connected to the input end of each point light source 12 through the circuit of the substrate 11.
As shown in fig. 3, the obtained dot matrix light image has a plurality of bright regions, the bright regions are arranged in a uniform dot matrix manner on the dot matrix light image, and one bright region corresponds to one dot light source on the dot matrix light source.
Step 2: calculating the farthest bright point distance value of each bright area in the acquired dot matrix light image;
in step 2, the farthest bright point distance value of each bright area refers to a distance value between each bright point farthest from the centroid of the bright area and the corresponding centroid.
Therefore, before performing step 2, the method further comprises:
in the acquired dot matrix light image, the centroid of each bright area is acquired.
The method for acquiring the centroid of each bright area comprises the following steps:
s1: extracting each bright area in the obtained dot matrix light image according to a preset brightness threshold value;
in step S1, the magnitude of the preset brightness threshold is manually set by the tester, and a larger value can be selected (in this embodiment, the preset brightness threshold = 200); in the acquired dot matrix light image, bright points with brightness values larger than a preset brightness threshold value are extracted and combined to form bright areas.
S2: acquiring the centroids corresponding to the bright areas in the extracted bright areas;
in step S2, a rectangular coordinate system ij is established with the i-axis as the horizontal axis and the j-axis as the vertical axis in the acquired dot matrix light image, coordinates (i, j) of each pixel are acquired, and the centroid coordinates of each bright area are calculated from the extracted coordinate values of each bright area.
As shown in fig. 2, the step 2 specifically includes:
step 2.1: calculating the neighborhood contrast of each pixel in the obtained dot matrix light image;
wherein the step 2.1 comprises:
step 2.1.1: as shown in fig. 4, for each pixel, a first region Y1 including the pixel is selected as its corresponding foreground, a second region Y2 including the pixel is selected as its corresponding background, and the second region Y2 of the same pixel includes and is larger than the first region Y1;
in step 2.1.1, in this embodiment, a region formed by 6 × 6 pixels is selected as the first region Y1 of each pixel, and a region formed by 30 × 30 pixels is selected as the second region Y2 of each pixel.
Step 2.1.2: calculating a first average luminance value Ave _ Y1 of the first region Y1 and a second average luminance value Ave _ Y1 of the second region Y2 of each pixel;
in step 2.1.2, a first average luminance value Ave _ Y1 is calculated according to the luminance values of all the pixels in the first area Y1, and a second average luminance value Ave _ Y2 is calculated according to the luminance values of all the pixels in the second area Y2.
Step 2.1.3: calculating the neighborhood contrast of each pixel
Figure 81585DEST_PATH_IMAGE001
Where (i, j) is the coordinate of each pixel, Ave _ Y1 is the pixel (i, j) corresponding to the first average luminance value, and Ave _ Y2 is the pixel (i, j) corresponding to the second average luminance value.
Step 2.2: carrying out binarization on each pixel according to the neighborhood contrast of each pixel to obtain a binarized image;
in step 2.2, the value of the preset contrast thres is preset by the inspector according to experience (in the embodiment, thres = 2.2), the neighborhood contrast of each pixel is compared with the preset contrast thres, if the neighborhood contrast is greater than the preset contrast thres, the brightness value of the corresponding pixel is set to 255, and if the neighborhood contrast is less than or equal to the preset contrast thres, the brightness value of the corresponding pixel is set to 0.
As shown in fig. 5, the obtained binarized image has a plurality of binarized bright regions, the plurality of binarized bright regions are arranged in a uniform lattice manner on the binarized image, and one binarized bright region corresponds to one bright region on the lattice light image.
Step 2.3: calculating the farthest bright point distance value of each binarized bright area in the obtained binarized image, and taking the farthest bright point distance value as the farthest bright point distance value of the corresponding bright area;
in step 2.3, before calculating the farthest bright point distance value, the discrete bright area in the binarized image is removed; and when the discrete bright area is removed, screening the binary bright area which accords with the 4-communication area or the 8-communication area in the binary image to be removed as the discrete bright area.
Similarly, the farthest bright point distance value of each binarized bright area refers to a distance value between each binarized bright point farthest from the centroid of the bright area corresponding to the located binarized bright area and the corresponding centroid.
Wherein the step 2.3 comprises:
step 2.3.1: in the obtained binary image, calculating the distance value between each binary bright point and the centroid of the corresponding bright area;
in this step 2.3.1, the distance value between each binarized bright point and the corresponding centroid is calculated from the coordinates of each binarized bright point and the centroid in the rectangular coordinate system ij.
Step 2.3.2: and in the same binarization bright area, comparing the calculated distance values to obtain the maximum distance value as the farthest bright point distance value of the corresponding bright area.
Further, after performing step 2, the method further includes:
and step 3: if any farthest bright spot distance value is larger than a preset distance value, judging that the flare test of the camera to be tested is unqualified;
in step 3, the preset distance value (140 pixels in this embodiment) needs to be determined according to the size of the light emitting area of each point light source on the dot matrix light source and the shooting distance of the camera to be measured.
According to the flare test method, a to-be-tested camera is shot towards the dot matrix light source to obtain a dot matrix light image for testing, the farthest bright point distance value of each bright area is calculated according to the dot matrix light image, the flare performance of the to-be-tested camera is measured according to the farthest bright point distance value, flare test is carried out on the to-be-tested camera, qualified products are screened, and quality control is carried out.
Example two
A flare test system comprising:
the dot matrix light source is used for shooting by the camera to be detected to obtain a dot matrix light image;
and the calculation module is used for processing the dot matrix light image acquired by the camera to be tested so as to perform step 2 in the flare test method in the first embodiment.
EXAMPLE III
A readable storage medium storing a computer program for execution by a processor, wherein the computer program performs step 2 of the flare testing method according to the first embodiment when the computer program is executed by the processor.
The above-mentioned embodiments only express the embodiments of the present invention, and the description is more specific and detailed, but not understood as the limitation of the patent scope of the present invention, but all the technical solutions obtained by using the equivalent substitution or the equivalent transformation should fall within the protection scope of the present invention.

Claims (8)

1. A flare test method, comprising:
step 1: shooting a dot matrix light source by a camera to be detected to obtain a dot matrix light image;
step 2: calculating the farthest bright point distance value of a bright area corresponding to each point light source on the dot matrix light source in the obtained dot matrix light image;
and step 3: comparing the distance value of each farthest bright spot with a preset distance value to judge whether the flare test of the camera to be tested is qualified or not;
wherein, step 2 includes:
step 2.1: calculating the neighborhood contrast of each pixel in the obtained dot matrix light image;
step 2.2: carrying out binarization on each pixel according to the neighborhood contrast of each pixel to obtain a binarized image;
step 2.3: calculating the farthest bright point distance value of each binarized bright area in the obtained binarized image, and taking the farthest bright point distance value as the farthest bright point distance value of the corresponding bright area;
wherein, step 2.3 includes:
step 2.3.1: in the obtained binary image, calculating the distance value between each binary bright point and the centroid of the corresponding bright area;
step 2.3.2: and in the same binarization bright area, comparing the calculated distance values to obtain the maximum distance value as the farthest bright point distance value of the corresponding bright area.
2. A flare test method according to claim 1, wherein step 2.1 comprises:
step 2.1.1: selecting a first area containing the pixel as a corresponding foreground of each pixel, selecting a second area containing the pixel as a corresponding background of each pixel, wherein the second area of the same pixel contains and is larger than the first area;
step 2.1.2: calculating a first average brightness value of the first area and a second average brightness value of the second area of each pixel;
step 2.1.3: calculating the neighborhood contrast of each pixel
Figure DEST_PATH_IMAGE002
Where (i, j) is the coordinate of each pixel, Ave _ Y1 is the pixel (i, j) corresponding to the first average luminance value, and Ave _ Y2 is the pixel (i, j) corresponding to the second average luminance value.
3. A flare test method according to claim 1, wherein in step 2.2, the neighborhood contrast of each pixel is compared with a preset contrast, if the neighborhood contrast is greater than the preset contrast, the brightness value of the corresponding pixel is set to 255, and if the neighborhood contrast is less than or equal to the preset contrast, the brightness value of the corresponding pixel is set to 0.
4. A flare test method according to any one of claims 1 to 3, further comprising, before performing step 2:
in the acquired dot matrix light image, the centroid of each bright area is acquired.
5. The flare test method of claim 4, wherein obtaining the centroid of each bright area comprises the steps of:
s1: extracting each bright area in the obtained dot matrix light image according to a preset brightness threshold value;
s2: and acquiring the centroids corresponding to the bright areas in the extracted bright areas.
6. A flare test method according to any one of claims 1 to 3, wherein in the step 3, if any farthest bright spot distance value is larger than a preset distance value, it is determined that the flare test of the camera to be tested is not qualified.
7. A flare test system, comprising:
the dot matrix light source is used for shooting by the camera to be detected to obtain a dot matrix light image;
a calculating module, configured to process the dot matrix light image obtained by the camera to be tested, so as to perform step 2 in the flare testing method according to any one of claims 1 to 6.
8. A readable storage medium storing a computer program for execution by a processor, wherein the computer program, when executed by the processor, performs step 2 of the flare test method of any one of claims 1-6.
CN201910020545.1A 2019-01-09 2019-01-09 Flare testing method and system and readable storage medium Active CN109819242B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910020545.1A CN109819242B (en) 2019-01-09 2019-01-09 Flare testing method and system and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910020545.1A CN109819242B (en) 2019-01-09 2019-01-09 Flare testing method and system and readable storage medium

Publications (2)

Publication Number Publication Date
CN109819242A CN109819242A (en) 2019-05-28
CN109819242B true CN109819242B (en) 2020-08-25

Family

ID=66603234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910020545.1A Active CN109819242B (en) 2019-01-09 2019-01-09 Flare testing method and system and readable storage medium

Country Status (1)

Country Link
CN (1) CN109819242B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111951322B (en) * 2020-07-16 2024-07-16 昆山丘钛光电科技有限公司 Image pickup module quality detection method, device and computer storage medium
CN111988604A (en) * 2020-08-19 2020-11-24 威海世高光电子有限公司 Flare automatic checking system
CN113473110B (en) * 2021-03-25 2024-04-16 广州得尔塔影像技术有限公司 Lens detection method and device and terminal equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201137509A (en) * 2010-04-30 2011-11-01 Hon Hai Prec Ind Co Ltd Lens flare testing device and method for testing lens flare
CN102937774A (en) * 2012-11-30 2013-02-20 信利光电(汕尾)有限公司 Lens module detecting device
CN106534841A (en) * 2016-11-10 2017-03-22 宁波舜宇车载光学技术有限公司 Lens detection method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100582932C (en) * 2007-04-02 2010-01-20 鸿富锦精密工业(深圳)有限公司 Apparatus and method for detecting camera module group dark angle

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201137509A (en) * 2010-04-30 2011-11-01 Hon Hai Prec Ind Co Ltd Lens flare testing device and method for testing lens flare
CN102937774A (en) * 2012-11-30 2013-02-20 信利光电(汕尾)有限公司 Lens module detecting device
CN106534841A (en) * 2016-11-10 2017-03-22 宁波舜宇车载光学技术有限公司 Lens detection method and device

Also Published As

Publication number Publication date
CN109819242A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN111246204B (en) Relative brightness deviation-based dirt detection method and device
CN109819242B (en) Flare testing method and system and readable storage medium
CN108280822B (en) Screen scratch detection method and device
KR101434484B1 (en) Apparatus and method for vision inspecting using image division
TWI758609B (en) Image generation device and image generation method
CN111210764B (en) LED screen correction method and correction device
US11288790B2 (en) Display panel inspection method and apparatus
CN112801948B (en) Method, system and storage medium for detecting board line defect of printed circuit board
CN112102762A (en) Method and device for identifying abnormal light points of LED screen
CN113781396A (en) Screen defect detection method, device, equipment and storage medium
CN112070762A (en) Mura defect detection method and device for liquid crystal panel, storage medium and terminal
CN104637425A (en) Assembly-line LED (light emitting diode) display unit uniformity detection method, system and device
CN111385447B (en) Image pickup apparatus and driving method thereof
WO2020135097A1 (en) Method and apparatus for channel switch detection of display terminal
WO2015015945A1 (en) Defect candidate specification device, defect candidate specification method, defect determination device, defect inspection device, defect candidate specification program, and recording medium
CN110956604B (en) Method and system for counting effective bonding area of bonding glue
CN105628195A (en) Light source brightness detecting system and method
KR101068356B1 (en) Method for inspecting defect of the Pixels in display panel device by image
CN117589770A (en) PCB patch board detection method, device, equipment and medium
CN109612408B (en) Method and device for testing emission angle of semiconductor laser and readable storage medium
CN116993654B (en) Camera module defect detection method, device, equipment, storage medium and product
WO2023060797A1 (en) Image processing method and device for semiconductor electron beam defect monitoring, and system
CN110148141A (en) A kind of silk-screen optical filter small pieces detection method of counting and equipment
CN117437170A (en) LED light source defect detection method and system
KR101383827B1 (en) System and method for automatic extraction of soldering regions in pcb

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Lin Ting

Inventor after: Li Shanmeng

Inventor after: Liu Xing

Inventor after: Zheng Huaixi

Inventor after: Shi Shijie

Inventor after: Fan Jie

Inventor after: Zheng Ruijian

Inventor before: Lin Ting

GR01 Patent grant
GR01 Patent grant