Method and device for adjusting camera
By acquiring and analyzing the target image and distance information in video conferencing and adjusting the camera's lens and sensor, the problem of less application of TOF sensors in the field of video conferencing is solved, and a clearer video conferencing picture is achieved.
Patent Information
- Application Number
- CN202510025280.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-06
AI Technical Summary
TOF sensors are less used in the video conferencing field, mainly due to their less use in zoom lenses.
By obtaining the target image taken by the target lens on the target camera and the target distance measured by the target sensor, the camera is adjusted based on this information, including adjusting the rotation angle of the lens, the rotation angle of the sensor, and the motion trajectory of the lens to improve the clarity of the shooting image.
Adjusting the camera in video conferencing through the TOF sensor significantly improves the picture clarity of the camera shooting, solving the problem of less application of TOF sensors in the field of video conferencing.
Smart Images

Figure CN119946408A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer vision technology, and in particular to a method and device for adjusting a camera. Background Art
[0002] In the time-of-flight sensor (TOF) assisted focusing technology, the distance of the measured object is obtained. Using this distance information, phase focusing of the measured object can be achieved, thereby improving the resolution and clarity of the image. TOF assisted focusing technology has been widely used in medical imaging, industrial inspection, robot vision and other fields. Compared with traditional phase focusing technology, TOF assisted focusing technology has the advantages of fast distance measurement, high accuracy, and low interference with light. It is a more efficient and accurate phase focusing technology. TOF depth cameras and their autofocus methods are widely used in cameras. The main disadvantages are as follows: Currently, the application scenarios are mostly in the mobile phone field, and have not been widely used in the video conferencing field; they are mainly used for focusing lenses, and zoom lenses are rarely used.
[0003] There is currently no effective solution to the above problems. Summary of the invention
[0004] The embodiments of the present invention provide a method and device for adjusting a camera, so as to at least solve the problem that TOF sensors are less used in the field of video conferencing in the related art.
[0005] According to one embodiment of the present invention, a method for adjusting a camera is provided, comprising: acquiring a target image captured by a target lens on a target camera, and a target distance measured by a target sensor on the target camera; and adjusting the target camera according to the target image and / or the target distance, wherein the target camera is a camera in a video conference.
[0006] In an exemplary embodiment, adjusting the target camera according to the target image and / or the target distance includes at least one of the following: determining a rotation angle of the target lens according to the target image; determining a rotation angle of the target sensor according to the target distance; determining a motion trajectory of the target lens according to the target distance.
[0007] In an exemplary embodiment, determining the rotation angle of the target lens according to the target image includes: determining whether the center of a circle in the target image is located at the center of the target image, wherein the target image is an image obtained by photographing a test image with the target lens, the test image includes a target circle, and the straight-line distance between the center of the target circle and the target lens is a test distance; and adjusting the rotation angle of the target lens if the center of the circle in the target image is not located at the center of the target image.
[0008] In an exemplary embodiment, when the center of a circle in the target image is not located at the center of the target image, adjusting the rotation angle of the target lens includes: acquiring a first coordinate of the center of the target image and a second coordinate of the center of the circle in the target image; and determining a first rotation angle for adjusting the target lens according to the first coordinate and the second coordinate.
[0009] In an exemplary embodiment, determining the rotation angle of the target sensor according to the target distance includes: determining whether the target distance is equal to a test distance, wherein the target image is an image obtained by photographing a test chart by the target lens, the test chart includes a target circle, and the straight-line distance between the center of the target circle and the target lens is the test distance; when the target distance is not equal to the test distance, determining to adjust a second rotation angle of the target sensor according to the target distance and the test distance.
[0010] In an exemplary embodiment, determining the motion trajectory of the target lens according to the target distance includes: when the target lens is a zoom tracking lens, acquiring an infinite zoom curve of the zoom tracking lens; fitting a target zoom curve according to the target distance and the infinite zoom curve, and determining the target zoom curve as the motion trajectory of the target lens.
[0011] In an exemplary embodiment, fitting a target zoom curve according to the target distance and the infinity zoom curve includes: acquiring N coordinate points in the infinity zoom curve, where N is an integer greater than 1; obtaining N target coordinate points through the N coordinate points and the target distance, and obtaining the target zoom curve through fitting the N target coordinate points.
[0012] In an exemplary embodiment, determining the motion trajectory of the target lens according to the target distance includes: when the target lens is a focusing lens, obtaining a focusing point on an infinite focusing curve of the focusing lens; determining a target focusing point according to the target distance and the focusing point on the infinite focusing curve; and controlling the focusing lens to move to the target focusing point.
[0013] According to another embodiment of the present invention, a device for adjusting a camera is provided, comprising: an acquisition module for acquiring a target image captured by a target lens on a target camera, and a target distance measured by a target sensor on the target camera; and an adjustment module for adjusting the target camera according to the target image and / or the target distance.
[0014] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of any of the above methods when executed by a processor.
[0015] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0016] According to yet another embodiment of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0017] Through the present invention, the target image captured by the target lens on the target camera and the target distance measured by the target sensor on the target camera are obtained; the target camera is adjusted according to the target image and / or the target distance. Therefore, the problem that TOF sensors are less used in the field of video conferencing in the related art can be solved, and the camera in the video conferencing can be adjusted by the TOF sensor to make the picture captured by the camera clearer. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a schematic diagram of crosstalk calibration according to an embodiment of the present invention;
[0019] Figure 2 is a schematic diagram of accuracy calibration according to an embodiment of the present invention;
[0020] Figure 3 is a schematic diagram of Hough circle transformation according to an embodiment of the present invention;
[0021] Figure 4 is a schematic diagram of a three-dimensional cone according to an embodiment of the present invention;
[0022] Figure 5 is a calibration chart according to an embodiment of the present invention;
[0023] Figure 6 is a schematic diagram of detecting the center of a circle according to an embodiment of the present invention;
[0024] Figure 7 is a hardware structure block diagram of a mobile terminal for a method of adjusting a camera according to an embodiment of the present invention;
[0025] Figure 8 is a flow chart of a method for adjusting a camera according to an embodiment of the present invention;
[0026] Fig. 9 is a schematic diagram of a calibration position according to an embodiment of the present invention;
[0027] Fig.10 is a calibration synchronization flow chart according to an embodiment of the present invention;
[0028] Fig.11 is a conventional zoom lens motion trajectory according to an embodiment of the present invention;
[0029] Fig.12 Schematic diagram of a TOF fitting curve according to an embodiment of the present invention Figure 1 ;
[0030] Fig.13 Schematic diagram of a TOF fitting curve according to an embodiment of the present invention Figure 2 ;
[0031] Fig.14 is a schematic diagram of a TOF zoom tracking curve according to an embodiment of the present invention;
[0032] Fig.15 Schematic diagram of the minimum object distance and the position range of the effective focus motor according to an embodiment of the present invention Figure 1 ;
[0033] Fig.16 Schematic diagram of the minimum object distance and the position range of the effective focus motor according to an embodiment of the present invention Figure 2 ;
[0034] Fig.17 is a flow chart of determining a motion trajectory of a zoom lens according to an embodiment of the present invention;
[0035] Fig.18 is a schematic diagram of a motion trajectory of a conventional focusing lens according to an embodiment of the present invention;
[0036] Fig.19 is a schematic diagram of TOF finding the highest definition point according to an embodiment of the present invention;
[0037] Fig. 20 is a schematic diagram of focusing according to an embodiment of the present invention;
[0038] Fig.21 is a flow chart of determining the highest definition of a focusing lens according to an embodiment of the present invention;
[0039] Fig. 22is a structural block diagram of a device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0041] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0042] The related technologies involved in the embodiments of the present invention are as follows:
[0043] 1) TOF sensor calibration
[0044] ①Crosstalk calibration
[0045] Crosstalk is defined as the amount of signal received on the returning array due to the reflection of the VCSEL light (Vertical Cavity Surface Emitting Laser) within the protective window (cover glass) on top of the module. Depending on the quality of the cover glass, this signal can affect the performance of the device. In TOF sensors, this phenomenon is compensated for by built-in corrections. Depending on the preset mode used and the object distance, TOF sensors are immune to crosstalk. Crosstalk calibration is used to estimate the amount of correction required to compensate for the effects of adding a cover glass on top of the module.
[0046] Customers must ensure that there are no targets within 1 meter below the device Field of View (FoV) when performing crosstalk calibration. Figure 1 is a schematic diagram of crosstalk calibration according to an embodiment of the present invention. Figure 1 As shown, the distance is 1 meter.
[0047] ②Accuracy calibration
[0048] Figure 2 This is a schematic diagram of accuracy calibration according to an embodiment of the present invention. According to the fov calculation, the test drawing is no larger than 0.04 m2 at 1 meter, and the calculation is as follows:
[0049] The area of a circle with radius tan(12.5°) is π*(tan(12.5°))2.
[0050] According to the previous calculation, tan(12.5°) is approximately 0.22699563.
[0051] Substituting into the formula, the area is approximately 3.1416*(0.22699563)^2=0.040439 square units.
[0052] 2) Zoom lens and focus lens
[0053] A zoom lens can change the viewing angle by adjusting the focal length of the lens, and can take photos of different focal lengths without moving the lens. This lens is suitable for shooting scenes that require zoom, such as shooting sports games, wildlife, etc. The general driving method of a zoom lens is a stepper motor.
[0054] The focus lens has only a fixed focal length and cannot be adjusted. This type of lens is suitable for shooting scenes that require higher image quality and aperture effects, such as portraits, landscapes, still life, etc. The general focus lens drive method is a VCM motor.
[0055] 3) TOF sensor calibration is synchronized with lens calibration
[0056] ①Centerness calibration
[0057] The TOF sensor calibration and lens calibration are synchronized to achieve the same goal.
[0058] ②Hough circle transform
[0059] The general equation of a circle is: (xa)2+(yb)2=r 2 , where (a, b) are the coordinates of the center of the circle and r is the radius of the circle.
[0060] Figure 3 is a schematic diagram of Hough circle transformation according to an embodiment of the present invention. Figure 3 As shown, the image space is converted into parameter space. Here, the xy plane is converted into the abr parameter space. Then a circle passing through the x and y points in the image space corresponds to a three-dimensional cone with varying height in the parameter space.
[0061] Figure 4 is a schematic diagram of a three-dimensional cone according to an embodiment of the present invention, such as Figure 4 As shown in the figure, the three-dimensional cone surfaces in the corresponding parameter space passing through the same circle in the image space must intersect at a point (a, b, r) in the r plane, so that the parameters of a circle can be obtained through this point.
[0062] The basic idea of the standard Hough circle transform is: for each edge point in the image, we consider all possible circles that pass through the point. For each such circle, we add 1 to the accumulator corresponding to its parameters (a, b, r). Finally, the parameter corresponding to the point with the largest value in the accumulator is the parameter of the circle in the image.
[0063] ③ Use Hough circle transform to draw a circle and determine the center of the circle
[0064] Figure 5 is a calibration chart according to an embodiment of the present invention. The HoughCircles function is used to find circles in an image using Hough transform. Figure 6is a schematic diagram of detecting the center of a circle according to an embodiment of the present invention, such as Figure 6 As shown, this function is implemented by modifying the Hough transform and can usually detect the center of the circle well.
[0065] The method for adjusting the camera provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 7 FIG. 1 is a hardware structure block diagram of a mobile terminal for a method of adjusting a camera according to an embodiment of the present invention. Figure 7 As shown, the mobile terminal may include one or more ( Figure 7 Only one is shown in the figure) a processor 702 (the processor 702 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 704 for storing data, wherein the mobile terminal may also include a transmission device 706 and an input / output device 708 for communication functions. It can be understood by those skilled in the art that Figure 7 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 7 More or fewer components as shown, or with Figure 7 Different configurations shown.
[0066] The memory 704 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for adjusting the camera in the embodiment of the present invention. The processor 702 executes various functional applications and data processing by running the computer program stored in the memory 704, that is, to implement the above method. The memory 704 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 704 may further include a memory remotely arranged relative to the processor 702, and these remote memories may be connected to the mobile 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.
[0067] The transmission device 706 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 706 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 706 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0068] In this embodiment, a method running on the above mobile terminal or network architecture is provided. Figure 8 is a flow chart of a method for adjusting a camera according to an embodiment of the present invention. Figure 8 As shown, the process includes the following steps:
[0069] Step S802, obtaining a target image captured by a target lens on a target camera, and a target distance measured by a target sensor on the target camera;
[0070] Fig. 9 is a schematic diagram of a calibration position according to an embodiment of the present invention, such as Fig. 9 As shown, the target camera is simultaneously equipped with a lens and the target sensor (TOF sensor), the target lens is a lens installed in the target camera, which may be a zoom lens or a focusing lens, the target sensor is a TOF sensor, the target image is an image obtained by photographing a test chart with the target lens of the target camera, the test chart includes a target circle, and the target distance is a preset TOF test distance. In the present embodiment, the TOF test distance is 1000 mm.
[0071] Step S804: adjusting the target camera according to the target image and / or the target distance, wherein the target camera is a camera in a video conference.
[0072] The method for adjusting the target camera includes adjusting the rotation angle of the target lens, adjusting the rotation angle of the target sensor, and adjusting the motion trajectory of the target lens, wherein adjusting the motion trajectory of the target lens includes adjusting the motion trajectory of the zoom lens and adjusting the motion trajectory of the focus lens.
[0073] Optionally, a rotation angle of the target lens is determined according to the target image.
[0074] Determine whether the center of a circle in the target image is located at the center of the target image, wherein the target image is an image obtained by photographing a test image by the target lens, the test image includes a target circle, and the straight-line distance between the center of the target circle and the target lens is a test distance; if the center of a circle in the target image is not located at the center of the target image, adjust the rotation angle of the target lens.
[0075] In this embodiment, the success is determined by the center of the lens recognition chart being at the center of the video screen. When the center of the target image does not coincide with the center of the target image, the rotation angle of the target lens can be adjusted to make the center of the target image coincide with the center of the target image.
[0076] The specific lens adjustment method is as follows: obtaining a first coordinate of the center of the target image and a second coordinate of the center of a circle in the target image; and determining a first rotation angle for adjusting the target lens according to the first coordinate and the second coordinate.
[0077] The target image is placed in an image coordinate system, which is a coordinate system used to describe the pixel position in an image. In a common image coordinate system, the origin, x-axis, and y-axis are included, so each pixel in the image can be represented by a two-dimensional coordinate (x, y). In this embodiment, assuming that the width of the image is W and the height is H, the first coordinate of the center of the target image is (W / 2, H / 2), and the second coordinate of the center of the circle in the target image is obtained by Hough circle transform detection, assuming that the detected center coordinates are (x_d, y_d). The first rotation angle of the target lens is determined based on the deviation between the first coordinate and the second coordinate. The deviation is the difference between the detected center of the circle and the center of the image, and the calculation formula is Δx=x_d-(W / 2); Δy=y_d-(H / 2). The formula for calculating the rotation angle using the deviation is θ=arctan(Δy / Δx). Therefore, the calculation formula of the first rotation angle is θ=arctan((y_d-(H / 2)) / (x_d-(W / 2))). The target lens is adjusted according to the first rotation angle so that the second coordinate is as close to the first coordinate as possible. For example, if the second coordinate is located on the left side of the first coordinate, the target lens is rotated right by θ degrees; if the second coordinate is located on the right side of the first coordinate, the target lens is rotated left by θ degrees.
[0078] Optionally, a rotation angle of the target sensor is determined according to the target distance.
[0079] Determine whether the target distance is equal to the test distance, wherein the target image is an image obtained by the target lens shooting a test chart, the test chart includes a target circle, and the straight-line distance between the center of the target circle and the target lens is the test distance; when the target distance is not equal to the test distance, determine to adjust the second rotation angle of the target sensor according to the target distance and the test distance.
[0080] In this embodiment, the success is determined when the target distance of the sensor is equal to the test distance. When the target distance of the sensor is not equal to the test distance, the rotation angle of the target sensor can be adjusted to make the target distance of the sensor equal to the test distance.
[0081] The specific method for adjusting the rotation angle of the sensor is as follows: acquiring the target distance of the target image and the test distance of the target image; and determining to adjust the second rotation angle of the target sensor according to the target distance and the test distance.
[0082] For example, the test distance is set to D_measured, the target distance is set to D_expected (1000mm in this embodiment), and the second rotation angle is calculated by using the arc cosine to calculate the rotation angle. The specific calculation formula is: angle θ = arccos (D_expected / D_measured). The calculated rotation angle θ is used to adjust the actual angle of the target sensor so that the test distance is as close to the target distance as possible. The specific operation method is as follows: first rotate the target sensor to the left by θ degrees, and judge the distance change between the test distance and the target distance. If the distance becomes smaller, the rotation direction is correct. If the distance becomes larger, the rotation direction is wrong, and it is necessary to rotate right by θ degrees based on the rotation.
[0083] Fig.10 is a calibration synchronization flow chart according to an embodiment of the present invention, such as Fig.10 As shown, the process includes the following steps:
[0084] S1001, place a test char chart 1 meter in front of the device (the placement distance can be adjusted according to actual conditions, and is set to 1000 mm, i.e. 1 meter, in this embodiment);
[0085] S1002, the camera collects images to determine the center position of the circle;
[0086] S1003, determine whether the center of the circle is at the center of the picture; if so, success, otherwise failure;
[0087] S1004, TOF distance measurement to determine distance;
[0088] S1005, test whether the distance is 1000mm, if yes, success, otherwise failure.
[0089] Note that the above S1002 and S1004 are parallel steps and there is no order of precedence.
[0090] Optionally, the motion trajectory of the target lens is determined according to the target distance.
[0091] The target lens can be a zoom lens or a focusing lens. The processing methods for different lenses are different, and the specific processing methods are as follows.
[0092] In the case that the target lens is a zoom tracking lens, an infinite zoom curve of the zoom tracking lens is obtained; a target zoom curve is fitted according to the target distance and the infinite zoom curve, and the target zoom curve is determined as a motion trajectory of the target lens.
[0093] Fig.11 is the motion trajectory of a conventional zoom lens according to an embodiment of the present invention, such as Fig.11 As shown, the infinity zoom curve and the closest zoom curve are the curves that the zoom camera can reach. The traditional zoom lens controls the movement trajectory of the camera to move between the above two curves, resulting in unstable clarity of the picture taken by the camera.
[0094] Fig.12 Schematic diagram of a TOF fitting curve according to an embodiment of the present invention Figure 1 In the case of TOF assistance, there is no need to try to find the zoom curve of the target object distance during zoom tracking. The corresponding zoom tracking curve can be fitted according to the actual distance of the TOF test. Fig.13 Schematic diagram of a TOF fitting curve according to an embodiment of the present invention Figure 2 , the lens curve expression is:
[0095]
[0096] The method of converting the object distance to the focus motor position uses the lens formula: 1 / f = 1 / v-1 / u, where f is the focal length of the lens, u is the object distance, and v is the image distance. When u is infinite (i.e. the object is at infinity), v is equal to the focal length f of the lens, and the defocus distance at this time is f. When u is less than infinity, v will become smaller, so the defocus distance will also become larger. In other words, the farther the object is from the lens, the closer the defocus distance will be; when the object is closer to the lens, the farther the defocus distance will be. The effective focus motor position is inversely proportional to the object distance.
[0097] Fig.14 : is a schematic diagram of a TOF zoom tracking curve according to an embodiment of the present invention, and a specific fitting method is: obtaining N coordinate points in the infinite zoom curve, where N is an integer greater than 1; obtaining N target coordinate points through the N coordinate points and the target distance, and obtaining the target zoom curve through fitting the N target coordinate points.
[0098] The above curve is in a coordinate system with room as the horizontal coordinate and focus as the vertical coordinate. Therefore, each point on the infinite zoom curve can be represented by the horizontal coordinate and the vertical coordinate. The above N coordinate points are N non-overlapping points (9 in this embodiment) randomly obtained from the above infinite zoom curve. Through the above N coordinate points and the above target distance, the coordinates of the N target coordinate points are fitted by f=m·r·x^(-1)+b. Fig.15 Schematic diagram of the minimum object distance and the position range of the effective focus motor according to an embodiment of the present invention Figure 1 , Fig.16 Schematic diagram of the minimum object distance and the position range of the effective focus motor according to an embodiment of the present invention Figure 2 ,like Fig.15 , 16 As shown, m (in millimeters) is the minimum object distance, r (in focus steps) is the position range of the effective focus motor, the above m and r are known parameters of the camera, x (in millimeters) is the test distance of TOF (the horizontal coordinate of the N coordinate points obtained), b (in focus steps) is the vertical coordinate of the N coordinate points obtained, and f is the vertical coordinate of the N target coordinate points obtained by fitting.
[0099] like Fig.14 It can be seen that the infinite zoom curve satisfies f(x)=a_1x_1+b_1 between coordinate point 1 and coordinate point 2, and a_1 and b_1 are obtained. The zoom curve of the object distance is determined based on the expression f=m·r·x^(-1)+b. The target curve coordinate point 1` and coordinate point 2` satisfy f(x)=c_1x_1+d_1, and c_1 and d_1 are obtained. By analogy, the zoom curve expression of the object distance is
[0100]
[0101] Therefore, the coordinates of N points on the target curve can be fitted through the N points on the infinite zoom curve. After connecting the N points on the target curve with a smooth curve, the above target curve can be obtained. When the zoom lens is controlled to move along the above target curve, the cleanliness of the camera can be guaranteed.
[0102] Fig.17 is a flow chart of determining the motion trajectory of a zoom lens according to an embodiment of the present invention. Fig.17 As shown, the process includes the following steps:
[0103] S1701, TOF detects the object distance of the current scene;
[0104] S1702, fitting a zoom tracking curve corresponding to the current object distance;
[0105] S1703, moving the lens along the zoom tracking curve.
[0106] Optionally, when the target lens is a focusing lens, a focusing point on an infinite focusing curve of the focusing lens is obtained; a target focusing point is determined according to the target distance and the focusing point on the infinite focusing curve; and the focusing lens is controlled to move to the target focusing point.
[0107] Fig.18 is a schematic diagram of the motion trajectory of a conventional focusing lens according to an embodiment of the present invention. Fig.18 As shown, the traditional focusing lens searches for the point with the highest clarity through the focusing algorithm. During the search process, the algorithm does not know whether the current point is the point with the highest clarity. Instead, it determines whether the point with the highest clarity has been found by comparing the change in clarity of the next search. If the clarity of the next search becomes smaller, it means that the clarity of the last search is the highest clarity. If the clarity becomes larger, it is necessary to continue searching until the clarity of the next search becomes smaller. This search method cannot directly find the point with the highest clarity, the process is cumbersome, and the efficiency is low.
[0108] Fig.19 is a schematic diagram of TOF finding the highest definition point according to an embodiment of the present invention, such as Fig.19 As shown, in the case of TOF assistance, there is no need to find the focus position in the focusing algorithm. The lens can be moved to the mapped position according to the actual distance tested by the TOF sensor.
[0109] Fig. 20 is a focusing diagram according to an embodiment of the present invention. The specific focus position calculation method is to use TOF test to obtain the object distance x, and the focus position of the object distance is obtained according to the expression f=m·r·x^(-1)+b. Wherein, f is focus, that is, Fig. 20 In the figure, b is the horizontal coordinate of the clearest focus position of the infinity focus curve, x is the test distance of TOF, m (in millimeters) is the minimum object distance, and r (in focus steps) is the position range of the effective focus motor. The above m and r are known parameters of the camera.
[0110] Fig.21 is a flow chart for determining the highest definition of a focusing lens according to an embodiment of the present invention. Fig.21 As shown, the process includes the following steps:
[0111] S2101, TOF detects the object distance of the current scene;
[0112] S2102, calculating the position of the focus click at the current focal length;
[0113] S2103, the moving motor moves to this position.
[0114] Optionally, the executor of the above steps may be a background processor, or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device, wherein the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a computer, a mobile phone or other terminal, but is not limited thereto.
[0115] Through the above steps, the problem that TOF sensors are less used in the field of video conferencing in the related art is solved, and the camera in the video conferencing is adjusted by the TOF sensor to make the picture taken by the camera clearer.
[0116] In this embodiment, TOF sensor calibration is synchronized with lens calibration, and the same test environment is used, which greatly shortens the calibration time and saves resources in both space and time. The TOF sensor calibration, lens calibration, application of TOF sensor in zoom tracking, and application of TOF sensor in focusing in this embodiment are not only applicable to the field of video conferencing, but also to the control of zoom lenses in the fields of security and protection.
[0117] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0118] In this embodiment, a device for adjusting a camera is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are omitted. As used below, the term "module" may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0119] Fig. 22 is a structural block diagram of a device according to an embodiment of the present invention, such as Fig. 22 As shown, the device includes an acquisition module 2202, which is used to acquire a target image captured by a target lens on a target camera, and a target distance measured by a target sensor on the target camera; and an adjustment module 2204, which is used to adjust the target camera according to the target image and / or the target distance.
[0120] In an exemplary embodiment, the above-mentioned device is also used to determine the rotation angle of the target lens according to the target image; determine the rotation angle of the target sensor according to the target distance; and determine the motion trajectory of the target lens according to the target distance.
[0121] In an exemplary embodiment, the above-mentioned device is also used to determine whether the center of the circle in the target image is located at the center of the target image, wherein the target image is an image obtained by the target lens shooting a test image, the test image includes a target circle, and the straight-line distance between the center of the target circle and the target lens is the test distance; when the center of the circle in the target image is not located at the center of the target image, the rotation angle of the target lens is adjusted.
[0122] In an exemplary embodiment, the above-mentioned device is also used to obtain a first coordinate of the center of the target image and a second coordinate of the center of a circle in the target image; and determine a first rotation angle for adjusting the target lens according to the first coordinate and the second coordinate.
[0123] In an exemplary embodiment, the above-mentioned device is also used to determine whether the target distance is equal to the test distance, wherein the target image is an image obtained by the target lens shooting a test image, the test image includes a target circle, and the straight-line distance between the center of the target circle and the target lens is the test distance; when the target distance is not equal to the test distance, the second rotation angle of the target sensor is adjusted according to the target distance and the test distance.
[0124] In an exemplary embodiment, the above-mentioned device is also used to obtain an infinite zoom curve of the zoom tracking lens when the target lens is a zoom tracking lens; fit a target zoom curve according to the target distance and the infinite zoom curve, and determine the target zoom curve as the motion trajectory of the target lens.
[0125] In an exemplary embodiment, the above-mentioned device is also used to obtain N coordinate points in the infinite zoom curve, where N is an integer greater than 1; obtain N target coordinate points through the N coordinate points and the target distance, and obtain the target zoom curve by fitting the N target coordinate points.
[0126] In an exemplary embodiment, the above-mentioned device is also used to obtain a focusing point on the infinity focusing curve of the focusing lens when the target lens is a focusing lens; determine a target focusing point according to the target distance and the focusing point on the infinity focusing curve; and control the focusing lens to move to the target focusing point.
[0127] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0128] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0129] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0130] An embodiment of the present invention further provides an electronic device, 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.
[0131] In an exemplary embodiment, 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.
[0132] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0133] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method described in each embodiment of the present application when executed by a processor.
[0134] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0135] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for adjusting a camera, characterized in that: include: Acquire a target image captured by a target lens on a target camera, and a target distance measured by a target sensor on the target camera; The target camera is adjusted according to the target image and / or the target distance, wherein the target camera is a camera in a video conference.
2. The method according to claim 1, characterized in that Adjusting the target camera according to the target image and / or the target distance includes at least one of the following: Determining a rotation angle of the target lens according to the target image; determining a rotation angle of the target sensor according to the target distance; The motion trajectory of the target lens is determined according to the target distance.
3. The method according to claim 2, characterized in that Determining a rotation angle of the target lens according to the target image includes: Determine whether the center of a circle in the target image is located at the center of the target image, wherein the target image is an image obtained by the target lens shooting a test chart, the test chart includes a target circle, and the straight-line distance between the center of the target circle and the target lens is a test distance; When the center of the circle in the target image is not located at the center of the target image, the rotation angle of the target lens is adjusted.
4. The method according to claim 3, characterized in that: When the center of the circle in the target image is not located at the center of the target image, adjusting the rotation angle of the target lens includes: Acquire a first coordinate of the center of the target image and a second coordinate of the center of a circle in the target image; A first rotation angle for adjusting the target lens is determined according to the first coordinate and the second coordinate.
5. The method according to claim 3, characterized in that: Determining a rotation angle of the target sensor according to the target distance includes: Determine whether the target distance is equal to the test distance, wherein the target image is an image obtained by the target lens shooting a test chart, the test chart includes a target circle, and the straight-line distance between the center of the target circle and the target lens is the test distance; In a case where the target distance is not equal to the test distance, a second rotation angle of the target sensor is adjusted according to the target distance and the test distance.
6. The method according to claim 2, characterized in that Determining the motion trajectory of the target lens according to the target distance includes: When the target lens is a zoom tracking lens, obtaining an infinite zoom curve of the zoom tracking lens; A target zoom curve is fitted according to the target distance and the infinite zoom curve, and the target zoom curve is determined as the motion trajectory of the target lens.
7. The method according to claim 6, characterized in that Fitting a target zoom curve according to the target distance and the infinite zoom curve includes: Acquire N coordinate points in the infinite zoom curve, where N is an integer greater than 1; N target coordinate points are obtained through the N coordinate points and the target distance, and the target zoom curve is obtained by fitting the N target coordinate points.
8. The method according to claim 2, characterized in that: Determining the motion trajectory of the target lens according to the target distance includes: When the target lens is a focusing lens, obtaining a focusing point on an infinite focusing curve of the focusing lens; Determine a target focus point according to the target distance and the focus point on the infinite focus curve; Control the focusing lens to move to the target focusing point.
9. A device for adjusting a camera, characterized in that: include: An acquisition module, used to acquire a target image captured by a target lens on a target camera, and a target distance measured by a target sensor on the target camera; An adjustment module is used to adjust the target camera according to the target image and / or the target distance.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 8 when executed by a processor.
11. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.