Lens angle adjustment method, device, computer equipment and camera
By setting up an angle adjustment mechanism in the camera and adjusting the lens angle according to the deviation of the ghost image from the center of the image, the problem of ghost phenomenon in the camera imaging system is solved and high-quality imaging is achieved without losing real image information.
Patent Information
- Application Number
- CN202210101016.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-01-27
AI Technical Summary
In the camera imaging system, multiple reflections and refractions of external light sources in the lenses form ghosting phenomena, resulting in blurred images and reduced imaging quality. Existing technologies use image fusion methods to process this, but it is easy to lose real image information.
By setting up an angle adjustment mechanism in the camera, controlling the angle of the lens in multiple directions, obtaining the degree of deviation of the ghost image in the image to be corrected from the center of the image, determining the target adjustment method, and adjusting the angle of the lens so that the ghost image exceeds the imaging range. Avoid losing real image information.
It effectively eliminates ghost images in the camera imaging system and improves imaging quality without losing real image information.
Smart Images

Figure CN114640791B
Abstract
Description
Technical Field
[0001] The present application relates to the field of optical imaging technology, and in particular to a lens angle adjustment method, device, computer equipment and camera. Background Art
[0002] Typically, a camera imaging system includes lenses. Since external light sources are reflected and refracted multiple times in the lenses of the camera imaging system, ghosting occurs, which blocks part of the photographed object or scene. In severe cases, it may cause blurred images, affecting the image quality.
[0003] In the prior art, most of the methods used are image fusion to process captured images containing ghost images, thereby eliminating the ghost images in the captured images. However, this method usually processes the entire captured image, which is prone to loss of real image information of the entire captured image.
[0004] Therefore, how to eliminate ghost images in the camera imaging system without losing the real image information of the captured image is a problem that needs to be solved. Summary of the invention
[0005] In this embodiment, a lens angle adjustment method, device, computer equipment and camera are provided to eliminate ghost images in a camera imaging system.
[0006] In a first aspect, the present application provides a lens angle adjustment method, which is applied to a camera provided with an angle adjustment mechanism, wherein the angle adjustment mechanism is used to adjust the lens angle, and the method comprises:
[0007] Controlling the angle adjustment mechanism to adjust the angle of the lens along multiple directions starting from the first position, and acquiring the image to be corrected after adjustment along each angle;
[0008] Obtaining the degree of deviation between the ghost image and the image center in the image to be corrected at each angle;
[0009] determining a target adjustment method based on the degree of deviation;
[0010] The angle adjustment mechanism is controlled to take the first position as a starting point and adjust the angle of the lens in the target adjustment manner.
[0011] In one embodiment, obtaining the degree of deviation between the ghost image and the image center in the image to be corrected at each angle includes:
[0012] Obtaining the center point coordinates of the ghost image;
[0013] Obtaining a deviation distance between the center point and a boundary point of the image to be corrected;
[0014] The degree of deviation is determined based on the deviation distance.
[0015] In one embodiment, before controlling the angle adjustment mechanism to adjust the angle of the lens in multiple directions starting from the first position, the method further comprises:
[0016] Get the initial image;
[0017] Determining whether there is a ghost image in the initial image based on the grayscale difference between adjacent pixels in the initial image;
[0018] If so, the steps of controlling the angle adjustment mechanism to adjust the angle of the lens along multiple directions starting from the first position and obtaining the image to be corrected after adjustment along each angle are executed.
[0019] In one embodiment, the initial image includes multiple frames of images, and judging whether there is a ghost image in the initial image based on the grayscale difference between adjacent pixels in the initial image includes:
[0020] Acquire the coordinates of the first center point of the suspected ghost image based on the grayscale difference between adjacent pixels in each frame of the initial image;
[0021] Obtaining an average deviation value of the coordinates of the first center point in multiple frames of the initial image;
[0022] If the average deviation value is not greater than the preset threshold, it is determined that a ghost image exists in the initial image.
[0023] In one embodiment, after controlling the angle adjustment mechanism to take the first position as a starting point and adjust the angle of the lens in the target adjustment manner, the method further comprises:
[0024] Acquire a target image, wherein after adjusting the angle of the lens in the target adjustment manner, the lens is in a target position, and the target image is an image formed by the camera when the lens is in the target position;
[0025] Determining whether there is a ghost image in the target image;
[0026] If a ghost image exists, the target position is used as the first position, and the angle adjustment mechanism is controlled to adjust the angle of the lens in multiple directions starting from the first position, and the image to be corrected after adjustment at each angle is obtained.
[0027] In a second aspect, the present application further provides a camera, including a lens, an angle adjustment mechanism, a controller, and an imaging device, wherein:
[0028] The lens is used to isolate the internal structure of the camera from the outside;
[0029] The angle adjustment mechanism is used to receive control instructions from the controller and adjust the angle of the lens;
[0030] The imaging device is used to receive the external light source passing through the lens and perform imaging;
[0031] The controller is used to execute the aforementioned lens angle adjustment method.
[0032] In one embodiment, the angle adjustment mechanism includes a voice coil motor and a cam mechanism, wherein the voice coil motor is used to receive control instructions from the controller and drive the cam mechanism to rotate, and the cam mechanism is used to drive the lens to a preset position.
[0033] In one embodiment, the cam mechanism includes a horizontal cam mechanism and a vertical cam mechanism, the control instruction includes a horizontal control instruction and a vertical control instruction, the horizontal cam mechanism is used to drive the lens to rotate in the horizontal direction according to the horizontal control instruction, and the vertical cam mechanism is used to drive the lens to rotate in the vertical direction according to the vertical control instruction.
[0034] In a third aspect, the present application further provides a lens angle adjustment device, the device comprising:
[0035] A first adjustment module, used for controlling the angle adjustment mechanism to adjust the angle of the lens along multiple directions starting from the first position, and obtaining the image to be corrected after adjustment along each angle;
[0036] A deviation degree determination module is used to obtain the degree of deviation between the ghost image and the image center in the image to be corrected at each angle;
[0037] An adjustment mode determination module, used for determining a target adjustment mode based on the deviation degree;
[0038] The second adjustment module is used to control the angle adjustment mechanism to adjust the angle of the lens in the target adjustment manner with the first position as the starting point.
[0039] In a fourth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the lens angle adjustment method provided in the first aspect and any embodiment of the first aspect when executing the computer program.
[0040] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the lens angle adjustment method provided in the first aspect and any embodiment of the first aspect.
[0041] The above-mentioned lens angle adjustment method, device, computer equipment and camera use the angle adjustment mechanism in the camera to control the lens to adjust the angle in multiple directions with the first position of the lens as the starting point, and obtain each image to be corrected after the angle adjustment, so as to determine the position of the ghost image after the lens angle is changed by changing the refraction and reflection angles of the light source in the lens. Furthermore, the target adjustment method of the angle adjustment mechanism is determined according to the degree of deviation between the ghost image and the image center in each image to be corrected after the angle adjustment, and the change in the ghost image position can be determined according to the lens adjustment direction, and the target adjustment method is determined according to different changes. Furthermore, the angle adjustment mechanism adjusts the angle of the lens according to the target adjustment method so that the position of the ghost image in the image formed after the adjustment exceeds the imaging range of the camera, thereby eliminating the ghost image in the camera imaging system without losing the real information of the captured image. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0043] Figure 1 It is a hardware structure block diagram of a terminal of a lens angle adjustment method provided in an embodiment of the present application;
[0044] Figure 2 It is a schematic diagram of the ghost image imaging principle provided by an embodiment of the present application;
[0045] Figure 3 is a flow chart of a lens angle adjustment method provided in an embodiment of the present application;
[0046] Figure 4 is a schematic diagram of a horizontal cam mechanism provided in an embodiment of the present application;
[0047] Figure 5 is a schematic diagram of a vertical cam mechanism provided in an embodiment of the present application;
[0048] Figure 6 It is a partial structural schematic diagram of a camera provided in an embodiment of the present application;
[0049] Figure 7 It is a schematic diagram of a lens angle adjustment device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0052] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 is a hardware structure block diagram of a terminal of a lens angle adjustment method provided in an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0053] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the lens angle adjustment method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0054] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0055] When a camera is shooting a scene with a light source, abnormal ghost light sources are likely to appear around the light source in the final captured image, resulting in blurred imaging, thus affecting the image quality. Figure 2 is a schematic diagram of a ghost image imaging principle provided by an embodiment of the present application, such as Figure 2 As shown, in the camera imaging system, when the light source 201 passes through the lens 202 in the camera and undergoes multiple reflections and refractions, an actual image 205 and a ghost image 204 near the actual image 205 are formed on the imaging surface 203, which blocks part of the photographed object or scene, affecting the final imaging quality.
[0056] Therefore, how to eliminate ghost images in a camera imaging system to improve the imaging quality of the camera imaging system is a problem that needs to be solved.
[0057] In this embodiment, a lens angle adjustment method is provided. Figure 3 : is a flow chart of a lens angle adjustment method provided in an embodiment of the present application. The method is applied to a camera provided with an angle adjustment mechanism, and the angle adjustment mechanism is used to adjust the lens angle, such as Figure 3 As shown, the process includes the following steps:
[0058] Step S301: controlling the angle adjustment mechanism to adjust the angle of the lens along multiple directions starting from the first position, and obtaining the image to be corrected after adjustment along each angle.
[0059] Exemplarily, the angle adjustment mechanism is controlled to rotate the lens 0.2° clockwise in the horizontal direction with the first position of the lens as the starting point, so that the lens is in the first target position, and a first image to be corrected is obtained through a camera when the lens is in the first target position. Further, the angle adjustment mechanism is controlled to rotate the lens back to the first position.
[0060] Furthermore, the angle adjustment mechanism is controlled to rotate the lens 0.2° counterclockwise in the horizontal direction with the first position of the lens as the starting point, so that the lens is in the second target position, and a second image to be corrected is obtained through the camera when the lens is in the second target position. Further, the angle adjustment mechanism is controlled to rotate the lens back to the first position.
[0061] Furthermore, the angle adjustment mechanism is controlled to rotate the lens 0.2° clockwise in the vertical direction with the first position of the lens as the starting point, so that the lens is in a third target position, and a third image to be corrected is obtained through a camera when the lens is in the third target position. Further, the angle adjustment mechanism is controlled to rotate the lens back to the first position.
[0062] Furthermore, the angle adjustment mechanism is controlled to rotate the lens 0.2° counterclockwise in the vertical direction with the first position of the lens as the starting point, so that the lens is in a fourth target position, and a fourth image to be corrected is obtained through the camera when the lens is in the fourth target position. Further, the angle adjustment mechanism is controlled to rotate the lens back to the first position.
[0063] It should be noted that in the embodiment of the present application, only the preset angle of 0.2° is taken as an example for explanation. In actual applications, the preset angle can also be 0.3°, 1°, or other angles, which are not limited here. In addition, in the embodiment of the present application, the first position can be the initial installation position of the lens, or any position of the lens, which is not limited here.
[0064] Step S302: Obtain the degree of deviation between the ghost image and the image center in the image to be corrected at each angle.
[0065] Exemplarily, a first degree of deviation A between a ghost image in a first image to be corrected and the center of the first image to be corrected is obtained; a second degree of deviation B between a ghost image in a second image to be corrected and the center of the second image to be corrected is obtained; a third degree of deviation C between a ghost image in a third image to be corrected and the center of the third image to be corrected is obtained; and a fourth degree of deviation D between a ghost image in a fourth image to be corrected and the center of the fourth image to be corrected is obtained.
[0066] Step S303: Determine a target adjustment method based on the degree of deviation.
[0067] Specifically, the lens adjustment method corresponding to the maximum deviation degree is determined as the target adjustment method.
[0068] For example, if the first deviation degree A is the largest among the first deviation degree A, the second deviation degree B, the third deviation degree C and the fourth deviation degree D, the lens is rotated clockwise in the horizontal direction by a preset angle as the target adjustment method.
[0069] Step S304: controlling the angle adjustment mechanism to adjust the angle of the lens in a target adjustment manner starting from the first position.
[0070] Exemplarily, the angle adjustment mechanism is controlled to rotate the lens clockwise in the horizontal direction by a preset angle starting from the first position, and the rotated image to be corrected is obtained through the camera until there is no ghost image in the rotated image to be corrected.
[0071] In the above implementation process, the angle of the lens is adjusted in multiple directions through the angle adjustment mechanism, and the image to be corrected after each angle adjustment is obtained, and the target adjustment method of the lens is determined according to the degree of deviation between the ghost image in the image to be corrected and the center of the image to be corrected, so as to determine the position of the ghost image after the angle of the lens is changed by changing the refraction and reflection angles of the light source in the lens, and further determine the target adjustment method of the lens according to the change in the position of the ghost image, so that the position of the ghost image in the image formed after adjustment exceeds the imaging range of the camera, thereby eliminating the ghost image in the camera imaging system without losing the real information of the captured image, thereby further improving the imaging quality of the camera.
[0072] In one specific embodiment, obtaining the degree of deviation between the ghost image and the image center in the image to be corrected at each angle may include the following steps:
[0073] Step 1: Get the center point coordinates of the ghost image.
[0074] Specifically, the center coordinates of the ghost image can be obtained by any of the following methods:
[0075] Method 1: Obtain a single frame of image to be corrected, and determine the center coordinates of the ghost image in the single frame of image to be corrected as the center point coordinates of the ghost image.
[0076] Exemplarily, taking the first image to be corrected as an example, the angle adjustment mechanism is controlled to take the first position of the lens as the starting point, so that the lens is rotated 0.2° clockwise in the horizontal direction, and a frame of the first image to be corrected after the lens is rotated is obtained through the camera, and the center point coordinates of the ghost image in the frame of the first image to be corrected are calculated to obtain the center point coordinates of the ghost image in the first image to be corrected.
[0077] By analogy, the coordinates of the center points of the ghost images in the second image to be corrected, the third image to be corrected, and the fourth image to be corrected are calculated respectively in this way.
[0078] Method 2: obtaining multiple frames of images to be corrected, and determining the average value of the center point coordinates of the ghost images in the multiple frames of images to be corrected as the center point coordinates of the ghost images.
[0079] Exemplarily, taking the first image to be corrected as an example, the angle adjustment mechanism is controlled to take the first position of the lens as the starting point, so that the lens is rotated 0.2° clockwise in the horizontal direction, and five consecutive frames of the first image to be corrected after the lens is rotated are obtained through the camera, and the vertex of the lower left corner of each frame of the first image to be corrected is taken as the coordinate origin, and a coordinate system is established in units of pixels, and the coordinates of the center point of the ghost image in each frame of the first image to be corrected are calculated, which are (X1, Y1), (X2, Y2), (X3, Y3), (X4, Y4) and (X5, Y5), respectively. Furthermore, the average value of the coordinates of the center point of the five frames of ghost images is calculated to obtain the coordinates (X, Y) of the center point of the ghost image in the first image to be corrected. Then
[0080] By analogy, the coordinates of the center points of the ghost images in the second image to be corrected, the third image to be corrected, and the fourth image to be corrected are calculated respectively in this way.
[0081] It should be noted that in the embodiment of the present application, only five consecutive frames of images to be corrected are taken as an example for explanation. In actual applications, it can also be six consecutive frames of images to be corrected, or seven consecutive frames of images to be corrected, or five frames of images to be corrected can be obtained at an interval of one frame, or five frames of images to be corrected can be obtained at an interval of two frames, or other methods can be used to obtain multiple frames of images to be corrected, which are not limited here.
[0082] In the above implementation process, the coordinates of the center point of the ghost image of the image to be corrected are determined by the average value of the center coordinate points of the ghost images in multiple frames of the image to be corrected, which further improves the accuracy of the determined ghost image position.
[0083] Step 2: Obtain the deviation distance between the center point and the boundary point of the image to be corrected.
[0084] Step 3: Determine the degree of deviation based on the deviation distance.
[0085] Specifically, the corresponding deviation degree is determined according to the minimum value of the deviation distance.
[0086] It should be noted that the smaller the deviation distance between the center point of the ghost image and the boundary point of the image to be corrected, the greater the deviation degree between the ghost image and the image center in the image to be corrected.
[0087] Exemplarily, taking the first image to be corrected as an example, if the center point of the ghost image in the first image to be corrected is M, that is, the coordinates of M are (X, Y).
[0088] The four boundary points of the first image to be corrected are obtained as N1, N2, N3, and N4 respectively. Further, the distances of MN1, MN2, MN3, and MN4 are determined respectively, and the minimum value of the distances is determined as the first deviation distance between the ghost image in the first image to be corrected and the boundary point of the first image to be corrected.
[0089] If the first deviation distance between the ghost image in the first image to be corrected and the boundary point of the first image to be corrected is a, then a = min{MN1, MN2, MN3, MN4}, and the corresponding first deviation degree is A.
[0090] By analogy, the second deviation distance b between the ghost image in the second image to be corrected and the boundary point of the second image to be corrected is determined in the above manner, and the corresponding second deviation degree is B; the third deviation distance c between the ghost image in the third image to be corrected and the boundary point of the third image to be corrected, and the corresponding third deviation degree is C; the fourth deviation distance between the ghost image in the fourth image to be corrected and the boundary point of the fourth image to be corrected is d, and the corresponding fourth deviation degree is D.
[0091] If the order of the magnitudes of the above deviation distances is: a < b < c < d, then the order of the magnitudes of the corresponding deviation degrees is: the first deviation degree A > the second deviation degree B > the third deviation degree C > the fourth deviation degree D.
[0092] It should be noted that when the lens is in the first position, if the deviation distance between the ghost image in the image to be corrected and the corresponding boundary point of the image to be corrected is x, and a, b, c, and d are the deviation distances obtained after rotating in 4 directions with the first as the starting point respectively. Therefore, the minimum value of a, b, c, and d is less than x. That is, during the angle adjustment process, only the angle adjustment method corresponding to the minimum value of a, b, c, and d needs to be determined as the target adjustment method. Further, after adjusting the lens through the target adjustment method to obtain the image to be corrected, the deviation degree between the ghost image and the image center point will be greater than the deviation degree between the ghost image and the image center point in the image to be corrected obtained when the lens is in the first position.
[0093] In the above implementation process, the minimum deviation distance between the coordinates of the center point of the ghost image and the boundary point of the image to be corrected is taken to determine the degree of deviation between the ghost image and the image center. The degree of deviation can be quantified through the deviation distance, which facilitates further adjustment of the lens angle according to the shortest deviation distance, and facilitates quickly making the imaging position of the ghost image exceed the imaging range of the camera, thereby eliminating the ghost image in the camera imaging system.
[0094] In one specific embodiment, before the angle adjustment mechanism is controlled to adjust the angle of the lens in multiple directions starting from the first position, the following steps are also included:
[0095] Step 1: Get the initial image.
[0096] Exemplarily, the image acquired by the camera when the lens is in the first position is determined as the initial image.
[0097] Step 2: Based on the grayscale difference between adjacent pixels in the initial image, determine whether there is a ghost image in the initial image. If so, execute the steps of controlling the angle adjustment mechanism to adjust the angle of the lens in multiple directions starting from the first position, and obtain the image to be corrected after adjustment along each angle.
[0098] Exemplarily, the size between the grayscale difference of all adjacent pixels in the initial image and the preset grayscale difference is determined. If the grayscale difference of all adjacent pixels in the initial image is greater than the preset grayscale difference, then a ghost image exists in the initial image. If the grayscale difference of all adjacent pixels in the initial image is less than the preset grayscale difference, then no ghost image exists in the initial image.
[0099] Furthermore, if there is a ghost image in the initial image, execute the above step S301: control the angle adjustment mechanism to adjust the angle of the lens in multiple directions with the first position as the starting point; if there is no ghost image in the initial image, the camera takes the image with the lens in the first position, and there is no ghost image in the image obtained at this time.
[0100] Usually, in an image, the grayscale values of the pixels of the ghost image are greatly different from the grayscale values of the pixels of the non-ghost image, that is, there is a large difference in the grayscale values of the pixels in the boundary area between the ghost image and the non-ghost image. Therefore, in the above implementation process, it is possible to determine whether there is a boundary area between the ghost image and the non-ghost image in the initial image by judging the grayscale difference of all adjacent pixels in the initial image.
[0101] In another specific embodiment, the initial image includes multiple frames of images, and judging whether there is a ghost image in the initial image based on the grayscale difference between adjacent pixels in the initial image may further include the following steps:
[0102] Step 1: Obtain the coordinates of the first center point of the suspected ghost image based on the grayscale difference between adjacent pixels in each frame of the initial image.
[0103] Exemplarily, the initial image includes five frames of images, and the image area surrounded by all pixels whose grayscale difference between adjacent pixels in each frame of the initial image is greater than a preset grayscale difference is determined as a suspected ghost image, and the first center point coordinates of each frame of the suspected ghost image are calculated.
[0104] Step 2: Obtain the average deviation value of the coordinates of the first center point in multiple frames of initial images.
[0105] Exemplarily, if the coordinates of the first center points of the five frames of initial images are respectively m1(x1, y1), m2(x2, y2), m3(x3, y3), m4(x4, y4), and m5(x5, y5).
[0106] Calculate the distance m1m2 between m1 and m2, the distance m2m3 between m2 and m3, the distance m3m4 between m3 and m4, and the distance m4m5 between m4 and m5 respectively.
[0107] The average value of the distances between m1m2, m2m3, m3m4 and m4m5 is determined as the average deviation value of the coordinates of the first center point of the five frames of initial images.
[0108] As another example, the covariance value of the first center point coordinates of the five frames of initial images may be determined as the average deviation value of the first center point coordinates of the five frames of initial images.
[0109] Step 3: If the average deviation value is not greater than the preset threshold, it is determined that a ghost image exists in the initial image.
[0110] Exemplarily, if the average deviation value is not greater than a preset threshold, it indicates that a ghost image exists in the initial image; if the average deviation value is greater than the preset threshold, it indicates that a ghost image does not exist in the initial image.
[0111] In the above implementation process, judging whether there is a ghost image in the initial image based on the average deviation value of the coordinates of the center point of the ghost image in multiple frames of initial images can improve the accuracy of judging whether there is a ghost image in the initial image, and effectively avoid misjudgment of whether there is a ghost image due to external interference when shooting a certain frame of the initial image.
[0112] In one specific embodiment, after the angle adjustment mechanism is controlled to take the first position as a starting point and adjust the angle of the lens in a target adjustment manner, the following steps may also be included:
[0113] Step 1: Acquire a target image, wherein after adjusting the angle of the lens in a target adjustment manner, the lens is in a target position, and the target image is an image formed by the camera when the lens is in the target position.
[0114] Exemplarily, the target adjustment method is to rotate the lens clockwise in the horizontal direction by a preset angle, control the angle adjustment mechanism with the first position as the starting point, so that after the lens is rotated clockwise in the horizontal direction by a preset angle, the lens is in the target position, and obtain the target image of the lens in the target position through the camera.
[0115] Step 2: Determine whether there is a ghost image in the target image.
[0116] If a ghost image exists, the target position is used as the first position, and the angle adjustment mechanism is controlled to adjust the angle of the lens along multiple directions starting from the first position, and the image to be corrected after adjustment along each angle is obtained.
[0117] Exemplarily, whether there is a ghost image in the target image is determined based on the grayscale difference between adjacent pixels in the target image. Specifically, whether there is a ghost image in the target image can be determined based on a single-frame target image, or based on multiple-frame target images. This is similar to the method for determining whether there is a ghost image in the initial image, and will not be repeated here.
[0118] If a ghost image exists in the target image, the target position is determined as the first position, and the above step S301 is repeated: the angle adjustment mechanism is controlled to adjust the angle of the lens along multiple directions with the first position as the starting point, and the image to be corrected after adjustment along each angle is obtained until there is no ghost image in the target image.
[0119] In the above implementation process, when a ghost image exists in the target image, the target position is determined as the first position, and the steps of controlling the angle adjustment mechanism to adjust the angle of the lens in multiple directions with the re-determined first position as the starting point and obtaining the image to be corrected after adjustment along each angle are further repeated until there is no ghost image in the target image. By repeatedly adjusting the angle of the lens, the ghost image formed at different reflection and refraction angles after the light source is reflected and refracted multiple times in the lens exceeds the imaging range of the imaging surface, thereby achieving the purpose of eliminating ghost images in the camera imaging system.
[0120] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0121] In addition, an embodiment of the present application further provides a camera, which can be applied to the above-mentioned lens angle adjustment method. Specifically, the camera includes a lens, an angle adjustment mechanism, a controller, and an imaging device, wherein:
[0122] The lens is used to isolate the internal structure of the camera from the outside.
[0123] Exemplarily, the lens in the camera may be a transparent glass sheet for isolating the external environment from the internal mechanism of the camera.
[0124] The imaging device is used to receive the external light source passing through the lens and to form an image.
[0125] Exemplarily, the imaging device includes an imaging surface. When an external light source passes through a lens in a camera, not only an actual image of the light source is generated on the imaging surface, but also multiple reflections and refractions are generated in the lens, thereby generating a ghost image on the imaging surface.
[0126] The angle adjustment mechanism is used to receive control instructions from the controller and adjust the angle of the lens.
[0127] For example, when an external light source produces a ghost image on the imaging surface, it is necessary to change the angle of reflection and refraction of the light source in the lens so that the imaging position of the ghost image exceeds the imaging range of the imaging surface. Therefore, the angle adjustment mechanism can adjust the angle of the lens according to the control instructions of the controller, thereby achieving the purpose of changing the angle of reflection and refraction of the light source in the lens.
[0128] The controller is used to execute the lens angle adjustment method provided in any one of the above embodiments.
[0129] Exemplarily, a controller in a camera may be used to execute the lens angle adjustment method provided in any of the above embodiments to eliminate ghost images in the camera imaging system.
[0130] In the above implementation process, the angle adjustment structure adjusts the angle of the lens in the camera according to the control instructions of the controller, so that the external light source is refracted and reflected at different angles in the lens, thereby changing the position of the ghost image, and further facilitating multiple adjustments of the lens so that the imaging position of the ghost image exceeds the range of the imaging surface, thereby eliminating the ghost image in the camera imaging system.
[0131] In one embodiment, the angle adjustment mechanism includes a voice coil motor and a cam mechanism. The voice coil motor is used to receive control instructions from a controller and drive the cam mechanism to rotate. The cam mechanism is used to drive the lens to a preset position.
[0132] Exemplarily, the voice coil motor receives a control instruction from the controller and drives the cam mechanism to rotate in multiple directions, further driving the lens to rotate in multiple directions to reach a preset position.
[0133] In the above implementation process, the voice coil motor in the angle adjustment mechanism receives the control command of the controller and provides power to the cam mechanism according to the control command. The cam mechanism drives the lens to rotate, thereby providing power for the rotation of the lens.
[0134] In one specific embodiment, the cam mechanism includes a horizontal cam mechanism and a vertical cam mechanism, the control instruction includes a horizontal control instruction and a vertical control instruction, the horizontal cam mechanism is used to drive the lens to rotate in the horizontal direction according to the horizontal control instruction, and the vertical cam mechanism is used to drive the lens to rotate in the vertical direction according to the vertical control instruction.
[0135] For example, Figure 4 is a schematic diagram of a horizontal cam mechanism provided in an embodiment of the present application, such as Figure 4 In the embodiment, the horizontal cam mechanism 401 rotates in the horizontal direction according to the horizontal control instruction, and drives the lens 402 to rotate in the horizontal direction. Figure 5 is a schematic diagram of a vertical cam mechanism provided in an embodiment of the present application, such as Figure 5 In the embodiment, the vertical cam mechanism 501 rotates in the vertical direction according to the vertical control instruction, and drives the lens 402 to rotate in the vertical direction.
[0136] For example, the controller may send different control instructions to the angle adjustment mechanism according to the position of the lens. For example, during the lens angle adjustment process, the controller sends the following four control instructions to the angle adjustment mechanism respectively:
[0137] The control instruction C1 is used to rotate the lens 0.2° clockwise in the horizontal direction.
[0138] The control instruction C2 is used to rotate the lens 0.2° counterclockwise in the horizontal direction.
[0139] The control instruction C3 is used to rotate the lens 0.2° clockwise in the vertical direction.
[0140] The control instruction C4 is used to rotate the lens 0.2° counterclockwise in the vertical direction.
[0141] Among them, control instructions C1 and control instructions C2 are horizontal control instructions, and control instructions C3 and control instructions C4 are vertical control instructions. When the controller sends control instruction C1 to the angle adjustment mechanism, the voice coil motor in the angle adjustment mechanism receives the control instruction C1. Further, the voice coil motor drives the horizontal cam mechanism 401 to rotate 0.2° clockwise in the horizontal direction, thereby driving the lens to rotate 0.2° clockwise in the horizontal direction.
[0142] When the controller sends a control instruction C2 to the angle adjustment mechanism, the voice coil motor in the angle adjustment mechanism receives the control instruction C2. Further, the voice coil motor drives the horizontal cam mechanism 401 to rotate 0.2° counterclockwise in the horizontal direction, thereby driving the lens to rotate 0.2° counterclockwise in the horizontal direction.
[0143] When the controller sends a control instruction C3 to the angle adjustment mechanism, the voice coil motor in the angle adjustment mechanism receives the control instruction C3. Further, the voice coil motor drives the vertical cam mechanism 501 to rotate 0.2° clockwise in the vertical direction, thereby driving the lens to rotate 0.2° clockwise in the vertical direction.
[0144] When the controller sends a control instruction C4 to the angle adjustment mechanism, the voice coil motor in the angle adjustment mechanism receives the control instruction C4. Further, the voice coil motor drives the vertical cam mechanism 501 to rotate 0.2° counterclockwise in the vertical direction, thereby driving the lens to rotate 0.2° counterclockwise in the vertical direction.
[0145] In the above implementation process, the horizontal cam mechanism and the vertical cam mechanism are respectively provided, so that the lens can be rotated in the horizontal and vertical directions respectively, thereby realizing multi-directional adjustment of the lens.
[0146] In one embodiment, the camera also includes a horizontal fixed bracket and a vertical fixed bracket respectively connected to the lens and the angle adjustment mechanism. The horizontal fixed bracket is used to drive the lens to rotate in the horizontal direction based on the movement of the angle adjustment mechanism, and the vertical fixed bracket is used to drive the lens to rotate in the vertical direction based on the movement of the angle adjustment mechanism.
[0147] In one embodiment, the camera further includes a first bracket and a second bracket, the first bracket is used to limit the position of the lens in the camera, the lens and the angle adjustment mechanism are arranged on the second bracket, and the second bracket is used to fix the lens and the angle adjustment mechanism on the camera.
[0148] For example, Figure 6 is a partial structural diagram of a camera provided in an embodiment of the present application, such as Figure 6 The camera shown includes: a first bracket 601 and a second bracket 602, the first bracket 601 is used to limit the position of the lens 402 in the camera, the lens 402 and the angle adjustment mechanism are arranged on the second bracket 602, and the second bracket 602 is used to fix the lens 402 and the angle adjustment mechanism on the camera.
[0149] In the above implementation process, the lens is limited to a fixed position of the camera by the first bracket, ensuring that the external light source can be imaged in the camera through the lens, and the lens and the angle adjustment mechanism are fixed in the camera by the second bracket, which facilitates the angle adjustment of the lens during shooting.
[0150] Based on the same inventive concept, the embodiment of the present application also provides a lens angle adjustment device for implementing the lens angle adjustment method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more lens angle adjustment device embodiments provided below can refer to the limitations of the lens angle adjustment method above, and will not be repeated here.
[0151] In one embodiment, Figure 7 is a schematic diagram of a lens angle adjustment device provided in an embodiment of the present application, such as Figure 7 The lens angle adjustment device shown comprises:
[0152] The first adjustment module 701 is used to control the angle adjustment mechanism to adjust the angle of the lens along multiple directions starting from the first position, and obtain the image to be corrected after adjustment along each angle;
[0153] The deviation degree determination module 702 is used to obtain the deviation degree between the ghost image and the image center in the image to be corrected at each angle;
[0154] An adjustment mode determination module 703, used to determine a target adjustment mode based on the degree of deviation;
[0155] The second adjustment module 704 is used to control the angle adjustment mechanism to adjust the angle of the lens in a target adjustment manner starting from the first position.
[0156] In one embodiment, the deviation degree determination module 702 is specifically used to:
[0157] Get the center point coordinates of the ghost image;
[0158] Obtain the deviation distance between the center point and the boundary point of the image to be corrected;
[0159] The degree of deviation is determined based on the deviation distance.
[0160] In one embodiment, the first adjustment module 701 is further configured to:
[0161] Get the initial image;
[0162] Determine whether there is a ghost image in the initial image based on the grayscale difference of adjacent pixels in the initial image;
[0163] If so, the steps of controlling the angle adjustment mechanism to adjust the angle of the lens along multiple directions starting from the first position and obtaining the image to be corrected after adjustment along each angle are executed.
[0164] In one embodiment, the first adjustment module 701 is specifically used for:
[0165] Obtaining the coordinates of the first center point of the suspected ghost image based on the grayscale difference of adjacent pixels in each frame of the initial image;
[0166] Obtaining the average deviation value of the coordinates of the first center point in multiple frames of initial images;
[0167] If the average deviation value is not greater than the preset threshold, it is determined that a ghost image exists in the initial image.
[0168] In one embodiment, the first adjustment module 701 is further configured to:
[0169] Acquire a target image, wherein after the angle of the lens is adjusted in a target adjustment manner, the lens is at a target position, and the target image is an image formed by the camera when the lens is at the target position;
[0170] Determine whether there is a ghost image in the target image;
[0171] If a ghost image exists, the target position is used as the first position, and the angle adjustment mechanism is controlled to adjust the angle of the lens along multiple directions starting from the first position, and the image to be corrected after adjustment along each angle is obtained.
[0172] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0173] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0174] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0175] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program: Figure 3 The lens angle adjustment method shown.
[0176] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0177] In addition, in combination with the lens angle adjustment method provided in the above embodiments, a storage medium can also be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any lens angle adjustment method in the above embodiments is implemented.
[0178] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0179] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0180] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0181] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A lens angle adjustment method, characterized in that: Applied to a camera provided with an angle adjustment mechanism, the angle adjustment mechanism is used to adjust the angle of the lens, the method comprises: Controlling the angle adjustment mechanism to adjust the angle of the lens along multiple directions starting from the first position, and acquiring the image to be corrected after adjustment along each angle; Obtaining the degree of deviation between the ghost image and the image center in the image to be corrected at each angle; determining a target adjustment method based on the degree of deviation; The determining of the target adjustment mode based on the deviation degree includes: determining the lens adjustment mode corresponding to the maximum deviation degree as the target adjustment mode; The angle adjustment mechanism is controlled to take the first position as a starting point and adjust the angle of the lens in the target adjustment manner.
2. The lens angle adjustment method according to claim 1, characterized in that: The step of obtaining the degree of deviation between the ghost image and the image center in the image to be corrected at each angle includes: Obtaining the center point coordinates of the ghost image; Obtaining a deviation distance between the center point and a boundary point of the image to be corrected; The degree of deviation is determined based on the deviation distance.
3. The lens angle adjustment method according to claim 1, characterized in that: Before controlling the angle adjustment mechanism to adjust the angle of the lens in multiple directions starting from the first position, the method further includes: Get the initial image; Determining whether there is a ghost image in the initial image based on the grayscale difference between adjacent pixels in the initial image; If so, the steps of controlling the angle adjustment mechanism to adjust the angle of the lens along multiple directions starting from the first position and obtaining the image to be corrected after adjustment along each angle are executed.
4. The lens angle adjustment method according to claim 3, characterized in that: The initial image includes multiple frames of images, and judging whether there is a ghost image in the initial image based on the grayscale difference between adjacent pixels in the initial image includes: Acquire the coordinates of the first center point of the suspected ghost image based on the grayscale difference between adjacent pixels in each frame of the initial image; Obtaining an average deviation value of the coordinates of the first center point in multiple frames of the initial image; If the average deviation value is not greater than the preset threshold, it is determined that a ghost image exists in the initial image.
5. The lens angle adjustment method according to claim 1, characterized in that: After controlling the angle adjustment mechanism to take the first position as a starting point and adjust the angle of the lens in the target adjustment manner, the method further includes: Acquire a target image, wherein after adjusting the angle of the lens in the target adjustment manner, the lens is in a target position, and the target image is an image formed by the camera when the lens is in the target position; Determining whether there is a ghost image in the target image; If a ghost image exists, the target position is used as the first position, and the angle adjustment mechanism is controlled to adjust the angle of the lens in multiple directions starting from the first position, and the image to be corrected after adjustment at each angle is obtained.
6. A camera, characterized in that: The invention comprises a lens, an angle adjustment mechanism, a controller and an imaging device, wherein: The lens is used to isolate the internal structure of the camera from the outside; The angle adjustment mechanism is used to receive control instructions from the controller and adjust the angle of the lens; The imaging device is used to receive the external light source passing through the lens and perform imaging; The controller is used to execute the lens angle adjustment method according to any one of claims 1-5.
7. The camera according to claim 6, characterized in that The angle adjustment mechanism includes a voice coil motor and a cam mechanism. The voice coil motor is used to receive control instructions from the controller and drive the cam mechanism to rotate. The cam mechanism is used to drive the lens to a preset position.
8. The camera according to claim 7, characterized in that The cam mechanism includes a horizontal cam mechanism and a vertical cam mechanism, and the control instruction includes a horizontal control instruction and a vertical control instruction. The horizontal cam mechanism is used to drive the lens to rotate in the horizontal direction according to the horizontal control instruction, and the vertical cam mechanism is used to drive the lens to rotate in the vertical direction according to the vertical control instruction.
9. A lens angle adjustment device, characterized in that: The device comprises: A first adjustment module, used for controlling the angle adjustment mechanism to adjust the angle of the lens along multiple directions starting from the first position, and obtaining the image to be corrected after adjustment along each angle; A deviation degree determination module is used to obtain the degree of deviation between the ghost image and the image center in the image to be corrected at each angle; An adjustment mode determination module, used for determining a target adjustment mode based on the deviation degree; The adjustment mode determination module is specifically used to: determine the lens adjustment mode corresponding to the maximum deviation as the target adjustment mode; the second adjustment module is used to control the angle adjustment mechanism to take the first position as the starting point and adjust the angle of the lens in the target adjustment mode.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the lens angle adjustment method according to any one of claims 1 to 5 are implemented.
