CN112672008B - Lens adjusting method and device - Google Patents

Lens adjusting method and device Download PDF

Info

Publication number
CN112672008B
CN112672008B CN202011465799.3A CN202011465799A CN112672008B CN 112672008 B CN112672008 B CN 112672008B CN 202011465799 A CN202011465799 A CN 202011465799A CN 112672008 B CN112672008 B CN 112672008B
Authority
CN
China
Prior art keywords
image
information
angle
quality score
lens
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011465799.3A
Other languages
Chinese (zh)
Other versions
CN112672008A (en
Inventor
谢树鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Lianji Technology Co ltd
Original Assignee
Hangzhou Lianji Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Lianji Technology Co ltd filed Critical Hangzhou Lianji Technology Co ltd
Priority to CN202011465799.3A priority Critical patent/CN112672008B/en
Publication of CN112672008A publication Critical patent/CN112672008A/en
Application granted granted Critical
Publication of CN112672008B publication Critical patent/CN112672008B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Blocking Light For Cameras (AREA)

Abstract

The application is applicable to the technical field of image processing, and provides a method and a device for adjusting a lens, wherein the method comprises the following steps: acquiring a plurality of polarization images in the same scene; the polarized image is an image collected by the functional lens when the functional lens is positioned at different first angles; calculating a first quality score of the polarization image according to first image information of the polarization image; taking a first angle corresponding to the polarization image with the maximum first quality score as a target angle; adjusting the functional lens to the target angle. According to the scheme, the images collected by the functional lenses penetrating through different angles are scored, and then the angles of the functional lenses are controlled according to the scores. Compared with the traditional technical scheme, the angle of the functional lens can be adjusted according to the image effect, so that the state of light changing from time to time can be adapted, and the effect of inhibiting light pollution is further improved.

Description

Lens adjusting method and device
Technical Field
The present application belongs to the technical field of image processing, and in particular, to a method and an apparatus for adjusting a lens, an image capturing device, and a computer-readable storage medium.
Background
Nowadays, image pickup apparatuses are widely used in daily life and work production. When an object is shot, light reflected by the object is collected by a lens of the shooting equipment, so that the light is focused on a light receiving surface of the shooting device, and then the light is converted into electric energy through the shooting device, so that an image signal is obtained.
However, in the process of practical application, because light in the nature cannot be controlled, light pollution such as halo or reflection often occurs, and the image effect acquired by the camera equipment is poor. The conventional solution is to install a functional lens (e.g. an optical filter) in front of the lens, and to suppress light pollution by the functional lens. However, the position of the functional lens is often fixed, and the light of nature is in a state of changing from time to time, so that the effect of the functional lens on suppressing light pollution is not good.
Disclosure of Invention
In view of this, embodiments of the present application provide a lens adjusting method, an apparatus, an image capturing device, and a computer readable storage medium, which can solve the technical problem that the effect of the functional lens on suppressing light pollution is not good because the position of the functional lens is often fixed and the light of the nature is in a state of changing from time to time.
A first aspect of an embodiment of the present application provides a method for adjusting a lens, where the method includes:
acquiring a plurality of polarization images in the same scene; the polarized image is an image collected by the functional lens when the functional lens is positioned at different first angles;
calculating a first quality score of the polarization image according to first image information of the polarization image;
taking a first angle corresponding to the polarization image with the maximum first quality score as a target angle;
adjusting the functional lens to the target angle.
A second aspect of embodiments of the present application provides a lens adjusting apparatus, including:
the acquisition unit is used for acquiring a plurality of polarization images in the same scene; the polarized image is an image collected by the functional lens when the functional lens is positioned at different first angles;
the calculating unit is used for calculating a first quality score of the polarization image according to the first image information of the polarization image;
the selecting unit is used for taking a first angle corresponding to the polarization image with the largest first quality score as a target angle;
and the adjusting unit is used for adjusting the functional lens to the target angle.
A third aspect of the embodiments of the present application provides an image capturing apparatus, including an image capturing module, a memory, a processor, and a computer program stored in the memory and executable on the processor, where the memory includes an external memory and an internal memory, and the processor implements the steps of the method of the first aspect when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the method according to the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that: the method comprises the steps of acquiring a plurality of polarization images in the same scene; calculating a first quality score of the polarization image according to first image information of the polarization image; taking a first angle corresponding to the polarization image with the maximum first quality score as a target angle; adjusting the functional lens to the target angle. According to the scheme, the images collected through the functional lenses with different angles are scored, and then the angles of the functional lenses are controlled according to the scores. Compared with the traditional technical scheme, the angle of the functional lens can be adjusted according to the image effect, so that the state of the light which changes from time to time can be adapted, and the effect of inhibiting light pollution is further improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the related technical descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram showing a mechanical configuration of an image pickup apparatus provided by the present application;
FIG. 2 shows a schematic view of the rotation of a functional lens provided herein;
FIG. 3 shows a schematic view of the rotation of a functional lens provided by the present application;
FIG. 4 shows a schematic flow chart of a method of adjusting a lens provided herein;
FIG. 5 shows a specific schematic flowchart of step 302 in a lens adjustment method provided herein;
fig. 6 shows a specific schematic flowchart of step 3021 in a lens adjustment method provided by the present application;
FIG. 7 is a schematic flow chart of another lens adjustment method provided herein;
FIG. 8 is a schematic flow chart of another lens adjustment method provided herein;
FIG. 9 shows a schematic flow chart of another lens adjustment method provided herein;
FIG. 10 shows a schematic flow chart of another lens adjustment method provided herein;
FIG. 11 is a schematic view of an adjustment device for a lens provided herein;
fig. 12 is a schematic diagram of an image pickup apparatus provided by an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
Functional lenses commonly found on the market today include, but are not limited to, polarizing or filtering lenses, and the like. The polarizing lens is mainly used for eliminating dazzling reflected light and scattered light, and converting messy light into parallel light, so that objects to be seen are clearer and softer. Filter lenses are optical devices used to select a desired wavelength band of radiation. Different functional lenses are used in different scenes.
The lens adjusting method is suitable for various application scenes, such as a monitoring fishpond and the like. In order to better explain the technical scheme of the application, the application only takes monitoring of the fish pond as an example to explain the technical scheme of the application.
In a fish pond monitoring scene, due to the fact that a large number of light reflection factors exist on the water surface, images collected by the camera equipment are overexposed, and the image effect is poor.
In view of the above, embodiments of the present application provide a lens adjustment method and apparatus, an image capturing device, and a computer-readable storage medium, which can solve the above technical problems.
The execution main body of the lens adjusting method is the image pickup equipment, and the image pickup equipment can be equipment with an image pickup function, such as a camera or a video camera.
In order to better explain the technical solution of the present application, a mechanical configuration of the image pickup apparatus is briefly described here. Referring to fig. 1, fig. 1 shows a schematic view of a mechanical configuration of an image pickup apparatus provided by the present application. As shown in fig. 1, the image pickup apparatus includes a lens 11, a functional lens 12, an outer edge gear 121, a transmission gear 131, and a motor 13. The motor 13 is used to rotate the transmission gear 131, so that the transmission gear 131 rotates the outer edge gear 121, thereby rotating the functional lens 12. The functional lens 12 rotates around the axis of the lens, and the rotation direction of the functional lens is two sides or the extension direction of the central axis of the lens 11 (since different types of lenses are suitable for different rotation modes, the present embodiment provides two rotation modes). If the rotation directions of the functional lens are both sides of the central axis of the lens 11, please refer to fig. 2, in which fig. 2 shows a schematic diagram of the rotation of the functional lens provided in the present application. As shown in the front view of the functional lens in fig. 2, the arrow indicates that the current direction of the functional lens, i.e. the plane in which the functional lens is located, is unchanged and rotates on the plane in which the functional lens is located. If the rotation direction of the functional lens is the extension direction of the central axis of the lens 11, please refer to fig. 3, in which fig. 3 shows a schematic view of the rotation of the functional lens provided in the present application, and if the functional lens rotates along the extension direction of the central axis as shown in fig. 3, the plane of the functional lens changes. It should be emphasized that fig. 1 and 3 are only schematic in terms of the mechanical configuration and the positions and the number of the components of the image capturing apparatus, and the mechanical configuration and the positions and the number of the components of the image capturing apparatus are not limited in any way.
The functional lens in the present application includes, but is not limited to, a polarizing lens, a filter lens, or the like. In order to better explain the technical solution of the present application, the present application takes a functional lens as an example of a polarizing lens for explanation. Wherein, when the functional lens is a polarized lens, the rotation direction is shown in fig. 2.
Under the hardware environment, the application provides a lens adjusting method. Referring to fig. 4, fig. 4 is a schematic flow chart illustrating an adjusting method of a lens provided in the present application.
As shown in fig. 4, the method may include the steps of:
step 401, collecting a plurality of polarization images in the same scene; the polarized image is an image acquired by the functional lens when the functional lens is positioned at different first angles.
The camera device collects the polarization image by controlling the angle of the functional lens to penetrate the functional lens at different first angles. The manner in which the image capture apparatus controls the functional lens may be:
directly controlling the functional lens to rotate to a preset angle according to the preset angle.
And secondly, in the process that the camera equipment controls the functional lens to rotate in the first angle range, acquiring a polarization image according to preset precision. For example: the functional lens collects one polarization image every 5 degrees of rotation, and if the first angle range is 0 to 180 degrees, 36 polarization images are collected. In the actual acquisition process, the corresponding images can be acquired at uniform time points according to the rotation angular velocity, and the deflection image corresponding to each angle can be obtained.
It is emphasized that the different first angles are in the first angle range (in order to distinguish the large-amplitude rotation range from the small-amplitude rotation range, the large-amplitude rotation range is referred to as the first angle range, and the small-amplitude rotation range is referred to as the second angle range). The first angle range includes, but is not limited to, 0 to 90 degrees, 0 to 180 degrees, 0 to 360 degrees, and the like. Preferably, the first angle range is 0 to 180 degrees, since 0 to 180 degrees can cover all angles of light.
Step 402, calculating a first quality score of the polarized image according to the first image information of the polarized image.
Because the filtering effect on light is different when the functional lens is at different angles. Therefore, the image effects of the polarization images acquired at different angles are different. The image capture apparatus can evaluate the first quality score of each polarization image based on the first image information. The first quality score is used to characterize the imaging quality of each polarization image.
The first image information includes, but is not limited to, a combination of one or more of gain information, contrast information, color temperature information, and saturation information.
When the first image information is single information, the first quality score corresponding to the polarization image can be directly matched according to the numerical value corresponding to the single information. When the first image information is a plurality of information, a first quality score can be obtained through the scoring model (i.e., the gain information, the contrast information, and the saturation information are used as the input of the scoring model, and the first quality score output by the scoring model is obtained). When the first image information is a plurality of pieces of information, the first quality score can also be calculated by a preset formula, and the process is as follows:
as an alternative embodiment of the present application, step 402 comprises the following steps. Referring to fig. 5, fig. 5 is a specific schematic flowchart illustrating step 402 of a lens adjusting method provided in the present application.
In order to better explain the technical solution of the present application, the present application takes the first image information as the first gain information, the first contrast information, and the first saturation information as an example, and explains the technical solution of the present application.
Step 4021, acquiring first gain information, first contrast information, and first saturation information.
The first gain information, the first contrast information, and the first saturation information may be directly read by built-in software, but the built-in software cannot be read because of a limited calculation power or running capability of part of the image pickup apparatus. In order to solve the problem, the method calculates the first gain information, the first contrast information and the first saturation information by a built-in algorithm, and comprises the following steps:
as an alternative embodiment of the present application, step 4021 includes the following steps. Referring to fig. 6, fig. 6 shows a specific schematic flowchart of a step 4021 in an adjustment method of a lens provided by the present application.
Step a1, reading the first gain information in a digital signal processor.
The gain information is a standard image signal that the image pickup apparatus can output in order to be able to output under different illuminance conditions of the subject, and the exposure amount of the image is increased by the gain of the amplifier. The first gain information can be read directly in the digital signal processor DSP.
Step A2, obtaining the first contrast information according to the brightness of a plurality of pixel points in the polarization image.
The camera device collects the brightness of two or more than two pixel points, and calculates first contrast information according to the brightness of the pixel points.
As an optional embodiment of the application, because scenes acquired by the plurality of polarization images are basically consistent, when the first contrast information corresponding to each polarization image is acquired, the point-taking positions of the pixel points can be kept consistent, so that the transverse contrast among the plurality of polarization images is ensured, and the scoring accuracy is further improved.
Step A3, inputting the color component of the polarization image into a scoring model, and obtaining first saturation information corresponding to the polarization image output by the scoring model.
The color components of different color models are different, for example, the color components of the RGB mode are R channel, G channel and B channel. The color modes used in the present application include, but are not limited to, RGB mode, HSB mode, YUV mode, CMYK mode, Lab mode, and the like.
Exemplarily, taking an RGB mode as an example, inputting an R channel, a G channel, and a B channel into a scoring model, and obtaining first saturation information corresponding to the polarization image output by the scoring model.
Wherein, the scoring model is a pre-trained model, and the training process is as follows: a plurality of sample images are obtained from an existing database, and the saturation of each sample image is estimated to obtain the target saturation. And inputting each sample image into the initial model to obtain an evaluation result output by the initial model. And calculating an error according to the evaluation result and the target saturation corresponding to the sample image. And adjusting the parameters of the initial model according to the error. And repeating the process to train the initial model through a plurality of sample images to obtain the trained scoring model.
Step 4022, substituting the first gain information, the first contrast information and the first saturation information into a preset formula to obtain the first quality score.
The present embodiment provides two preset formulas:
the first method comprises the following steps: the first gain information, the first contrast information, and the first saturation information may be added to obtain a first quality score. Since different image information has different influences on the image effect, the first quality score can be calculated by the following preset formula in order to better evaluate the image effect.
And the second method comprises the following steps: calculating the score by a preset formula as follows:
Score=a·G+b·Cr+c·Sa
wherein Score represents the first quality Score, a, b, and c represent fixed parameters, G represents the first gain information, Cr represents the first contrast information, and Sa represents the first saturation information.
It should be noted that the fixed parameters a, b, and c are set according to the influence of different image information on the image effect. The specific values of a, b and c can be determined by statistical methods or experimental data. The influence of different image information on the scoring result is adjusted through a, b and c, so that the calculation accuracy is improved.
Step 303, taking the first angle corresponding to the polarization image with the largest first quality score as a target angle.
After the first quality score corresponding to each polarization image is calculated, a plurality of first quality scores are obtained. And finding the maximum value in all the first quality scores, and taking the first angle corresponding to the polarization image with the maximum first quality score as a target angle. If the number of the first quality score maximum values is multiple, the first quality score maximum values can be selected randomly, or can be selected according to the sequence of rotation, or can be selected according to the amplitude of rotation.
Step 404, adjusting the functional lens to the target angle.
In the embodiment, a plurality of polarization images in the same scene are acquired; the polarized image is an image collected by the functional lens when the functional lens is positioned at different first angles; calculating a first quality score of the polarization image according to first image information of the polarization image; taking a first angle corresponding to the polarization image with the maximum first quality score as a target angle; adjusting the functional lens to the target angle. According to the scheme, the images collected by the functional lenses penetrating through different angles are scored, and then the angles of the functional lenses are controlled according to the scores. Compared with the traditional technical scheme, the angle of the functional lens can be adjusted according to the image effect, so that the state of the light which changes from time to time can be adapted, and the effect of inhibiting light pollution is further improved.
Optionally, on the basis of the embodiment shown in fig. 4, after the functional lens is adjusted to the target angle, the following steps are further included, please refer to fig. 7, and fig. 7 shows a schematic flowchart of another lens adjustment method provided in this application. In this embodiment, steps 701 to 704 are the same as steps 401 to 404 in the embodiment shown in fig. 4, and specific reference is made to the description related to steps 401 to 404 in the embodiment shown in fig. 4, which is not repeated herein.
Step 701, collecting a plurality of polarization images in the same scene; the polarized image is an image acquired by the functional lens when the functional lens is positioned at different first angles.
Step 702, calculating a first quality score of the polarization image according to the first image information of the polarization image.
Step 703, taking the first angle corresponding to the polarization image with the largest first quality score as a target angle.
Step 704, adjusting the functional lens to the target angle.
Step 705, repeating the step of acquiring multiple polarization images in the same scene and the subsequent steps at preset time points or at preset time intervals.
Since the light angle in nature changes in real time, the embodiment repeats steps 701 to 704 at a predetermined time point or at predetermined time intervals. To adjust the angle of the functional lens in real time.
It should be noted that, in the process of repeatedly performing steps 701 to 704, the value of the first angle is not constant, and may be adjusted according to the angle change rule of the light every day to reduce the amount of unnecessary calculation.
In this embodiment, the step of acquiring a plurality of polarization images of the same scene and the subsequent steps are repeatedly performed at a preset time point. The angle of the functional lens is adjusted in real time in the mode so as to adapt to real-time change of the light angle.
Optionally, on the basis of the embodiment shown in fig. 4, after the functional lens is adjusted to the target angle, the following steps are further included, please refer to fig. 8, and fig. 8 shows a schematic flowchart of another lens adjustment method provided in this application. In this embodiment, steps 801 to 804 are the same as steps 401 to 404 in the embodiment shown in fig. 4, and please refer to the related description of steps 401 to 404 in the embodiment shown in fig. 4, which is not described herein again.
Step 801, collecting a plurality of polarization images in the same scene; the polarized image is an image acquired by the functional lens when the functional lens is at different first angles.
Step 802, calculating a first quality score of the polarization image according to the first image information of the polarization image.
And 803, taking the first angle corresponding to the polarization image with the maximum first quality score as the target angle.
Step 804, adjusting the functional lens to the target angle.
Step 805, controlling the functional lens to rotate to both sides of the current angle by preset angles by taking the current angle as an anchor point.
This embodiment is a parallel solution to the embodiment shown in fig. 7, i.e. the present application is an alternative to the embodiment shown in fig. 7. This embodiment may also be a scheme executed after the embodiment shown in fig. 7, so as to perform fine adjustment on the lens after the embodiment shown in fig. 7 (since each first angle interval is larger in consideration of the calculation cost in the embodiment shown in fig. 7, the optimal angle may not be found, and therefore, this embodiment may be executed after the embodiment shown in fig. 7).
In this embodiment, it is considered that the light changes regularly in nature (such as under sunset). Therefore, the light changes only around the original angle in a short time. Therefore, the current optimal angle can be found only by fine adjustment around the target angle.
In the embodiment, the preset angle is finely adjusted left and right at two sides of the current angle, a plurality of subsequent images in the fine adjustment process are collected, and the second angle corresponding to the subsequent image to which the maximum value of the second quality score belongs is selected as the subsequent angle according to the second quality score of the subsequent images.
Wherein the current angle refers to the angle at which the functional lens is located when step 805 is performed. Since the functional lens may be rotated by manual intervention or other interference factors after step 804 is performed, resulting in a shift in the lens position, in order to better distinguish the two angles, the angle in step 804 is referred to as the target angle, and the angle in step 805 is referred to as the current angle. I.e., the current angle may or may not be the target angle.
The preset angle refers to a specific numerical value preset according to the change rule of light rays and used for fine adjustment of the functional lens. The preset angle may be determined according to different application scenarios, and is not limited herein.
Illustratively, assuming the current angle is 60 ° (degrees) and the preset angle is 5 ° (degrees), the functional lens is rotated between 65 ° (degrees) and 55 ° (degrees) for the purpose of fine left-right adjustment.
806, collecting a plurality of subsequent images in the process that the functional lens rotates towards the two sides of the current angle by a preset angle; the subsequent image is an image captured through the functional lens when the functional lens is at a second, different angle.
In order to achieve the purpose of fine tuning, the acquisition frequency of the subsequent images in this embodiment can be set to a larger value. The acquisition frequency may also be set to the same value as in the embodiments of fig. 4 and 7, which is not limited herein.
After acquiring the subsequent images, the calculation process is similar to the embodiment shown in fig. 4, and is not described herein again.
In step 807, a second quality score corresponding to the subsequent image is calculated according to the second image information of the subsequent image.
And 808, taking a second angle corresponding to the subsequent image to which the maximum second quality score belongs as a subsequent angle.
Step 809, adjusting the functional lens to the subsequent angle.
In the embodiment, a plurality of subsequent images in the same scene are acquired; calculating a second quality score corresponding to the subsequent image according to second image information of the subsequent image; taking a second angle corresponding to a subsequent image to which the second quality score maximum value belongs as a subsequent angle; adjusting the functional lens to the subsequent angle. According to the scheme, the optimal angle is searched in a fine adjustment mode, and large-range calculation is not needed, so that unnecessary calculation amount is reduced, and calculation efficiency is improved.
Optionally, on the basis of the embodiment shown in fig. 8, the method further includes the following steps, please refer to fig. 9, and fig. 9 shows a schematic flowchart of another lens adjustment method provided in the present application. Step 901, step 902, step 903, step 904, step 907, step 908, step 909, and step 910 in this embodiment are the same as steps 801 to 808 in the embodiment shown in fig. 8, and specific reference is made to the description related to steps 801 to 808 in the embodiment shown in fig. 8, which is not repeated herein.
Step 901, collecting a plurality of polarization images in the same scene; the polarized image is an image acquired by the functional lens when the functional lens is positioned at different first angles.
Step 902, calculating a first quality score of the polarization image according to the first image information of the polarization image.
Step 903, taking the first angle corresponding to the polarization image with the largest first quality score as a target angle.
Step 904, adjusting the functional lens to the target angle.
Step 905, obtain second gain information, second contrast information, and second saturation information.
Since natural light changes are a slow process, no real-time adjustment is required. The embodiment is added with trigger logic on the basis of the embodiment shown in fig. 8. The specific process is as follows:
the image pickup apparatus acquires current second gain information, second contrast information, and second saturation information.
Step 906, substituting the second gain information, the second contrast information, and the second saturation information into a preset formula to obtain a third quality score.
And 907, if the difference between the third quality score and the first quality score is greater than a threshold value, acquiring a plurality of subsequent images in the same scene.
If the difference between the third quality score and the first quality score is not greater than the threshold, then no subsequent steps need to be performed.
Step 908, calculating a second quality score corresponding to the subsequent image according to the second image information of the subsequent image.
In step 909, the second angle corresponding to the subsequent image to which the maximum second quality score belongs is used as the subsequent angle.
Step 910, adjusting the functional lens to the subsequent angle.
In this embodiment, second gain information, second contrast information, and second saturation information are acquired; substituting the second gain information, the second contrast information and the second saturation information into a preset formula to obtain a third quality score; and if the difference value between the third quality score and the first quality score is larger than a threshold value, executing the step of acquiring a plurality of subsequent images in the same scene and the subsequent steps. Through the method, the flow of angle adjustment is triggered, so that unnecessary calculation is reduced.
Optionally, on the basis of the embodiment shown in fig. 4, after the functional lens is adjusted to the target angle, the method further includes the following steps, please refer to fig. 10, and fig. 10 shows a schematic flowchart of another lens adjustment method provided in the present application. In this embodiment, steps 1001 to 1004 are the same as steps 401 to 404 in the embodiment shown in fig. 4, and please refer to the related description of steps 401 to 404 in the embodiment shown in fig. 4, which is not described herein again.
Step 1001, collecting a plurality of polarization images in the same scene; the polarized image is an image acquired by the functional lens when the functional lens is at different first angles.
Step 1002, calculating a first quality score of the polarization image according to the first image information of the polarization image.
And 1003, taking a first angle corresponding to the polarization image with the maximum first quality score as a target angle.
Step 1004, adjusting the functional lens to the target angle.
And 1005, repeatedly executing the step of acquiring the plurality of polarization images in the same scene and the subsequent steps at different moments within a preset time length to obtain a target angle corresponding to each moment.
Step 1006, training a preset model according to each moment and a target angle corresponding to each moment to obtain a trained preset model; and the trained preset model is used for predicting a target angle according to the time information.
The embodiment is through the law of learning the light change to adjust the angle of follow-up functional lens through the law, specific process is as follows:
first, a pre-model is trained: and training the preset model by taking the target angle corresponding to each moment obtained in the step 1005 and each moment as sample data to obtain the trained preset model.
Finally, when the functional lens is adjusted subsequently, only the current time information needs to be input into the trained preset model, and the predicted target angle corresponding to the current time information can be obtained. And then adjusting the functional lens according to the predicted target angle.
In this embodiment, the step of acquiring a plurality of polarization images in the same scene and the subsequent steps are repeatedly executed at different times within a preset time duration, so as to obtain a target angle corresponding to each time. Training a preset model according to each moment and a target angle corresponding to each moment to obtain a trained preset model; and the trained preset model is used for predicting a target angle according to the time information. Through the mode, the light change rule is learned, the target angle is predicted according to the rule, the state of light changing from time to time can be adapted, and the effect of inhibiting light pollution is further improved.
Fig. 11 shows a schematic view of an adjusting device 11 for a lens according to the present application, and fig. 11 shows a schematic view of an adjusting device for a lens according to the present application, where the adjusting device for a lens shown in fig. 11 includes:
the acquisition unit 111 is used for acquiring a plurality of polarization images in the same scene; the polarized image is an image collected by the functional lens when the functional lens is positioned at different first angles;
a calculating unit 112, configured to calculate a first quality score of the polarization image according to the first image information of the polarization image;
a selecting unit 113, configured to use a first angle corresponding to the polarization image with the largest first quality score as a target angle;
an adjusting unit 114, configured to adjust the functional lens to the target angle.
The adjusting device for the lens collects a plurality of polarization images in the same scene; the polarized image is an image collected by the functional lens when the functional lens is positioned at different first angles; calculating a first quality score of the polarization image according to first image information of the polarization image; taking a first angle corresponding to the polarization image with the maximum first quality score as a target angle; adjusting the functional lens to the target angle. According to the scheme, the images collected by the functional lenses penetrating through different angles are scored, and then the angles of the functional lenses are controlled according to the scores. Compared with the traditional technical scheme, the angle of the functional lens can be adjusted according to the image effect, so that the state of the light which changes from time to time can be adapted, and the effect of inhibiting light pollution is further improved.
Fig. 12 is a schematic diagram of an image pickup apparatus provided by an embodiment of the present invention. As shown in fig. 12, an image pickup apparatus 12 of the embodiment includes: a camera module 120, a processor 121, a memory 122 and a computer program 123, such as a lens adjustment program, stored in the memory 122 and executable on the processor 121. The processor 121, when executing the computer program 123, implements the steps in each of the above-described lens adjustment method or target detection method embodiments, such as steps 401 to 404 shown in fig. 4. Alternatively, the processor 121, when executing the computer program 123, implements the functions of the units in the device embodiments, such as the functions of the units 111 to 114 shown in fig. 11.
Illustratively, the computer program 123 may be divided into one or more units, which are stored in the memory 122 and executed by the processor 121 to accomplish the present invention. The unit or units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 123 in the one type of camera device 12. For example, the computer program 123 may be divided into an acquisition unit and a calculation unit, each unit having the following specific functions:
the acquisition unit is used for acquiring a plurality of polarization images under the same scene; the polarized image is an image collected by the functional lens when the functional lens is positioned at different first angles;
the calculating unit is used for calculating a first quality score of the polarization image according to the first image information of the polarization image;
the selecting unit is used for taking a first angle corresponding to the polarization image with the largest first quality score as a target angle;
and the adjusting unit is used for adjusting the functional lens to the target angle.
The image pickup device can be a digital camera, a single lens reflex camera, a video camera, a mobile phone or a tablet computer and other devices with a photographing function.
The image capturing apparatus may include, but is not limited to, a processor 121 and a memory 122. Those skilled in the art will appreciate that fig. 12 is merely an example of one type of camera device 12, and does not constitute a limitation of one type of camera device 12, and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the one type of camera device may also include input-output devices, network access devices, buses, etc.
The camera module 120 is used for acquiring a plurality of biased images in the same scene or acquiring a plurality of subsequent images in the same scene.
The Processor 121 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 122 may be an internal storage unit of the image pickup apparatus 12, such as a hard disk or a memory of the image pickup apparatus 12. The memory 122 may also be an external storage device of the image capturing apparatus 12, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the image capturing apparatus 12. Further, the memory 122 may also include both an internal storage unit and an external storage device of the image pickup apparatus 12. The memory 122 is used to store the computer program and other programs and data required by the one type of image pickup apparatus. The memory 122 may also be used to temporarily store data that has been output or is to be output.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by functions and internal logic of the process, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It should be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is only used for illustration, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the apparatus may be divided into different functional units or modules to perform all or part of the above described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the present application. For the specific working processes of the units and modules in the system, reference may be made to the corresponding processes in the foregoing method embodiments, which are not described herein again.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the foregoing method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/camera, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the description of each embodiment has its own emphasis, and reference may be made to the related description of other embodiments for parts that are not described or recited in any embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical function division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
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.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to monitoring ". Similarly, the phrase "if it is determined" or "if [ a described condition or event ] is monitored" may be interpreted depending on the context to mean "upon determining" or "in response to determining" or "upon monitoring [ a described condition or event ]" or "in response to monitoring [ a described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should 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; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present application, and they should be construed as being included in the present application.

Claims (9)

1. A method of adjusting a lens, the method comprising:
acquiring a plurality of polarization images in the same scene; the polarized image is an image collected by the functional lens when the functional lens is positioned at different first angles;
calculating a first quality score of the polarization image according to first image information of the polarization image;
taking a first angle corresponding to the polarization image with the maximum first quality score as a target angle;
adjusting the functional lens to the target angle;
controlling the functional lens to rotate towards two sides of the current angle by preset angles by taking the current angle as an anchor point;
collecting a plurality of subsequent images in the process that the functional lens rotates towards the two sides of the current angle by a preset angle; the subsequent image is an image acquired through the functional lens when the functional lens is at a second different angle;
calculating a second quality score corresponding to the subsequent image according to second image information of the subsequent image;
taking a second angle corresponding to the subsequent image to which the second quality score maximum value belongs as a subsequent angle;
adjusting the functional lens to the subsequent angle.
2. The method of claim 1, wherein the first image information comprises first gain information, first contrast information, and first saturation information;
the calculating a first quality score corresponding to the polarization image according to the first image information of the polarization image includes:
acquiring first gain information, first contrast information and first saturation information;
and substituting the first gain information, the first contrast information and the first saturation information into a preset formula to obtain the first quality score.
3. The method of claim 2, wherein the obtaining the first gain information, the first contrast information, and the first saturation information comprises:
reading the first gain information in a digital signal processor;
obtaining the first contrast information according to the brightness of a plurality of pixel points in the polarization image;
and inputting the color components of the polarization image into an evaluation model to obtain first saturation information corresponding to the polarization image output by the evaluation model.
4. The method as claimed in claim 2, wherein said substituting the first gain information, the first contrast information, and the first saturation information into a predetermined formula to obtain the first quality score comprises:
calculating the first quality score by a preset formula as follows:
Score=a·G+b·Cr+c·Sa
wherein Score represents the first quality Score, a, b, and c represent fixed parameters, G represents the first gain information, Cr represents the first contrast information, and Sa represents the first saturation information.
5. The method of claim 1, further comprising, after said adjusting said functional lens to said target angle:
and repeatedly executing the step of acquiring a plurality of polarization images in the same scene and the subsequent steps at preset time points or at preset time intervals.
6. The method of claim 1, further comprising:
acquiring second gain information, second contrast information and second saturation information;
substituting the second gain information, the second contrast information and the second saturation information into a preset formula to obtain a third quality score;
and if the difference value between the third quality score and the first quality score is larger than a threshold value, executing the step of acquiring a plurality of subsequent images in the same scene and the subsequent steps.
7. The method of claim 1, further comprising:
repeatedly executing the step of acquiring a plurality of polarization images in the same scene and the subsequent steps at different moments within a preset time length to obtain a target angle corresponding to each moment;
training a preset model according to each moment and a target angle corresponding to each moment to obtain a trained preset model; and the trained preset model is used for predicting a target angle according to the time information.
8. An image pickup apparatus comprising an image pickup module, a memory, a processor, and a computer program stored in the memory and executable on the processor, the memory comprising an external memory and an internal memory, characterized in that the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a method according to any one of claims 1 to 7.
CN202011465799.3A 2020-12-14 2020-12-14 Lens adjusting method and device Active CN112672008B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011465799.3A CN112672008B (en) 2020-12-14 2020-12-14 Lens adjusting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011465799.3A CN112672008B (en) 2020-12-14 2020-12-14 Lens adjusting method and device

Publications (2)

Publication Number Publication Date
CN112672008A CN112672008A (en) 2021-04-16
CN112672008B true CN112672008B (en) 2022-09-06

Family

ID=75405571

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011465799.3A Active CN112672008B (en) 2020-12-14 2020-12-14 Lens adjusting method and device

Country Status (1)

Country Link
CN (1) CN112672008B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117651122B (en) * 2024-01-25 2024-04-19 浙江华创视讯科技有限公司 Method, equipment and storage medium for determining switching angle in image acquisition process

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203872262U (en) * 2014-06-04 2014-10-08 河海大学 Laser rotary type polarization information acquisition apparatus
CN104833425A (en) * 2015-04-24 2015-08-12 北京理工大学 Combination method of polarizer angles in polarization imaging system
CN111127384A (en) * 2018-10-15 2020-05-08 华东交通大学 Strong reflection workpiece vision measurement method based on polarization imaging

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009507248A (en) * 2005-07-11 2009-02-19 ニューロック オプティックス エルエルシー 2-panel liquid crystal system using circularly polarized light and polarized glasses suitable for 3D imaging
CN102663768B (en) * 2012-05-10 2014-11-05 合肥工业大学 Method for adaptively determining optimal polarization orientation in polarization vision system
CN107424146A (en) * 2017-06-28 2017-12-01 北京理工大学 A kind of infrared polarization method for objectively evaluating image quality and system
CN108234870B (en) * 2017-12-27 2019-10-11 Oppo广东移动通信有限公司 Image processing method, device, terminal and storage medium
WO2019220722A1 (en) * 2018-05-18 2019-11-21 ソニー株式会社 Solid-state imaging device, device and method for information processing, and calibration method
CN108900754A (en) * 2018-08-27 2018-11-27 广州大学 It is a kind of for eliminating the reflective photographic device of glasses mirror surface and its control method
CN110866904A (en) * 2019-11-08 2020-03-06 北京环境特性研究所 Evaluation method and device for infrared polarization reconstruction image

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203872262U (en) * 2014-06-04 2014-10-08 河海大学 Laser rotary type polarization information acquisition apparatus
CN104833425A (en) * 2015-04-24 2015-08-12 北京理工大学 Combination method of polarizer angles in polarization imaging system
CN111127384A (en) * 2018-10-15 2020-05-08 华东交通大学 Strong reflection workpiece vision measurement method based on polarization imaging

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
探索偏振镜在新闻演播室中的应用;王晟彬;《Eniertainment Technology》;20150330;全文 *

Also Published As

Publication number Publication date
CN112672008A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
CN110149482A (en) Focusing method, device, electronic equipment and computer readable storage medium
JP2020535764A (en) Methods for dual camera-based imaging, mobile terminals, and storage media
CN105578048B (en) A kind of quick focusing method and device, mobile terminal
JP5843454B2 (en) Image processing apparatus, image processing method, and program
EP3764317A1 (en) Depth image processing method and apparatus, and electronic device
US20170064184A1 (en) Focusing system and method
WO2017107841A1 (en) Method and device for camera automatic focus control
CN103119927B (en) Image processing device, image capture device, and image processing method
CN108055431B (en) Real-time field image acquisition system
CN110049237B (en) Camera anti-shake method and device, electronic equipment and computer storage medium
CN108093183B (en) Camera day and night mode switching method and terminal equipment
US8295609B2 (en) Image processing apparatus, image processing method and computer readable-medium
US10122909B2 (en) Auto-focus apparatus and method
CN112672008B (en) Lens adjusting method and device
CN111383278A (en) Calibration method, device and equipment for double cameras
JP2004325517A (en) Imaging unit
CN111405185B (en) Zoom control method and device for camera, electronic equipment and storage medium
CN115278103B (en) Security monitoring image compensation processing method and system based on environment perception
CN108040244B (en) Snapshot method and device based on light field video stream and storage medium
CN110392211B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN112272267A (en) Shooting control method, shooting control device and electronic equipment
CN109587392B (en) Method and device for adjusting monitoring equipment, storage medium and electronic device
CN113014876A (en) Video monitoring method and device, electronic equipment and readable storage medium
CN116416701A (en) Inspection method, inspection device, electronic equipment and storage medium
US7577351B2 (en) Image data processing method and apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant