CN110736610B - Method and device for measuring optical center deviation, storage medium and depth camera - Google Patents
Method and device for measuring optical center deviation, storage medium and depth camera Download PDFInfo
- Publication number
- CN110736610B CN110736610B CN201911010031.4A CN201911010031A CN110736610B CN 110736610 B CN110736610 B CN 110736610B CN 201911010031 A CN201911010031 A CN 201911010031A CN 110736610 B CN110736610 B CN 110736610B
- Authority
- CN
- China
- Prior art keywords
- picture image
- threshold value
- color area
- center
- color
- 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
Images
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 invention discloses a method and a device for measuring optical center deviation, a storage medium and a depth camera, wherein the method comprises the following steps: acquiring a picture image, and setting a first threshold value of binarization processing of the picture image; according to a first threshold value, carrying out binarization processing on the picture image to generate a first color area close to the center position of the picture image; acquiring the average brightness of the first color area, and calculating to obtain the position of a first central point of the first color area; adjusting the first threshold value to generate a second threshold value; generating a second color area close to the center of the picture image according to a second threshold value; acquiring the average brightness of the second color area, and calculating to obtain the position of a second central point of the second color area; and determining the offset direction of the optical center according to the position of the first center point and the position of the second center point. The invention can effectively determine the deflection direction of the central optical axis of the optical lens, is convenient for effectively adjusting the optical lens and the imaging sensor and ensures the imaging quality.
Description
Technical Field
The present invention relates to the field of optical detection technologies, and in particular, to a method and an apparatus for measuring an optical center shift, a depth camera, and a storage medium.
Background
In the current optical system, an optical lens is sometimes rotatably disposed, for example, in a depth camera, so that a deviation occurs between a center of a picture imaged by the optical lens and a center of an imaging sensor, and a center between the center of the picture imaged by the optical lens and the center of the imaging sensor needs to be adjusted to meet a standard.
The above is only for the purpose of assisting understanding of the technical solutions of the present application, and does not represent an admission that the above is prior art.
Disclosure of Invention
Based on this, in order to solve the problem that the final imaging quality is affected because the center of the optical lens and the center of the imaging sensor cannot be effectively adjusted due to the lack of the imaging of the optical lens, it is necessary to provide a method, an apparatus, a storage medium, and a depth camera for measuring the deviation of the optical center, which can effectively determine the deflection direction of the central optical axis of the optical lens, facilitate the effective adjustment of the optical lens and the imaging sensor, and ensure the imaging quality.
To achieve the above object, the present invention provides a method for measuring an optical center shift, the method comprising:
acquiring a picture image, and setting a first threshold value of binarization processing of the picture image;
according to the first threshold value, carrying out binarization processing on the picture image to generate a first color area close to the central position of the picture image;
acquiring the average brightness of the first color area, and calculating to obtain a first central point position of the first color area;
adjusting the first threshold value to generate a second threshold value;
generating a second color area close to the central position of the picture image according to the second threshold value;
acquiring the average brightness of the second color area, and calculating to obtain a second central point position of the second color area;
and determining the offset direction of the optical center according to the position of the first center point and the position of the second center point.
Optionally, the step of acquiring the screen image and setting the first threshold of the binarization processing of the screen image comprises:
and controlling the light source to irradiate the picture so as to enable the picture image to present brightness.
Optionally, the step of acquiring a screen image, and the step of setting a first threshold for binarization processing of the screen image includes:
acquiring a picture image, calculating to obtain a brightness average value of the picture image, and taking the calculated brightness average value as a first threshold value of binarization processing.
Optionally, the step of performing binarization processing on the picture image according to the first threshold value to generate a first color region near the center of the picture image includes:
according to the first threshold value, carrying out binarization processing on the picture image;
and generating a white first color area close to the center position of the picture image and a black third color area except the first color area.
Optionally, the adjusting the first threshold and the generating the second threshold include:
raising the first threshold value to generate a second threshold value; or
And reducing the first threshold value to generate a second threshold value.
Optionally, the step of generating a second color region near the center of the image according to the second threshold includes:
generating a white second color area close to the center of the picture image and a black fourth color area except the second color area according to the second threshold; or
And generating a black second color area close to the central position of the picture image and a white fourth color area except the second color area according to the second threshold value.
Further, in order to achieve the above object, the present invention also provides a measuring optical center shift apparatus comprising:
the setting module is used for acquiring a picture image and setting a first threshold value of binarization processing of the picture image;
the processing module is used for carrying out binarization processing on the picture image according to the first threshold value to generate a first color area close to the central position of the picture image;
the calculation module is used for acquiring the average brightness of the first color area and calculating to obtain a first central point position of the first color area;
the adjusting module is used for adjusting the first threshold value and generating a second threshold value;
the processing module is further configured to generate a second color region close to the center of the picture image according to the second threshold;
the calculation module is further configured to obtain an average brightness of the second color region, and calculate a second center point position of the second color region;
and the determining module is used for determining the offset direction of the optical center according to the position of the first central point and the position of the second central point.
Optionally, the device for measuring optical center offset further includes a control module, configured to control the light source to illuminate the picture, so that the picture image presents brightness.
Further, in order to achieve the above object, the present invention provides a depth camera including an optical lens through which a picture image is taken, the picture image measuring a shift direction of an optical center of the picture image by the method of measuring an optical center shift as described above.
Further, in order to achieve the above object, the present invention provides a storage medium having stored thereon a measuring optical center shift program which, when executed by a processor, implements the steps of the method of measuring optical center shift as described above.
In the technical scheme provided by the invention, a picture image is shot and obtained, a first threshold value of binarization processing of the picture image is set, wherein the first threshold value can be calculated or can be obtained through setting, the picture image is subjected to binarization processing according to the first threshold value, the picture image is divided into a first color area close to the central position of the picture image, the average brightness value of the first color area is calculated to obtain the position of a first central point of the first color area, generally, the highest brightness point is the position of the first central point, after the first threshold value is adjusted, the adjusted first threshold value is a second threshold value, binarization processing is carried out on the picture image again according to the second threshold value, a second color area is generated close to the central position of the picture image, the boundary of the second color area is changed relative to the first color area, so as to reduce the influence of missing pictures on the calculation of the optical center at the periphery of an optical lens, and calculating to obtain a second central point position according to the generated second color area, and determining the offset direction of the optical center according to the offset direction of the first central point position to the second central point position.
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, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
FIG. 1 is a schematic flow chart illustrating a first embodiment of a method for measuring optical center shift according to the present invention;
FIG. 2 is a flow chart illustrating a second embodiment of the method for measuring optical center shift according to the present invention;
FIG. 3 is a flow chart illustrating a third embodiment of the method for measuring optical center shift according to the present invention;
FIG. 4 is a flowchart illustrating a fourth embodiment of the method for measuring optical center shift according to the present invention;
FIG. 5 is a flow chart illustrating a fifth embodiment of the method for measuring optical center shift according to the present invention;
FIG. 6 is a flowchart illustrating a sixth embodiment of the method for measuring optical center shift according to the present invention;
FIG. 7 is a schematic diagram of an apparatus for measuring optical center shift according to the present invention;
FIG. 8 is a picture image before being photographed using an optical lens;
FIG. 9 is a binarized image of an image captured when the center of the optical lens coincides with the center of the imaging sensor;
fig. 10 is an image when the center of the optical lens is shifted from the center of the imaging sensor and the binarization processing threshold value is 128;
fig. 11 is an image when the binarization processing threshold value is 142 in fig. 10;
fig. 12 is an image when the binarization processing threshold value is 145 in fig. 10;
FIG. 13 is a schematic illustration of determining optical centers when distinguishing between different fields of view.
The reference numbers illustrate:
reference numerals | Name (R) | Reference numerals | Name (R) |
100 | |
400 | |
200 | |
500 | Determining |
300 | Computing module |
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
It should be noted that all the directional indicators (such as up, down, left, right, front, and rear … …) in the embodiment of the present invention are only used to explain the relative position relationship between the components, the movement situation, etc. in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indicator is changed accordingly.
In addition, the descriptions related to "first", "second", etc. in the present invention are only for descriptive purposes and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "connected," "secured," and the like are to be construed broadly, and for example, "secured" may be a fixed connection, a removable connection, or an integral part; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In addition, the technical solutions in the embodiments of the present invention may be combined with each other, but it must be based on the realization of those skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination of technical solutions should not be considered to exist, and is not within the protection scope of the present invention.
Referring to fig. 1, a first embodiment of the present invention provides a method for measuring an optical center offset, the method comprising:
step S10, acquiring a picture image, and setting a first threshold value of binarization processing of the picture image;
specifically, the picture image is obtained by shooting, the binarization processing refers to dividing the color of the picture image into two different colors, for example, performing gray scale binarization processing on the picture image, the picture image color is divided into two colors, namely black and white, the first threshold value is a boundary point of the two colors, namely black and white, and represents display from black to white by using integer characters from 0 to 255, wherein 0 represents black, 255 represents white, and the gray scale 128 is used as the boundary point, and the picture image is subjected to binarization processing, wherein the color from 0 to 128 is black, and the color from 128 and 255 are white. In addition, the binarization processing is not limited to two colors of black and white, and the purpose of the binarization processing is to divide luminance regions of different screen images.
Step S20, according to the first threshold value, the image of the picture is binarized, and a first color area close to the center of the image of the picture is generated;
specifically, in the depth module, that is, the TOF (Time of flight) module, a deviation is easily generated between the optical axis of the optical lens and the center of the imaging sensor, but the optical axis of the optical lens is relatively near the imaging sensor, that is, the imaging position of the optical lens corresponds to the first color region.
Step S30, obtaining the average brightness of the first color area, and calculating to obtain the first central point position of the first color area;
the brightness value of the optical axis area of the general optical lens is higher, and after the average brightness of the first color area is obtained, the brightness peak value of the first color area can be calculated to be the first central point. The first central point may be a central point of the imaging sensor, or may not be the central point of the imaging sensor.
Step S40, adjusting the first threshold value to generate a second threshold value;
specifically, after the optical lens is rotated or set, the optical axis of the optical lens generally shifts, and a frame imaged by the optical lens may be missing, especially in an edge area imaged by the optical lens, a first threshold is adjusted, for example, a first color area is originally a white area, when the first threshold is increased to 200, a color in the first color area changes, an area with a gray level lower than 200 is changed into black, and an area with a gray level higher than 200 is still white, and by adjusting the first threshold, a color in a peripheral area of the frame changes into black, thereby reducing an influence on calculating an optical center point.
Step S50, generating a second color area close to the center of the picture image according to a second threshold value;
specifically, taking the second threshold value as 200 as an explanation, the area with the gray scale value lower than 200 is changed into black, the area with the gray scale value higher than 200 is still white, and the peripheral area of the optical lens is generally low in brightness value, so after the threshold value of the binarization processing is increased, the peripheral area imaged by the corresponding optical lens is changed into black, and simultaneously, due to the image missing of the peripheral area of the screen, the influence of the peripheral image when the optical center point is calculated is reduced.
Step S60, obtaining the average brightness of the second color area, and calculating to obtain the second center point position of the second color area;
and when the influence of the peripheral image of the second color area is eliminated, calculating to obtain the average brightness of the second color area, and obtaining the position of a second central point of the second color area.
In step S70, the offset direction of the optical center is determined according to the first and second center point positions.
Specifically, the center of the imaging sensor can be used as an origin, a planar rectangular coordinate system is established, by obtaining the position of the first central point and the position of the second central point, which quadrant the position of the first central point is located in and which quadrant the position of the second central point is located in can be judged, and the direction from the position of the first central point to the position of the second central point is the offset direction of the optical center.
In the technical solution of this embodiment, a picture image is captured, a first threshold for binarization processing of the picture image is set, wherein the first threshold can be calculated or set, the picture image is binarized according to the first threshold, the picture image is divided into a first color region near a center position of the picture image, an average brightness value of the first color region is calculated to obtain a first center point position of the first color region, generally speaking, a brightness peak is the first center point position, after the first threshold is adjusted, the adjusted first threshold is a second threshold, the picture image is binarized again according to the second threshold, a second color region is generated near the center position of the picture image, a boundary of the second color region changes relative to the first color region, so as to reduce an influence of missing pictures around the optical lens on calculating an optical center, and calculating to obtain a second central point position according to the generated second color area, and determining the offset direction of the optical center according to the offset direction of the first central point position to the second central point position.
Referring to fig. 2, in addition to the first embodiment of the present invention, a second embodiment of the present invention is proposed, wherein the step S10 of acquiring the picture image and setting the first threshold value of the binarization processing of the picture image comprises:
in step S01, the light source is controlled to illuminate the picture so that the picture image exhibits brightness.
For example, a light source with 1500 lumens of illuminance and 5000-inch color temperature illuminates a picture, so that brightness display of a picture image can be obtained by shooting, and an imaging area corresponding to the optical lens can be distinguished.
Referring to fig. 3, in addition to the second embodiment of the present invention, a third embodiment of the present invention is proposed, and the step S10 of acquiring the picture image and setting the first threshold value of the binarization processing of the picture image includes:
step S11, acquiring a picture image, calculating a luminance average value of the acquired picture image, and using the calculated luminance average value as a first threshold value of the binarization processing.
Specifically, the total brightness value of the whole image is obtained, the average brightness value of the image is calculated according to the pixel proportion of the image, the calculated average brightness value is used as a first threshold, and the average brightness value is used as the first threshold, so that the brightness display of the whole image can be accurately distinguished. In addition, the first threshold may be set according to design requirements.
Referring to fig. 4, a fourth embodiment of the present invention is proposed on the basis of the third embodiment of the present invention, and the step S20 of generating the first color region near the center position of the screen image by performing binarization processing on the screen image according to the first threshold value includes:
step S21, carrying out binarization processing on the picture image according to a first threshold value;
specifically, the binarization processing is to divide the color of the picture image into two different colors, for example, to perform grayscale binarization processing on the picture image, and the picture image color is divided into two colors, namely black and white. Of course, the color of the binarization process is not limited to black and white, and the binarization process is intended to divide the different luminance regions of the screen image.
In step S22, a white first color region near the center position of the screen image and a black third color region other than the first color region are generated. In the depth module, a deviation is easily generated between an optical axis of the optical lens and a center of the imaging sensor, but relatively speaking, the optical axis of the optical lens is near the imaging sensor, that is, the optical lens corresponds to an imaging position corresponding to a first color zone, the first threshold is a boundary point of two colors, namely, the optical lens corresponds to an imaging position corresponding to a first color zone, the first threshold is a boundary point of black and white, for example, a first threshold is 128, an integer word of 0 to 255 represents display from black to white, wherein 0 represents black, 255 represents white, and a gray scale 128 is used as a boundary point to perform binarization processing on the image, wherein black is 0 to 128, and white is 128-plus 255. By the binarization processing, a first color region forming white and a third color region forming black are distinguished in the screen image.
Referring to fig. 5, on the basis of any one of the first to fourth embodiments of the present invention, a fifth embodiment of the present invention is proposed, and the step S40 of adjusting the first threshold and generating the second threshold includes:
step S41, raising the first threshold value to generate a second threshold value;
for example, the first color region is originally a white region, when the first threshold is increased to 200, the first threshold is 128, the second threshold is 200, the color in the first color region changes, the region with the gray scale value lower than 200 is changed into black, and the region with the gray scale value higher than 200 is still white. Corresponding to a reduction of the first color area. To reduce the effect of the edge area of the image.
Alternatively, in step S42, the first threshold value is lowered to generate the second threshold value.
For example, the first color region is originally a white region, and when the first threshold is decreased to 100, the first threshold is 128, the second threshold is 100, the color in the first color region changes, the region with the gray scale value lower than 100 is changed into black, and the region with the gray scale value higher than 100 is white. The first color area is enlarged equivalently, so that the selection range of the first color area is wider, and the problem of insufficient selection range of the first color area is solved.
Referring to fig. 6, based on the fifth embodiment of the present invention, a sixth embodiment of the present invention is proposed, and the step S50 of generating the second color region near the center position of the picture image according to the second threshold value includes:
step S51, generating a white second color region near the center of the screen image and a black fourth color region excluding the second color region according to a second threshold;
specifically, taking the second threshold as 200 as an illustration, a region with a gray level value lower than 200 is changed into black, a region with a gray level value higher than 200 is still white, that is, the area of the white second color region is reduced relative to the first color region, the area of the black fourth color region is increased relative to the third color region, and in the peripheral region of the optical lens, the general brightness value is lower, so after the threshold of the binarization processing is increased, the peripheral region imaged by the corresponding optical lens is changed into black, and meanwhile, due to the image missing of the peripheral region of the screen, the image missing part is changed into the fourth color region, and the image missing part in calculating the optical center point can be ignored, thereby still calculating the optical center of the corresponding optical lens.
Alternatively, in step S52, the second color area of black near the center position of the screen image and the fourth color area of white except for the second color area are generated according to the second threshold.
That is, by implementing the color inversion on the basis of step S51, or understanding that the color of the second color region is not limited to white, and the color of the fourth color region is not limited to black, the distinction between two different colors is intended to reduce the influence of the missing image of the optical lens on the calculation of the optical center.
Referring to fig. 9, when the center of the optical lens coincides with the center of the imaging sensor, the obtained image subjected to binarization processing is captured, and it can be seen that the image close to the center of the imaging sensor is complete and has no missing, it can be understood that the complete white image is a first color region, referring to the image when the center of the optical lens deviates from the center of the imaging sensor and the binarization processing threshold value is 128 shown in fig. 10, it can be understood that the missing image is a second color region, referring to fig. 11 and 12, by adjusting the threshold values of the second color region to be 142 and 145, the edge of the second color region gradually turns into black, the edge of the missing image is excluded from the calculation range, and the missing image is prevented from affecting the calculation optical center.
In addition, referring to fig. 13, the position of the optical center is determined as the deviation within which field of view occurs, for example, in the missing image, a planar rectangular coordinate system is established with the center of the imaging sensor as the origin, the image is binarized to obtain the intersection point a of the black-white boundary region and the horizontal axis, obtain the intersection point B of the black-white boundary region and the vertical axis, draw a circle with the center of the white region as the center O and the length from the center O to the point a as the radius, draw a circle with the center O as the center O and the length from the point O to the point B as the radius, obtain an annular region, the annular region divides the whole picture into three parts, the three parts extend outwards from the center O and are respectively a third part, a second part and a first part, a diagonal line is connected in the first quadrant, and the two intersection points with the first quadrant are respectively the position of the field of view of 0.3 and 0.35, with the a point in which field of view range, it is determined in which quadrant the optical center starts to shift.
Referring to fig. 7, the present invention also provides an apparatus for measuring optical center offset, including: a setting module 100, a processing module 200, a calculation module 300, an adjustment module 400, and a determination module 500.
The setting module 100 is configured to acquire a picture image, and set a first threshold for binarization processing of the picture image; specifically, the picture image is obtained by shooting, the binarization processing refers to dividing the color of the picture image into two different colors, for example, performing gray scale binarization processing on the picture image, the picture image color is divided into two colors, namely black and white, the first threshold value is a boundary point of the two colors, namely black and white, and represents display from black to white by using integer characters from 0 to 255, wherein 0 represents black, 255 represents white, and the gray scale 128 is used as the boundary point, and the picture image is subjected to binarization processing, wherein the color from 0 to 128 is black, and the color from 128 and 255 are white. In addition, the binarization processing is not limited to two colors of black and white, and the purpose of the binarization processing is to divide luminance regions of different screen images.
The processing module 200 is configured to perform binarization processing on the picture image according to the first threshold value, and generate a first color region close to a center position of the picture image; specifically, in the depth module, i.e., the TOF module, a deviation is liable to occur between the optical axis of the optical lens and the center of the imaging sensor, but relatively speaking, the optical axis of the optical lens is in the vicinity of the imaging sensor, that is, the optical lens corresponds to the imaging position corresponding to the first color region.
The calculating module 300 is configured to obtain an average brightness of the first color region, and calculate a first center point position of the first color region; the brightness value of the optical axis area of the general optical lens is higher, and after the average brightness of the first color area is obtained, the brightness peak value of the first color area can be calculated to be the first central point. The first central point may be a central point of the imaging sensor, or may not be the central point of the imaging sensor.
The adjusting module 400 is configured to adjust the first threshold, and generate a second threshold; specifically, after the optical lens is rotated or set, the optical axis of the optical lens generally shifts, and a frame imaged by the optical lens may be missing, especially in an edge area imaged by the optical lens, a first threshold is adjusted, for example, a first color area is originally a white area, when the first threshold is increased to 200, a color in the first color area changes, an area with a gray level lower than 200 is changed into black, and an area with a gray level higher than 200 is still white, and by adjusting the first threshold, a color in a peripheral area of the frame changes into black, thereby reducing an influence on calculating an optical center point.
The processing module 200 is further configured to generate a second color region near the center of the image according to the second threshold; specifically, taking the second threshold value as 200 as an explanation, the area with the gray scale value lower than 200 is changed into black, the area with the gray scale value higher than 200 is still white, and the peripheral area of the optical lens is generally low in brightness value, so after the threshold value of the binarization processing is increased, the peripheral area imaged by the corresponding optical lens is changed into black, and simultaneously, due to the image missing of the peripheral area of the screen, the influence of the peripheral image when the optical center point is calculated is reduced.
The calculating module 300 is further configured to obtain an average brightness of the second color region, and calculate a second center point position of the second color region; and when the influence of the peripheral image of the second color area is eliminated, calculating to obtain the average brightness of the second color area, and obtaining the position of a second central point of the second color area.
The determining module 500 is configured to determine an offset direction of the optical center according to the first central point position and the second central point position. Specifically, the center of the imaging sensor can be used as an origin, a planar rectangular coordinate system is established, by obtaining the position of the first central point and the position of the second central point, which quadrant the position of the first central point is located in and which quadrant the position of the second central point is located in can be judged, and the direction from the position of the first central point to the position of the second central point is the offset direction of the optical center.
In the technical solution of this embodiment, a picture image is captured, a first threshold for binarization processing of the picture image is set, wherein the first threshold can be calculated or set, the picture image is binarized according to the first threshold, the picture image is divided into a first color region near a center position of the picture image, an average brightness value of the first color region is calculated to obtain a first center point position of the first color region, generally speaking, a brightness peak is the first center point position, after the first threshold is adjusted, the adjusted first threshold is a second threshold, the picture image is binarized again according to the second threshold, a second color region is generated near the center position of the picture image, a boundary of the second color region changes relative to the first color region, so as to reduce an influence of missing pictures around the optical lens on calculating an optical center, and calculating to obtain a second central point position according to the generated second color area, and determining the offset direction of the optical center according to the offset direction of the first central point position to the second central point position.
Further, the device for measuring optical center offset further includes a control module 600, configured to control the light source to illuminate the picture, so that the picture image presents brightness. For example, a light source with 1500 lumens of illuminance and 5000-inch color temperature illuminates a picture, so that brightness display of a picture image can be obtained by shooting, and an imaging area corresponding to the optical lens can be distinguished.
Further, the setting module 100 is further configured to acquire the picture image, calculate a brightness average value of the obtained picture image, and use the calculated brightness average value as the first threshold of the binarization processing. Specifically, the total brightness value of the whole image is obtained, the average brightness value of the image is calculated according to the pixel proportion of the image, the calculated average brightness value is used as a first threshold, and the average brightness value is used as the first threshold, so that the brightness display of the whole image can be accurately distinguished. In addition, the first threshold may be set according to design requirements.
Further, the processing module 200 is further configured to perform binarization processing on the picture image according to a first threshold; specifically, the binarization processing is to divide the color of the picture image into two different colors, for example, to perform grayscale binarization processing on the picture image, and the picture image color is divided into two colors, namely black and white. Of course, the color of the binarization process is not limited to black and white, and the binarization process is intended to divide the different luminance regions of the screen image.
The processing module 200 is further configured to generate a white first color region near the center of the screen image and a black third color region except the first color region. In the depth module, a deviation is easily generated between an optical axis of the optical lens and a center of the imaging sensor, but relatively speaking, the optical axis of the optical lens is near the imaging sensor, that is, the optical lens corresponds to an imaging position corresponding to a first color zone, the first threshold is a boundary point of two colors, namely, the optical lens corresponds to an imaging position corresponding to a first color zone, the first threshold is a boundary point of black and white, for example, a first threshold is 128, an integer word of 0 to 255 represents display from black to white, wherein 0 represents black, 255 represents white, and a gray scale 128 is used as a boundary point to perform binarization processing on the image, wherein black is 0 to 128, and white is 128-plus 255. By the binarization processing, a first color region forming white and a third color region forming black are distinguished in the screen image.
Further, the adjusting module 400 is further configured to raise the first threshold, and generate a second threshold; for example, the first color region is originally a white region, when the first threshold is increased to 200, the first threshold is 128, the second threshold is 200, the color in the first color region changes, the region with the gray scale value lower than 200 is changed into black, and the region with the gray scale value higher than 200 is still white. Corresponding to a reduction of the first color area. To reduce the effect of the edge area of the image.
Alternatively, the adjusting module 400 is further configured to lower the first threshold and generate the second threshold. For example, the first color region is originally a white region, and when the first threshold is decreased to 100, the first threshold is 128, the second threshold is 100, the color in the first color region changes, the region with the gray scale value lower than 100 is changed into black, and the region with the gray scale value higher than 100 is white. The first color area is enlarged equivalently, so that the selection range of the first color area is wider, and the problem of insufficient selection range of the first color area is solved.
Further, the determining module 500 is further configured to generate a white second color region near the center of the frame image and a black fourth color region except the second color region according to a second threshold; specifically, taking the second threshold as 200 as an illustration, a region with a gray level value lower than 200 is changed into black, a region with a gray level value higher than 200 is still white, that is, the area of the white second color region is reduced relative to the first color region, the area of the black fourth color region is increased relative to the third color region, and in the peripheral region of the optical lens, the general brightness value is lower, so after the threshold of the binarization processing is increased, the peripheral region imaged by the corresponding optical lens is changed into black, and meanwhile, due to the image missing of the peripheral region of the screen, the image missing part is changed into the fourth color region, and the image missing part in calculating the optical center point can be ignored, thereby still calculating the optical center of the corresponding optical lens.
Alternatively, the determining module 500 is further configured to generate a black second color area near the center of the frame image and a white fourth color area except for the second color area according to a second threshold. That is, the color inversion is realized, or it is understood that the color of the second color region is not limited to white, and the color of the fourth color region is not limited to black, and the distinction between the two different colors is intended to reduce the influence of the missing picture of the optical lens on the calculation of the optical center.
The present invention provides a depth camera comprising an optical lens through which a picture image is taken, the picture image having a direction of shift of an optical center of the picture image measured by the method of measuring the shift of the optical center as described above.
The detailed embodiments of the depth camera according to the present invention may refer to the embodiments of the method for measuring an optical center offset, which are not described herein again.
The present invention provides a storage medium having stored thereon a program for measuring optical center offset, which when executed by a processor implements the steps of the method for measuring optical center offset as described above.
The embodiments of the method for measuring the optical center offset according to the present invention can be referred to in the embodiments of the storage medium of the present invention, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, 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 process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A method of measuring optical center shift, the method comprising:
acquiring a picture image, and setting a first threshold value of binarization processing of the picture image;
according to the first threshold value, carrying out binarization processing on the picture image to generate a first color area close to the central position of the picture image;
acquiring the average brightness of the first color area, and calculating to obtain a first central point position of the first color area;
adjusting the first threshold value to generate a second threshold value;
generating a second color area close to the central position of the picture image according to the second threshold value;
acquiring the average brightness of the second color area, and calculating to obtain a second central point position of the second color area;
and determining the offset direction of the optical center according to the position of the first center point and the position of the second center point.
2. The method of measuring optical center shift according to claim 1, wherein the step of acquiring a screen image, setting a binarization processing first threshold value of the screen image, includes:
and controlling the light source to irradiate the picture so as to enable the picture image to present brightness.
3. The method of measuring optical center shift according to claim 2, wherein the step of acquiring a screen image, setting a binarization-processing first threshold value of the screen image, comprises:
acquiring a picture image, calculating to obtain a brightness average value of the picture image, and taking the calculated brightness average value as a first threshold value of binarization processing.
4. The method of measuring optical center shift according to claim 3, wherein the step of binarizing the screen image based on the first threshold value to generate the first color region near the center position of the screen image comprises:
according to the first threshold value, carrying out binarization processing on the picture image;
and generating a white first color area close to the center position of the picture image and a black third color area except the first color area.
5. The method of measuring optical center shift according to any one of claims 1-4, wherein the step of adjusting the first threshold and generating the second threshold comprises:
raising the first threshold value to generate a second threshold value; or
And reducing the first threshold value to generate a second threshold value.
6. The method of claim 5, wherein the step of generating a second color region near the center of the frame image according to the second threshold comprises:
generating a white second color area close to the center of the picture image and a black fourth color area except the second color area according to the second threshold; or
And generating a black second color area close to the central position of the picture image and a white fourth color area except the second color area according to the second threshold value.
7. A device for measuring optical center shift, comprising:
the setting module is used for acquiring a picture image and setting a first threshold value of binarization processing of the picture image;
the processing module is used for carrying out binarization processing on the picture image according to the first threshold value to generate a first color area close to the central position of the picture image;
the calculation module is used for acquiring the average brightness of the first color area and calculating to obtain a first central point position of the first color area;
the adjusting module is used for adjusting the first threshold value and generating a second threshold value;
the processing module is further configured to generate a second color region close to the center of the picture image according to the second threshold;
the calculation module is further configured to obtain an average brightness of the second color region, and calculate a second center point position of the second color region;
and the determining module is used for determining the offset direction of the optical center according to the position of the first central point and the position of the second central point.
8. The apparatus of claim 7, further comprising a control module for controlling the light source to illuminate the frame so that the frame image exhibits brightness.
9. A depth camera comprising an optical lens through which a picture image is taken, the picture image having a direction in which an optical center of the picture image is shifted measured by the method for measuring an optical center shift according to any one of claims 1 to 6.
10. A storage medium having stored thereon a program for measuring optical center offset, which when executed by a processor implements the steps of the method for measuring optical center offset according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911010031.4A CN110736610B (en) | 2019-10-22 | 2019-10-22 | Method and device for measuring optical center deviation, storage medium and depth camera |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911010031.4A CN110736610B (en) | 2019-10-22 | 2019-10-22 | Method and device for measuring optical center deviation, storage medium and depth camera |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110736610A CN110736610A (en) | 2020-01-31 |
CN110736610B true CN110736610B (en) | 2021-08-20 |
Family
ID=69270967
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911010031.4A Active CN110736610B (en) | 2019-10-22 | 2019-10-22 | Method and device for measuring optical center deviation, storage medium and depth camera |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110736610B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114184353B (en) * | 2020-08-24 | 2024-03-05 | 佳凌科技股份有限公司 | Optical lens assembly method |
CN112326202B (en) * | 2020-10-23 | 2022-12-09 | 歌尔光学科技有限公司 | Binocular parallax testing method, device and tool of virtual reality equipment |
CN112351219B (en) * | 2020-10-30 | 2021-10-19 | 深圳市景阳科技股份有限公司 | Thermal imaging image deviation correction method and thermal imaging binocular camera device |
CN112747906B (en) * | 2021-01-28 | 2022-07-22 | 歌尔光学科技有限公司 | Light source detection method, detection device and readable storage medium |
CN113834640B (en) * | 2021-09-30 | 2024-03-01 | 杭州微影软件有限公司 | Method for determining optical center deviation of thermal imaging module, optical center alignment method and device |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3231592B2 (en) * | 1995-10-04 | 2001-11-26 | 旭光学工業株式会社 | Optical member inspection device |
JP4869053B2 (en) * | 2006-01-11 | 2012-02-01 | 日東電工株式会社 | LAMINATED FILM MANUFACTURING METHOD, LAMINATED FILM DEFECT DETECTING METHOD, LAMINATED FILM DEFECT DETECTOR, LAMINATED FILM, AND IMAGE DISPLAY DEVICE |
CN101207833B (en) * | 2006-12-19 | 2010-05-19 | Tcl数码科技(深圳)有限责任公司 | Method for checking optical centre bias of lens of digital camera |
TW201443391A (en) * | 2013-05-02 | 2014-11-16 | Hon Hai Prec Ind Co Ltd | Measure method of lens optical axis offset |
JP6340477B2 (en) * | 2015-03-26 | 2018-06-06 | 富士フイルム株式会社 | Distance image acquisition device and distance image acquisition method |
CN106683135A (en) * | 2015-11-09 | 2017-05-17 | 宁波舜宇光电信息有限公司 | Method for searching optic center of lens |
CN109000886A (en) * | 2018-05-23 | 2018-12-14 | Oppo广东移动通信有限公司 | A kind of light source detection method and device thereof, equipment and storage medium |
CN108632604B (en) * | 2018-05-25 | 2020-11-03 | 歌尔科技有限公司 | Method and device for detecting optical center of lens |
CN208653765U (en) * | 2018-07-09 | 2019-03-26 | 歌尔科技有限公司 | The test device of light shaft offset |
CN109580179B (en) * | 2018-11-22 | 2021-01-08 | 中国科学院苏州生物医学工程技术研究所 | Aspheric lens eccentricity detection device based on wavefront technology and detection method thereof |
CN110142229A (en) * | 2019-04-17 | 2019-08-20 | 信利光电股份有限公司 | A kind of method and device for the center luminous flux accounting calculating semiconductor laser |
-
2019
- 2019-10-22 CN CN201911010031.4A patent/CN110736610B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110736610A (en) | 2020-01-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110736610B (en) | Method and device for measuring optical center deviation, storage medium and depth camera | |
CN108932698B (en) | Image distortion correction method, device, electronic equipment and storage medium | |
CN107507558B (en) | Correction method of LED display screen | |
US11314979B2 (en) | Method and apparatus for evaluating image acquisition accuracy, electronic device and storage medium | |
CN105592270B (en) | image brightness compensation method, device and terminal device | |
CN111047615B (en) | Image-based straight line detection method and device and electronic equipment | |
CN110852997B (en) | Dynamic image definition detection method and device, electronic equipment and storage medium | |
JP6115214B2 (en) | Pattern processing apparatus, pattern processing method, and pattern processing program | |
CN114302121B (en) | Image correction checking method, device, electronic equipment and storage medium | |
JP2015060012A (en) | Image processing system, image processing device, image processing method and image processing program as well as display system | |
CN112308794A (en) | Method and apparatus for correcting display image, and computer-readable storage medium | |
CN105049734A (en) | License camera capable of giving shooting environment shooting prompt and shooting environment detection method | |
CN111080542B (en) | Image processing method, device, electronic equipment and storage medium | |
CN114359055B (en) | Image splicing method and related device for multi-camera shooting screen body | |
CN113286135A (en) | Image correction method and apparatus | |
WO2010050412A1 (en) | Calibration index determination device, calibration device, calibration performance evaluation device, system, method, and program | |
CN112272292A (en) | Projection correction method, apparatus and storage medium | |
CN113038105B (en) | Projector adjusting method and adjusting apparatus | |
CN107622475A (en) | Gray correction method in image mosaic | |
CN111609998A (en) | Detection method and detection device for illumination uniformity and readable storage medium | |
CN114757853B (en) | Method and system for acquiring flat field correction function and flat field correction method and system | |
CN111091507A (en) | Image processing method, image processing apparatus, electronic device, and storage medium | |
CN117670886B (en) | Display screen defect detection method, device, equipment and storage medium | |
US10970592B2 (en) | Adhering substance detection apparatus and adhering substance detection method | |
CN115760653B (en) | Image correction method, device, equipment and readable storage medium |
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: 20201010 Address after: 261031, north of Jade East Street, Dongming Road, Weifang hi tech Zone, Shandong province (GoerTek electronic office building, Room 502) Applicant after: GoerTek Optical Technology Co.,Ltd. Address before: 261031 Dongfang Road, Weifang high tech Industrial Development Zone, Shandong, China, No. 268 Applicant before: GOERTEK Inc. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |