CN109163888A - Optical centre test method, device and equipment - Google Patents
Optical centre test method, device and equipment Download PDFInfo
- Publication number
- CN109163888A CN109163888A CN201810997883.6A CN201810997883A CN109163888A CN 109163888 A CN109163888 A CN 109163888A CN 201810997883 A CN201810997883 A CN 201810997883A CN 109163888 A CN109163888 A CN 109163888A
- Authority
- CN
- China
- Prior art keywords
- image
- value
- determining
- preset pixel
- pixel values
- 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.)
- Pending
Links
- 230000003287 optical effect Effects 0.000 title claims abstract description 74
- 238000010998 test method Methods 0.000 title abstract description 4
- 238000012360 testing method Methods 0.000 claims abstract description 71
- 238000000034 method Methods 0.000 claims abstract description 29
- 238000012545 processing Methods 0.000 claims description 26
- 238000006243 chemical reaction Methods 0.000 abstract 3
- 238000010586 diagram Methods 0.000 description 13
- 238000004590 computer program Methods 0.000 description 8
- 238000004519 manufacturing process Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 238000001514 detection method Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000001788 irregular Effects 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01M—TESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
- G01M11/00—Testing of optical apparatus; Testing structures by optical methods not otherwise provided for
- G01M11/02—Testing optical properties
- G01M11/0221—Testing optical properties by determining the optical axis or position of lenses
Landscapes
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Studio Devices (AREA)
Abstract
The embodiment of the present invention provides a kind of optical centre test method, device and equipment, this method comprises: determining the luminance threshold of the first image obtained by image capture device;Binary conversion treatment is carried out to obtain the second image to the first image based on the luminance threshold;Determine the column coordinate for having the quantity of presetted pixel value most in the multiple row of second image, determine the row coordinate for having the quantity of the presetted pixel value most in the multirow of second image, the presetted pixel value is a kind of pixel value after the binary conversion treatment;The optical centre of described image acquisition equipment is determined based on the column coordinate and the row coordinate.By test equipment to the simple binary conversion treatment of the first image, and the calculating of the quantity of presetted pixel value, so as to fast and accurately determine the coordinate of optical centre, may further quickly judge whether image capture device is qualified, can effectively promote test job efficiency.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device and equipment for testing an optical center.
Background
In the production process, the image acquisition equipment needs to carry out various quality detections so as to ensure that the products produced and delivered are good products. The optical center test is one of the test indexes.
In the prior art, taking a camera production test process as an example, when assembling a camera, assembling work is performed by using a jig and a standard operation method, and then an optical center is tested. The specific testing method comprises the steps of calculating based on an image matching algorithm, and matching an image acquired through a camera with an actual original image. The matching algorithm is complex, the calculated amount is large, and the testing efficiency is low. In other testing methods, a calibration jig is used for testing, images are acquired in real time through a camera, and whether the centers of the acquired images coincide with the center of an appointed acquired image is judged; the operation needs manual participation and is often low in testing efficiency.
Based on this, a solution for accurately and efficiently testing the optical center of the image capturing device is needed.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, and a device for testing an optical center, so as to improve efficiency and accuracy of testing the optical center of an image capturing device.
In a first aspect, an embodiment of the present invention provides an optical center testing method, including:
determining a brightness threshold of a first image acquired by an image acquisition device;
performing binarization processing on the first image based on the brightness threshold value to obtain a second image;
determining column coordinates with the largest number of preset pixel values in multiple columns of the second image, and determining row coordinates with the largest number of preset pixel values in multiple rows of the second image, wherein the preset pixel value is one pixel value after binarization processing;
determining an optical center of the image capture device based on the column coordinates and the row coordinates.
In a second aspect, an embodiment of the present invention provides an optical center testing apparatus, including:
the threshold value determining module is used for determining a brightness threshold value of a first image acquired by the image acquisition equipment;
a processing module, configured to perform binarization processing on the first image based on the brightness threshold value to obtain a second image;
a coordinate determination module, configured to determine a column coordinate with a largest number of preset pixel values in multiple columns of the second image, and determine a row coordinate with the largest number of preset pixel values in multiple rows of the second image, where the preset pixel value is a pixel value after the binarization processing;
a center determination module to determine an optical center of the image capture device based on the column coordinates and the row coordinates.
In a third aspect, an embodiment of the present invention provides a head optical center testing system, including:
the device comprises an image acquisition device and a uniform visible light plate arranged in front of the image acquisition device; wherein the distance between the uniform visible light plate and the image acquisition equipment is less than the focal length of the image acquisition equipment;
the image acquisition equipment is used for acquiring a first image based on the uniform visible light plate;
the uniform visible light plate is used for providing uniform visible light for the image acquisition equipment;
a test apparatus for employing the optical center testing method of the first aspect.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory is used to store one or more computer instructions, and when the one or more computer instructions are executed by the processor, the optical center testing method in the first aspect is implemented. The electronic device may also include a communication interface for communicating with other devices or a communication network.
An embodiment of the present invention provides a computer storage medium for storing a computer program, where the computer program is used to enable a computer to implement the optical center testing method in the first aspect when executed.
According to the optical center testing method provided by the embodiment of the invention, the image acquisition equipment acquires the first image by matching with the uniform visible light plate, and determines the brightness average value of the first image as the brightness threshold, wherein the central point of the image is known. Further, the first image is subjected to binarization processing based on a brightness threshold value, and a second image is obtained. And determining the optical center of the image acquisition equipment according to the number of pixel points with preset pixel values in the second image. Through simple binarization processing of the test equipment on the image and calculation of the number of the pixel points of the preset pixel value, the coordinate of the optical center can be quickly and accurately determined, and the test work efficiency can be effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for testing an optical center according to an embodiment of the present invention;
fig. 2a is a schematic diagram of an image capturing device according to an embodiment of the present invention displaying a first image;
FIG. 2b is a schematic diagram of a second image processed based on the first image according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of obtaining an average brightness value of a first image according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an optical center testing apparatus according to an embodiment of the present invention;
FIG. 5 is a flow chart of an optical center testing system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device corresponding to the optical center testing apparatus provided in the embodiment shown in fig. 4.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, and "a" and "an" generally include at least two, but do not exclude at least one, unless the context clearly dictates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
In addition, the sequence of steps in each method embodiment described below is only an example and is not strictly limited.
Before describing the optical center testing method provided by the embodiment of the present invention, some concepts and basic principles of coordinate determination involved in the following embodiments will be described.
The optical center test is used for testing the imaging performance of the image acquisition equipment in the production process of the image acquisition equipment. The image capturing device may be a camera, a video recorder, a mobile phone with a video recording function, or the like. The optical center testing method can be applied to production workshops of image acquisition equipment such as cameras and the like, and can also be applied to laboratories for testing optical centers. If the method is applied to a production workshop, the specific test method can be adjusted according to the product test requirements.
The preset pixel value is defined according to the test requirement, and may be, for example, a pixel with a pixel value of 255; of course, other pixel values may be defined as the predetermined pixel value according to the requirement.
It should be noted that, when determining the coordinates based on the present disclosure, the coordinates may be a coordinate system (e.g., a rectangular plane coordinate system) established according to the first image. The first image and the second image have the same rectangular coordinate system, and the sizes of the two images are completely consistent; therefore, the image center of the first image is also the same as the image center of the second image.
Fig. 1 is a flowchart of an optical center testing method according to an embodiment of the present invention, where the optical center testing method in this embodiment may be executed by an optical center testing apparatus, and the optical center testing apparatus may be mainly used for a camera or an image capturing device with a camera. As shown in fig. 1, the method comprises the steps of:
step S102: a brightness threshold of a first image acquired by an image acquisition device is determined.
In practical applications, if the optical center of the current image capturing device needs to be tested, the first image needs to be acquired by the image capturing device. In order to be able to carry out an accurate test, it is necessary to first determine the image center of the first image, and during the test, align the uniform visible light plate with the image acquisition device, specifically, align the center of the visible light plate with the center of the lens of the image acquisition device. For more efficient testing, the visible light panel and the image acquisition device can be mounted on a special test fixture.
The first image is an image generated by the image acquisition device acquiring a uniform visible light plate. It should be noted that the brightness of the center of the image of the first image is greater than the brightness of the periphery of the image. In the first image, actual pixel values of pixel points corresponding to different brightness are different. The luminance threshold as referred to herein is understood to be a reference pixel value used for processing a picture.
Step S104: and carrying out binarization processing on the first image based on the brightness threshold value to obtain a second image.
The second image is obtained by the first image through binarization processing, as shown in fig. 2a and 2b, but the size and display scale of the image are not changed; in other words, the image center of the first image is identical to the image center of the second image.
In the obtained second image, under an ideal condition, a graph formed by pixel points corresponding to the preset pixel values is a circle formed based on the center of the image. Certainly, due to the assembly process of the camera, the graph formed by the preset pixel values in the second image is deformed and becomes an oval or other irregular graph; typically, the center of the image is covered by the irregular pattern or ellipse.
The predetermined pixel values are defined artificially to distinguish different pixel values of the pixels in the second image.
Step S106: and determining column coordinates with the largest number of preset pixel values in multiple columns of the second image, and determining row coordinates with the largest number of preset pixel values in multiple rows of the second image, wherein the preset pixel value is one pixel value after binarization processing.
As can be seen from the foregoing description and the accompanying fig. 2a and 2b in the specification, the pattern formed by the preset pixel values in the second image is smaller than the size of the second image, and the pattern formed by the preset pixel values has a relatively obvious boundary line. It should be noted that, if there is a pixel point with a non-preset pixel value in the graph formed by the preset pixel values and the border line of the graph formed by the pixel point and the preset pixel values is not connected, the pixel point with the non-preset pixel value may be defaulted as the preset pixel value, and when the number of the pixel points with the preset pixel value is counted, the pixel points with the non-preset pixel value may be counted as the pixel points conforming to the preset pixel value.
According to practical test application, the closer the optical center point and the image center is, the better the assembly performance of the image acquisition equipment is; therefore, the distance between the optical center and the image center can be used as an evaluation criterion for testing the quality of the image acquisition equipment product in the production process of the image acquisition equipment.
In practical applications, there are many methods for measuring the optical center, for example, the optical center can be determined by measuring the optical axis, and the optical center can also be determined by detecting the optical axis. However, the prior art needs many devices and complicated calculation for measuring the optical center. Therefore, the present application proposes a relatively simple way of confirming the optical center position, that is, taking the intersection of the abscissa and the ordinate of the pixel having the maximum preset pixel value as the optical center.
It should be noted that, the abscissa or ordinate where the number of pixels corresponding to the preset pixel value is the largest may have a plurality of abscissas or ordinates having the same number of pixels and the largest number of pixels corresponding to the preset pixel value. If the odd number of the same horizontal coordinates or vertical coordinates exist, selecting the middle one; if there are an even number of identical abscissas or ordinates, one is selected from the middle two.
In one or more embodiments of the present disclosure, the determining a brightness threshold of the first image acquired by the image acquisition device may specifically include: determining a brightness average value of the first image acquired by an image acquisition device; the luminance average value is used for processing the luminance threshold value.
It should be noted that the luminance threshold value obtained here is required for processing the image at a later stage. The brightness threshold values required to be obtained by different image processing modes are different, and the brightness threshold values are obtained by different modes. For example, binarization is adopted in the image processing method in this embodiment; of course, the graying process may be performed first, and then the binarization process may be performed; or, the graying treatment is directly carried out under the condition that the test condition is better (after graying, the target image has a clear boundary line); the method for determining the brightness threshold by binarization may be various, for example, the brightness threshold may be set manually according to experience, or may be determined according to an actually measured display effect. In the embodiment of the present application, the average value of the luminance of the image is used as the luminance threshold value and the image processing is performed on a sub-basis.
In one or more embodiments of the present specification, the determining a luminance average value of the first image acquired by the image acquisition device may specifically include: acquiring a brightness value YA of each side of the first image and a brightness value YB of the center of the first image; based on the luminance value YA and the luminance value YB, the luminance average value is calculated by using the following formula: y ═ C + YA (YB-YA); wherein C is an adjustment coefficient, and Y is the brightness average value.
As shown in fig. 3, in order to obtain an average value of the luminance of the first image formed based on the uniform visible light panel, the luminance values of the four frames and the central position of the first image may be measured, respectively. Specifically, the center position Block B and the four frame positions Block a1 to a4 having the same size are extracted from the corresponding positions in the first image, and the average luminance value (YB) of B may be obtained (may be obtained by averaging a plurality of measurements) or may be obtained only once, for example, by 1/6 the width and height of the image. Further, the average luminance value (YA) is calculated from the average luminance values of four blocks a around. There are many ways to obtain the average values YA and YB, and they will not be described in detail here. And finally, calculating the brightness average value of the actual first image based on YA and YB according to the actual production work experience, wherein the specific formula is as follows:
y ═ C + YA (YB-YA); wherein C is an adjustment coefficient, and Y is a brightness average value.
The average value Y of the luminance obtained based on the above formula is larger than YB and smaller than YA so that a second image in which the difference between the central and peripheral luminance values of the first image can be clearly distinguished can be obtained. Therefore, it is necessary to define the coefficient C as a range larger than zero and smaller than 1, for example, the coefficient C may be 0.4.
It is easy to understand that the pixel values of the pixels in the image range from 0 to 255, in this embodiment, it is assumed that the preset pixel value is defined as 255, and correspondingly, the pixel values of other pixels are defined as 0. In order to easily distinguish the pixel points with preset pixel values from the pixel points with other pixel values, a binarization mode is adopted, that is, a point larger than a brightness threshold is defined as 255, and a pixel point smaller than the brightness threshold is defined as 0; so that the first image after the binarization processing (i.e., the second image in the subsequent embodiments) can have a distinct boundary, thereby facilitating quick and accurate determination of the position of the optical center.
In one or more embodiments of the present specification, the determining of the row coordinate having the largest preset pixel value among the plurality of rows of the second image may include:
for any row in the second image, determining a preset pixel value with a maximum abscissa value and a minimum abscissa value from the preset pixel values contained in the any row;
determining the number of the preset pixel values contained in any one row according to the maximum abscissa value and the minimum abscissa value;
and determining the row coordinate with the maximum preset pixel value in the plurality of rows of the second image according to the number of the preset pixel values respectively corresponding to the plurality of rows of the second image.
As shown in fig. 2b, the pixels in the second image with the predetermined pixel values form an intermediate elliptical pattern. In practical application, coordinate statistics can be performed row by row, specifically, a maximum abscissa value and a minimum abscissa value of a position where a preset pixel value is located in each row are counted row by row. It is easy to understand that each pixel point corresponds to a group of abscissa and ordinate points, and therefore, the difference between the maximum abscissa and the minimum abscissa is the number of pixel points of the preset pixel value in the row.
After the number of the pixel points with the preset pixel values in each row is obtained, the number of the preset pixel values in each row is compared, so that the row coordinate with the maximum number of the preset pixel values is determined.
In one or more embodiments of the present specification, the determining column coordinates having the largest preset pixel value among the plurality of columns of the second image may include:
for any column in the second image, determining a preset pixel value with a maximum abscissa value and a minimum abscissa value from the preset pixel values contained in the any column;
determining the number of the preset pixel values contained in any one column according to the maximum abscissa value and the minimum abscissa value;
and determining the column coordinates with the maximum preset pixel values in the multiple columns of the second image according to the number of the preset pixel values respectively corresponding to the multiple columns of the second image.
As shown in fig. 2b, in practical applications, the coordinate statistics may be performed column by column, specifically, the maximum ordinate value and the minimum ordinate value of the position where the preset pixel value is located in each column are counted column by column. It is easy to understand that each pixel point corresponds to a group of abscissa and ordinate points, and therefore, the difference value between the maximum ordinate and the minimum ordinate is the number of pixel points of the preset pixel value in the row.
After the number of the pixels with the preset pixel values in each column is obtained, the number of the preset pixel values in each column is compared, so that the column coordinate with the largest number of the preset pixel values is determined.
To facilitate understanding of the above technical solution for obtaining row-column coordinates, the following description specifically illustrates that, the minimum value of the abscissa corresponding to the Ya-th row is Xa1, the maximum value of the abscissa is Xa2, and the difference value of the corresponding abscissa is δYa=|Xa1-Xa2L, |; the Yb-th line has an abscissa minimum value Xb1, an abscissa maximum value Xb2, and a corresponding abscissa difference value δYb=|Xb1-Xb2L, |; after obtaining the horizontal coordinate difference values of the pixels with the preset pixel values in each row, sorting all the difference values, for example, a bubble sorting method may be adopted; the row with the largest difference, and the corresponding row coordinate (i.e., ordinate) value, may thus be determined. Similarly, in order to obtain the column with the largest difference value, and the corresponding column coordinate (i.e., abscissa) value.
It should be noted that, if there is no pixel having a predetermined pixel value in a certain row or a certain column, the difference is zero. To improve the sorting efficiency, rows or columns with a difference of zero may not participate in bubble sorting.
In practical application, besides the above method for counting the number of the pixels with the preset pixel values based on the coordinates, the method can also directly count the number, for example:
in practical application, as shown in fig. 2b, when the first image is binarized to obtain the second image, how many preset pixel values are respectively in each row or each column can be known, and the number of pixel points of the preset pixel values in each row or each column can be obtained first; further, the statistical quantities in each row and each column are compared respectively, so as to screen out the maximum quantity value, and the corresponding row coordinate Y1 and column coordinate X1 are determined. The statistical method is relatively direct and has high efficiency.
In one or more embodiments of the present description, after determining the optical center based on the column coordinates and the row coordinates, the method may further include: calculating a distance of the optical center from the image center based on the image center coordinates (X0, Y0), and optical center coordinates (X1, Y1) of the second image or first image; and judging whether the image acquisition equipment is qualified or not according to a preset test threshold value and the distance.
As can be seen from the foregoing, the sizes of the first image and the second image are identical, and therefore, the centers of the images are also identical. When the test threshold is set, the test threshold can be set according to the product factory test specification requirement or the product grade.
In calculating the distance between the optical center and the image center, i.e., calculating the distance between (X0, Y0) and (X1, Y1), it is necessary to ensure that the first image and the second image are established in exactly the same coordinate system; in other words, (X0, Y0) and (X1, Y1) belong to the same coordinate system. Specifically, the distance S between the optical center and the image center is | X0-X1|/| Y0-Y1 |. Generally, when S is smaller than a set test threshold, the product is qualified; and if the S is larger than the set test threshold value, the product is unqualified. In practical applications, a plurality of test thresholds may be set so as to distinguish the quality levels of the products, in other words, the test threshold of the class a product with high product quality requirement is the smallest, and the test thresholds of other class a products lower than the class a product are larger than the test threshold of the class a product.
In one or more embodiments of the present specification, the manner of obtaining the first image by the image capturing device may specifically include: the image acquisition equipment acquires the first image based on uniform visible light board acquisition; the distance between the uniform visible light plate and the image acquisition equipment is smaller than the focal length of the image acquisition equipment.
In practical application, the uniform visible light plate is arranged right in front of the camera lens so as to provide uniform visible light for the lens. It should be noted that, in order to ensure that light rays uniformly enter the camera and avoid the influence of the light source device, the visible light plate needs to be arranged at a position where the distance between the visible light plate and the camera to be tested is less than the focal length of the camera to be tested, and the visible light plate cannot clearly image in the camera.
Based on the same idea, embodiments of the present specification further provide an optical center testing apparatus, as shown in fig. 4, including:
a threshold determination module 401, configured to determine a brightness threshold of a first image acquired by an image acquisition device;
a processing module 402, configured to perform binarization processing on the first image based on the brightness threshold to obtain a second image;
a coordinate determining module 403, configured to determine a column coordinate with the largest number of preset pixel values in multiple columns of the second image, and determine a row coordinate with the largest number of preset pixel values in multiple rows of the second image, where the preset pixel value is a pixel value after the binarization processing;
a center determining module 404 for determining an optical center of the image capturing device based on the column coordinates and the row coordinates.
The threshold determining module 401 is configured to determine a brightness average value of the first image acquired by the image acquisition device; and taking the brightness average value as the brightness threshold value.
The threshold determining module 401 may be further configured to obtain a brightness value YA of each side of the first image and a brightness value YB of the center of the first image;
based on the luminance value YA and the luminance value YB, the luminance average value is calculated by using the following formula:
y ═ C + YA (YB-YA); wherein C is an adjustment coefficient, and Y is the brightness average value.
The coordinate determining module 403 is configured to determine, for any row in the second image, a preset pixel value having a maximum abscissa value and a minimum abscissa value among the preset pixel values included in the any row;
determining the number of the preset pixel values contained in any one row according to the maximum abscissa value and the minimum abscissa value;
and determining the row coordinate with the maximum preset pixel value in the plurality of rows of the second image according to the number of the preset pixel values respectively corresponding to the plurality of rows of the second image.
The coordinate determining module 403 may be further configured to determine, for any column in the second image, a preset pixel value having a maximum ordinate value and a minimum ordinate value among the preset pixel values included in the any column;
determining the number of the preset pixel values contained in any one column according to the maximum ordinate value and the minimum ordinate value;
and determining the column coordinates with the maximum preset pixel values in the multiple columns of the second image according to the number of the preset pixel values respectively corresponding to the multiple columns of the second image.
The center determining module, after determining the optical center, may be further configured to calculate a distance between the optical center and the image center based on the image center coordinates of the second image or the first image and the optical center coordinates;
and judging whether the image acquisition equipment is qualified or not according to a preset distance test threshold and the distance.
The image acquisition device acquires the first image based on uniform visible light panel acquisition.
Based on the same idea, an embodiment of the present specification further provides an optical center testing system, as shown in fig. 5, specifically including:
an image acquisition device 51, and a uniform visible light plate 52 disposed in front of the image acquisition device; wherein the distance between the uniform visible light plate 52 and the image capturing device 51 is smaller than the focal length of the image capturing device 51;
the image acquisition device 51 is used for acquiring a first image based on the uniform visible light plate 52;
the uniform visible light plate 52 is configured to provide uniform visible light for the image capturing device 51 to generate a first image;
the test equipment 53 is used for executing the optical center test method described in one or more of the above embodiments.
In practical applications, generally, when the optical test of the lens is actually required, a test device or a special fixture is often required. And setting the camera to be tested according to the specified orientation.
The uniform visible light plate is arranged right in front of the camera lens so as to provide uniform visible light for the lens. It should be noted that, in order to ensure that light rays uniformly enter the camera and avoid the influence of the light source device, the visible light plate needs to be arranged at a position where the distance between the visible light plate and the camera to be tested is less than the focal length of the camera to be tested, and the visible light plate cannot clearly image in the camera.
Having described the internal functions and structure of the coordinate determination apparatus, in one possible design, the structure of the coordinate determination apparatus may be implemented as an electronic device, such as an intelligent projection device, a depth module, etc., as shown in fig. 6, which may include: a processor 61 and a memory 62. Wherein the memory 62 is used for storing programs that support the electronic device to execute the optical center method provided in the embodiments shown in fig. 1-5, and the processor 61 is configured to execute the programs stored in the memory 62.
The program comprises one or more computer instructions which, when executed by the processor 61, are capable of performing the steps of:
determining a brightness threshold of a first image acquired by an image acquisition device;
performing binarization processing on the first image based on the brightness threshold value to obtain a second image;
determining column coordinates with the largest number of preset pixel values in multiple columns of the second image, and determining row coordinates with the largest number of preset pixel values in multiple rows of the second image, wherein the preset pixel value is one pixel value after binarization processing;
determining an optical center of the image capture device based on the column coordinates and the row coordinates.
Optionally, the processor 61 is further configured to perform all or part of the steps in the embodiments shown in fig. 1 to 5.
The electronic device may further include a communication interface 63 for communicating with other devices or a communication network.
In addition, the embodiment of the present invention provides a computer storage medium for storing computer software instructions for an electronic device, which includes a program for executing the optical center testing method in the method embodiments shown in fig. 1 to 5.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course, can also be implemented by a combination of hardware and software. With this understanding in mind, the above-described aspects and portions of the present technology which contribute substantially or in part to the prior art may be embodied in the form of a computer program product, which may be embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including without limitation disk storage, CD-ROM, optical storage, and the like.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable coordinate determination device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable coordinate determination device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable coordinate determination apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable coordinate determination device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. An optical center testing method, comprising:
determining a brightness threshold of a first image acquired by an image acquisition device;
performing binarization processing on the first image based on the brightness threshold value to obtain a second image;
determining column coordinates with the largest number of preset pixel values in multiple columns of the second image, and determining row coordinates with the largest number of preset pixel values in multiple rows of the second image, wherein the preset pixel value is one pixel value after binarization processing;
determining an optical center of the image capture device based on the column coordinates and the row coordinates.
2. The method according to claim 1, wherein the determining the brightness threshold of the first image acquired by the image acquisition device specifically comprises:
determining a brightness average value of the first image acquired by an image acquisition device;
and taking the brightness average value as the brightness threshold value.
3. The method of claim 2, wherein determining the average value of the brightness of the first image acquired by the image acquisition device comprises:
acquiring a brightness value YA of each side of the first image and a brightness value YB of the center of the first image;
based on the luminance value YA and the luminance value YB, the luminance average value is calculated by using the following formula:
y ═ C + YA (YB-YA); wherein C is an adjustment coefficient, and Y is the brightness average value.
4. The method of claim 1, wherein the determining the row coordinate of the plurality of rows of the second image having the largest value of the preset pixels comprises:
for any row in the second image, determining a preset pixel value with a maximum abscissa value and a minimum abscissa value from the preset pixel values contained in the any row;
determining the number of the preset pixel values contained in any one row according to the maximum abscissa value and the minimum abscissa value;
and determining the row coordinate with the maximum preset pixel value in the plurality of rows of the second image according to the number of the preset pixel values respectively corresponding to the plurality of rows of the second image.
5. The method of claim 1, wherein said determining the column coordinate of the plurality of columns of the second image having the largest value of the preset pixels comprises:
for any column in the second image, determining a preset pixel value with a maximum ordinate value and a minimum ordinate value from the preset pixel values contained in the any column;
determining the number of the preset pixel values contained in any one column according to the maximum ordinate value and the minimum ordinate value;
and determining the column coordinates with the maximum preset pixel values in the multiple columns of the second image according to the number of the preset pixel values respectively corresponding to the multiple columns of the second image.
6. The method of claim 4 or 5, after determining an optical center based on the column coordinates and the row coordinates, further comprising:
calculating a distance of the optical center from the image center based on the image center coordinates of the second image or the first image, and the optical center coordinates;
and judging whether the image acquisition equipment is qualified or not according to a preset distance test threshold and the distance.
7. The method of claim 1, wherein the first image obtained by the image capture device comprises:
the image acquisition device acquires the first image based on uniform visible light panel acquisition.
8. An optical center testing apparatus, comprising:
the threshold value determining module is used for determining a brightness threshold value of a first image acquired by the image acquisition equipment;
a processing module, configured to perform binarization processing on the first image based on the brightness threshold value to obtain a second image;
a coordinate determination module, configured to determine a column coordinate with a largest number of preset pixel values in multiple columns of the second image, and determine a row coordinate with the largest number of preset pixel values in multiple rows of the second image, where the preset pixel value is a pixel value after the binarization processing;
a center determination module to determine an optical center of the image capture device based on the column coordinates and the row coordinates.
9. An optical center testing system, comprising:
the device comprises an image acquisition device and a uniform visible light plate arranged in front of the image acquisition device; wherein the distance between the uniform visible light plate and the image acquisition equipment is less than the focal length of the image acquisition equipment;
the image acquisition equipment is used for acquiring a first image based on the uniform visible light plate;
the uniform visible light plate is used for providing uniform visible light for the image acquisition equipment so as to generate a first image;
test equipment for performing the optical center testing method of any one of claims 1 to 7.
10. An electronic device, comprising: a memory, a processor; wherein,
the memory is to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the optical center testing method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810997883.6A CN109163888A (en) | 2018-08-29 | 2018-08-29 | Optical centre test method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810997883.6A CN109163888A (en) | 2018-08-29 | 2018-08-29 | Optical centre test method, device and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109163888A true CN109163888A (en) | 2019-01-08 |
Family
ID=64893263
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810997883.6A Pending CN109163888A (en) | 2018-08-29 | 2018-08-29 | Optical centre test method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109163888A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110068575A (en) * | 2019-04-29 | 2019-07-30 | 嘉兴学院 | Judgment method, judgment means and the terminal of multi-phase mixing uniformity |
CN110958447A (en) * | 2019-12-12 | 2020-04-03 | 中国空气动力研究与发展中心 | Camera optical center testing method and device, computer equipment and medium |
CN112468801A (en) * | 2019-09-06 | 2021-03-09 | 余姚舜宇智能光学技术有限公司 | Optical center testing method of wide-angle camera module, testing system and testing target board thereof |
CN112991202A (en) * | 2021-03-01 | 2021-06-18 | 歌尔科技有限公司 | Calibration method of optical center position, terminal device and computer readable storage medium |
CN113489969A (en) * | 2021-06-30 | 2021-10-08 | 青岛维感科技有限公司 | Test method and device of TOF camera, control equipment and test equipment |
CN114067104A (en) * | 2021-11-26 | 2022-02-18 | 重庆远视科技有限公司 | Image processing method, refraction information acquisition method and system |
CN114257805A (en) * | 2021-12-15 | 2022-03-29 | 上海研鼎信息技术有限公司 | Method, system and medium for image acquisition and test |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6687396B1 (en) * | 1998-07-29 | 2004-02-03 | Pentax Corporation | Optical member inspection apparatus, image-processing apparatus, image-processing method, and computer readable medium |
CN101207833A (en) * | 2006-12-19 | 2008-06-25 | Tcl数码科技(深圳)有限责任公司 | Method for checking optical centre bias of lens of digital camera |
CN103852243A (en) * | 2012-12-06 | 2014-06-11 | 义晶科技股份有限公司 | Method for detecting optical center of wide-angle lens and optical center detecting device |
JP2015004600A (en) * | 2013-06-21 | 2015-01-08 | 株式会社ニコン | Eccentricity measurement device, eccentricity measurement method and lens manufacturing method |
CN106644410A (en) * | 2016-12-21 | 2017-05-10 | 信利光电股份有限公司 | Camera module optical center position measuring method and system |
CN106683135A (en) * | 2015-11-09 | 2017-05-17 | 宁波舜宇光电信息有限公司 | Method for searching optic center of lens |
CN106839976A (en) * | 2016-12-22 | 2017-06-13 | 歌尔科技有限公司 | A kind of method and device at detector lens center |
WO2017134275A1 (en) * | 2016-02-05 | 2017-08-10 | Eidgenossische Technische Hochschule Zurich | Methods and systems for determining an optical axis and/or physical properties of a lens and use of the same in virtual imaging and head-mounted displays |
CN107278286A (en) * | 2017-04-25 | 2017-10-20 | 深圳市汇顶科技股份有限公司 | Determine the method and apparatus of the position of fingerprint prompting pattern in display screen |
CN107505120A (en) * | 2017-09-18 | 2017-12-22 | 歌尔股份有限公司 | Camera module photocentre location measurement method and measurement apparatus |
CN107635135A (en) * | 2017-09-20 | 2018-01-26 | 歌尔股份有限公司 | Double method of testings and test system for taking the photograph relative dip angle before module group assembling |
CN107702695A (en) * | 2017-09-26 | 2018-02-16 | 歌尔股份有限公司 | Camera module group lens and the method for testing of imaging sensor relative position |
CN107888907A (en) * | 2017-11-24 | 2018-04-06 | 信利光电股份有限公司 | One kind determines visual field method, system and a kind of determination visual field equipment |
-
2018
- 2018-08-29 CN CN201810997883.6A patent/CN109163888A/en active Pending
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6687396B1 (en) * | 1998-07-29 | 2004-02-03 | Pentax Corporation | Optical member inspection apparatus, image-processing apparatus, image-processing method, and computer readable medium |
CN101207833A (en) * | 2006-12-19 | 2008-06-25 | Tcl数码科技(深圳)有限责任公司 | Method for checking optical centre bias of lens of digital camera |
CN103852243A (en) * | 2012-12-06 | 2014-06-11 | 义晶科技股份有限公司 | Method for detecting optical center of wide-angle lens and optical center detecting device |
JP2015004600A (en) * | 2013-06-21 | 2015-01-08 | 株式会社ニコン | Eccentricity measurement device, eccentricity measurement method and lens manufacturing method |
CN106683135A (en) * | 2015-11-09 | 2017-05-17 | 宁波舜宇光电信息有限公司 | Method for searching optic center of lens |
WO2017134275A1 (en) * | 2016-02-05 | 2017-08-10 | Eidgenossische Technische Hochschule Zurich | Methods and systems for determining an optical axis and/or physical properties of a lens and use of the same in virtual imaging and head-mounted displays |
CN106644410A (en) * | 2016-12-21 | 2017-05-10 | 信利光电股份有限公司 | Camera module optical center position measuring method and system |
CN106839976A (en) * | 2016-12-22 | 2017-06-13 | 歌尔科技有限公司 | A kind of method and device at detector lens center |
CN107278286A (en) * | 2017-04-25 | 2017-10-20 | 深圳市汇顶科技股份有限公司 | Determine the method and apparatus of the position of fingerprint prompting pattern in display screen |
CN107505120A (en) * | 2017-09-18 | 2017-12-22 | 歌尔股份有限公司 | Camera module photocentre location measurement method and measurement apparatus |
CN107635135A (en) * | 2017-09-20 | 2018-01-26 | 歌尔股份有限公司 | Double method of testings and test system for taking the photograph relative dip angle before module group assembling |
CN107702695A (en) * | 2017-09-26 | 2018-02-16 | 歌尔股份有限公司 | Camera module group lens and the method for testing of imaging sensor relative position |
CN107888907A (en) * | 2017-11-24 | 2018-04-06 | 信利光电股份有限公司 | One kind determines visual field method, system and a kind of determination visual field equipment |
Non-Patent Citations (1)
Title |
---|
张广生 等: "数码相机定位的优化设计", 《西南民族大学学报·自然科学版》 * |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110068575A (en) * | 2019-04-29 | 2019-07-30 | 嘉兴学院 | Judgment method, judgment means and the terminal of multi-phase mixing uniformity |
CN112468801A (en) * | 2019-09-06 | 2021-03-09 | 余姚舜宇智能光学技术有限公司 | Optical center testing method of wide-angle camera module, testing system and testing target board thereof |
CN112468801B (en) * | 2019-09-06 | 2022-06-14 | 余姚舜宇智能光学技术有限公司 | Optical center testing method of wide-angle camera module, testing system and testing target thereof |
CN110958447A (en) * | 2019-12-12 | 2020-04-03 | 中国空气动力研究与发展中心 | Camera optical center testing method and device, computer equipment and medium |
CN110958447B (en) * | 2019-12-12 | 2021-11-16 | 中国空气动力研究与发展中心 | Camera optical center testing method and device, computer equipment and medium |
CN112991202A (en) * | 2021-03-01 | 2021-06-18 | 歌尔科技有限公司 | Calibration method of optical center position, terminal device and computer readable storage medium |
CN112991202B (en) * | 2021-03-01 | 2023-04-25 | 歌尔科技有限公司 | Optical center position calibration method, terminal device and computer readable storage medium |
CN113489969A (en) * | 2021-06-30 | 2021-10-08 | 青岛维感科技有限公司 | Test method and device of TOF camera, control equipment and test equipment |
CN114067104A (en) * | 2021-11-26 | 2022-02-18 | 重庆远视科技有限公司 | Image processing method, refraction information acquisition method and system |
CN114257805A (en) * | 2021-12-15 | 2022-03-29 | 上海研鼎信息技术有限公司 | Method, system and medium for image acquisition and test |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109163888A (en) | Optical centre test method, device and equipment | |
CN111246204B (en) | Relative brightness deviation-based dirt detection method and device | |
CN111340752A (en) | Screen detection method and device, electronic equipment and computer readable storage medium | |
CN111179358A (en) | Calibration method, device, equipment and storage medium | |
WO2022088660A1 (en) | Method and apparatus for improving wafer detection sensitivity, and storage medium | |
CN112634201B (en) | Target detection method and device and electronic equipment | |
CN106162157A (en) | The method of testing of the spatial frequency response of fish-eye camera | |
CN115060162A (en) | Chamfer dimension measuring method and device, electronic equipment and storage medium | |
CN109862346A (en) | Test method of focusing and equipment | |
CN107085843A (en) | System and method for estimating the modulation transfer function in optical system | |
CN110087046B (en) | Projector definition detection method, device, system and equipment | |
CN113781414B (en) | Lens resolution testing method and device and electronic equipment | |
WO2020117851A2 (en) | Method and device for face selection, recognition and comparison | |
CN115225820A (en) | Automatic shooting parameter adjusting method and device, storage medium and industrial camera | |
CN103297799A (en) | Testing an optical characteristic of a camera component | |
CN109443697B (en) | Optical center testing method, device, system and equipment | |
CN109472772B (en) | Image stain detection method, device and equipment | |
CN112165616A (en) | Camera module testing method and device, electronic equipment and storage medium | |
CN115511718A (en) | PCB image correction method and device, terminal equipment and storage medium | |
CN105427315B (en) | Digital instrument image position testing method and device | |
CN115452325B (en) | Detection method, detection device and medium for optical module ghost | |
CN116993654B (en) | Camera module defect detection method, device, equipment, storage medium and product | |
CN113891068B (en) | Optical axis precision detection method based on camera uniformity test auxiliary device | |
CN114088349B (en) | Method, device and system for testing color combining prism | |
CN109801341B (en) | Calibration target position calibration method and 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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20201028 Address after: 261061 north of Yuqing East Street, east of Dongming Road, Weifang High tech Zone, Weifang City, Shandong Province (Room 502, Geer electronic office building) Applicant after: GoerTek Optical Technology Co.,Ltd. Address before: 261031 No. 268 Dongfang Road, Weifang hi tech Industrial Development Zone, Shandong, Weifang Applicant before: GOERTEK Inc. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190108 |