Automatic adjustment method, system and device applied to camera and storage medium

By automatically adjusting the camera focal length and height, analyzing the clarity and size of the photo, the camera is automatically adjusted, which solves the problem of inefficient manual adjustment in the prior art and improves the camera imaging quality and efficiency.

CN119031234AInactive Publication Date: 2024-11-26SHENZHEN SEICHITECH TECHN CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411519753.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2024-11-26
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The imaging ratio and focal length adjustment of existing cameras require manual operation, which is inefficient and takes a long time.

Method used

By adjusting the camera's focal length and height in real time, obtaining multiple photos, analyzing the clarity and size, and automatically determining and adjusting the focal length and height to achieve a preset imaging ratio.

Benefits of technology

Automatic camera adjustment is achieved, reducing manual intervention, and improving efficiency and imaging quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031234A_ABST
    Figure CN119031234A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an automatic adjustment method, system and device applied to a camera, and a storage medium, and can automatically adjust the focal length and imaging ratio of the camera, thereby improving the efficiency. The method comprises the following steps: changing the focal length and height of a target camera in real time; in the process of changing the focal length and the height of the target camera, a group of photos of the target object shot by the target camera in real time are obtained, and each photo corresponds to the height and the focal length of the target camera; obtaining the photo with the highest definition from a group of photos as a target photo; changing the size of the target object in the obtained target photo as a target size; whether the ratio of the target size to the actual size of the target object is a preset imaging ratio is changed and judged; if not, executing the steps again; if the change is yes, determining a target focal length and a target height according to the target photo; and adjusting the target camera according to the target focal length and the target height.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of camera adjustment technology, and in particular, to an automatic adjustment method, system, device, and storage medium applied to a camera. Background Art

[0002] In the fields of image processing technology, industrial automation control and optical measurement technology, the imaging quality and accuracy of the camera are crucial factors. The imaging ratio and focal length of the camera are two important parameters that affect the imaging quality. The imaging ratio refers to the ratio of the actual size of the object photographed by the camera to its size in the photo, while the focal length is an important parameter of the camera lens, which determines the depth of field and clarity of the camera.

[0003] In the existing technology, the imaging ratio and focal length of the camera are usually adjusted manually. The operator needs to adjust the position and focal length of the camera based on experience and test shooting to achieve the best imaging effect. However, the manual adjustment process is often very time-consuming and inefficient. Summary of the invention

[0004] The embodiments of the present application provide an automatic adjustment method, system, device and storage medium for a camera, which can automatically adjust the focal length and imaging ratio of the camera, thereby improving efficiency.

[0005] A first aspect of an embodiment of the present application provides an automatic adjustment method applied to a camera, comprising: Change the focus and height of the target camera in real time; In the process of changing the focal length and height of the target camera, a group of photos of the target object taken by the target camera in real time are obtained, wherein each photo corresponds to the height and focal length of the target camera; Obtaining a photo with the highest definition from the group of photos as a target photo; Acquire the size of the target object in the target photo as the target size; Determining whether the ratio of the target size to the actual size of the target object is a preset imaging ratio; If not, execute the above steps again; If yes, determining the target focal length and target height according to the target photo; The target camera is adjusted according to the target focal length and the target height.

[0006] Optionally, the real-time changing of the focal length and height of the target camera includes: Control the target camera to move the target distance in the vertical direction; The focus of the target camera is adjusted at a preset focus change rate.

[0007] Optionally, before adjusting the focal length of the target camera at a preset focal length change rate, the method further includes: Set the focus of the target camera to the maximum or minimum value.

[0008] Optionally, the focal length of the target camera is controlled by a focal length motor, and obtaining a group of photos of the target object taken by the target camera in real time includes: Whenever the focus motor moves a preset distance, the target camera is controlled to photograph the target object; A group of photos of the target object taken by the target camera in real time is obtained.

[0009] Optionally, obtaining the photo with the highest definition from the group of photos as the target photo includes: Calculate the variance of each photo in the set of photos respectively; Compare the variance of each photo, and identify the photo with the largest variance as the photo with the highest clarity; Use the photo with the highest resolution as the target photo.

[0010] Optionally, obtaining the size of the target object in the target photo as the target size includes: Obtaining a grayscale image of the target photo; Processing the target photo by an edge detection algorithm to obtain a corresponding binary image; Performing contour extraction on the binary image to obtain a contour image of the target object; The circumscribed rectangle of the contour image is calculated, and the size of the circumscribed rectangle is used as the target size.

[0011] Optionally, determining whether the ratio of the target size to the actual size of the target object is a preset imaging ratio includes: It is determined whether the width ratio and the height ratio of the target size to the actual size of the target object are both preset imaging ratios.

[0012] A second aspect of an embodiment of the present application provides an automatic adjustment system for a camera, comprising: A change unit, used to change the focal length and height of the target camera in real time; A first acquisition unit is used to acquire a group of photos of the target object taken by the target camera in real time during the process of changing the focal length and height of the target camera, wherein each photo corresponds to the height and focal length of the target camera; A second acquisition unit, configured to acquire a photo with the highest definition from the group of photos as a target photo; A third acquisition unit is used to acquire the size of the target object in the target photo as the target size; A judging unit, used for judging whether the ratio of the target size to the actual size of the target object is a preset imaging ratio; an execution unit, configured to, when the judgment unit determines that the ratio of the target size to the actual size of the target object is not a preset imaging ratio, re-execute the steps executed by the changing unit, the first acquiring unit, the second acquiring unit, the third acquiring unit and the judging unit; a determination unit, configured to determine a target focal length and a target height according to the target photo when the determination unit determines that the ratio of the target size to the actual size of the target object is a preset imaging ratio; An adjustment unit is used to adjust the target camera according to the target focal length and the target height.

[0013] Optionally, the changing unit includes: A control module, used for controlling the target camera to move a target distance in a vertical direction; The adjustment module is used to adjust the focal length of the target camera at a preset focal length change rate.

[0014] Optionally, the changing unit further includes: The reset module is used to set the focal length of the target camera to a maximum value or a minimum value.

[0015] Optionally, the first acquiring unit is specifically used for: Whenever the focus motor moves a preset distance, the target camera is controlled to photograph the target object; A group of photos of the target object taken by the target camera in real time is obtained.

[0016] Optionally, the second acquiring unit is specifically configured to: Calculate the variance of each photo in the set of photos respectively; Compare the variance of each photo, and identify the photo with the largest variance as the photo with the highest clarity; Use the photo with the highest resolution as the target photo.

[0017] Optionally, the third acquiring unit is specifically used for: Obtaining a grayscale image of the target photo; Processing the target photo by an edge detection algorithm to obtain a corresponding binary image; Performing contour extraction on the binary image to obtain a contour image of the target object; The circumscribed rectangle of the contour image is calculated, and the size of the circumscribed rectangle is used as the target size.

[0018] Optionally, the judging unit is specifically configured to: It is determined whether the width ratio and the height ratio of the target size to the actual size of the target object are both preset imaging ratios.

[0019] A third aspect of an embodiment of the present application provides an automatic adjustment device for a camera, comprising: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; A program is stored in the memory, and the processor calls the program to execute the method in the first aspect and any possible implementation manner of the first aspect.

[0020] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the computer executes the method in the first aspect and any possible implementation of the first aspect.

[0021] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages: In the embodiment of the present application, the focal length and height of the target camera can be automatically adjusted according to the preset imaging ratio, thereby reducing manual intervention and improving efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram of a flow chart of an embodiment of an automatic adjustment method applied to a camera in an embodiment of the present application; Figure 2 A schematic diagram of a flow chart of an embodiment of real-time changing of the focal length and height of a target camera in an embodiment of the present application; Figure 3 A schematic diagram of a process of obtaining a group of photos of a target object taken in real time by a target camera in an embodiment of the present application; Figure 4 A schematic diagram of a process for obtaining a target photo in an embodiment of the present application; Figure 5 A schematic diagram of a flow chart of an embodiment of a method for obtaining a target size in an embodiment of the present application; Figure 6 It is a structural schematic diagram of an embodiment of an automatic adjustment system applied to a camera in an embodiment of the present application; Figure 7 It is a structural schematic diagram of an embodiment of an automatic adjustment device applied to a camera in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The embodiments of the present application provide an automatic adjustment method, system, device and storage medium for a camera, which are used to automatically adjust the focal length and imaging ratio of the camera to improve efficiency.

[0024] The method of the present application can be applied to a server, a terminal or other devices with logic processing capabilities, and the present application does not limit this. For the convenience of description, the following description is made by taking the execution subject as a server as an example.

[0025] The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0026] See also Figure 1 In an embodiment of the present application, an automatic adjustment method applied to a camera includes: 101. Change the focal length and height of the target camera in real time; The server needs to adjust the focal length and height of the target camera in real time through control instructions. Focal length refers to the optical properties of the camera lens, which affects the magnification and depth of field of the image. The height determines the vertical position of the camera relative to the subject. For example, if you want to shoot a tree, the server may set the height of the camera to the height of the tree in order to capture the image of the entire tree. At the same time, adjusting the focal length can make the camera focus on the details of the tree or capture a wider scene. Through this real-time adjustment, the server ensures that the best shooting angle and image quality are obtained.

[0027] 102. In the process of changing the focal length and height of the target camera, a group of photos of the target object taken by the target camera in real time is obtained, wherein each photo corresponds to the height and focal length of the target camera; The server starts taking a set of photos while adjusting the camera settings. These photos record the images of the camera at different focal lengths and heights. The real-time shooting process is very critical because different settings may affect the clarity and composition of the photographed objects. For example, when the height of the camera is adjusted from 1 meter to 2 meters, the server will capture the changes in observing the target object from different perspectives, which can provide more options for selecting the photos with the highest clarity later.

[0028] 103. Obtain the photo with the highest definition from a group of photos as the target photo; The server analyzes the acquired set of photos and evaluates the clarity of each photo. Clarity is usually related to the sharpness, contrast, and noise level of the image. The server may use image processing algorithms, such as the Laplacian operator, to quantify the sharpness of each photo and select the photo with the highest clarity as the target photo. The effectiveness of this step directly affects the accuracy of the subsequent target size, ensuring that the acquired image has enough details for analysis.

[0029] 104. Obtain the size of the target object in the target photo as the target size; In this step, the server extracts the size of the target object from the target photo through image processing technology. This usually involves image analysis algorithms, such as edge detection or contour recognition, to identify the boundaries of the object and calculate its size. At this point, the image may need to be calibrated to convert pixel units into actual dimensions. For example, if the target object is a rectangular wooden board, the server will calculate its length and width and record it as the target size. This information is crucial for subsequent steps.

[0030] 105. Determine whether the ratio of the target size to the actual size of the target object is a preset imaging ratio; if not, execute steps 101 to 105 again; if yes, execute step 106; The server compares the target size with a preset imaging ratio. The imaging ratio refers to the relationship between the size of the object in the image and its actual size when it is captured. The server calculates the ratio between the two and determines whether it meets the preset conditions. If not, it means that the camera settings need to be readjusted and steps 101 to 105 are performed again; if it meets, the server can perform step 106.

[0031] Specifically, when making a judgment, the server can make a judgment in both height and width dimensions at the same time, calculate the ratio of the height of the target size to the height of the actual size, compare the ratio with the preset imaging ratio, calculate the ratio of the width of the target size to the width of the actual size, and compare the ratio with the preset imaging ratio. If both ratios are equal to the preset imaging ratio, it can be determined that the target photo at this time meets the requirements. At this time, the server can execute step 106, otherwise the server executes steps 101 to 105 again.

[0032] The server makes judgments in two dimensions, and only when the target size meets the requirements in both height and width will the next step be executed, which can improve the accuracy of the target camera shooting.

[0033] 106. Determine the target focal length and target height based on the target photo; The server analyzes the target photo and extracts the focal length and height parameters actually used. These parameters are usually recorded during steps 101 to 105. By analyzing the target photo, the server can determine which focal length and height combination produces the best image effect, thereby providing a basis for subsequent camera adjustments. This step is crucial for subsequent accurate camera adjustments.

[0034] 107. Adjust the target camera according to the target focal length and target height.

[0035] Finally, the server adjusts the settings of the target camera according to the target focal length and height determined in step 106. This process includes controlling the mechanical components of the camera to achieve precise focal length and height adjustment. For example, if the target focal length is 50mm and the height is 1.5 meters, the server will send control signals to accurately set the camera. Such adjustments ensure that the final capture result meets the expected quality and detail requirements.

[0036] In this embodiment, the server changes the focal length and height of the target camera in real time, so that the camera can flexibly adapt to different shooting conditions. By quickly adjusting the focal length, the server can control the magnification and depth of field of the image to ensure the best visual presentation. During the adjustment process, a group of photos are taken to obtain diversified image data, laying the foundation for the subsequent selection of the highest definition photos. By extracting the photos with the highest definition, the information obtained is ensured to be reliable and accurate, providing a high-quality foundation for subsequent size measurement. After obtaining the size of the target object, the ratio between it and the actual size is judged. The automated detection mechanism in this link improves the efficiency of the entire process and can quickly determine whether the camera settings need to be readjusted. Subsequently, the focal length and height determined according to the target photo are accurately adjusted to ensure that each shooting setting can be optimized based on best practices. Finally, according to the adjusted focal length and height, the shooting needs are adapted in real time, thereby realizing automatic adjustment of the focal length and height and improving efficiency. At the same time, through the acquisition of diversified shooting angles, the guarantee of clarity priority selection, and the support of accurate size measurement, the comprehensive performance and application value of the system are enhanced.

[0037] See also Figure 2 In some embodiments of the present application, step 101 in the above embodiment of changing the focal length and height of the target camera in real time may include the following steps 201 to 203: 201. Control the target camera to move the target distance in the vertical direction; The server controls the target camera to move vertically to adjust its relative height to the subject. This movement is usually achieved through an electric motor to ensure the precise lifting and lowering of the camera. For example, when shooting a high-rise building, the camera needs to be gradually raised to fully capture the appearance of the building to avoid the lack of viewing angle to show the details of the building.

[0038] It should be noted that when the server controls the target camera to move in the vertical direction, it must ensure that the target camera does not move in the horizontal direction.

[0039] 202. Set the focal length of the target camera to the maximum or minimum value.

[0040] After completing the vertical movement, the server sets the focal length of the target camera to the maximum or minimum value. The focal length is the distance from the center of the lens to the image sensor, which affects the magnification effect and viewing angle of the image. Selecting the maximum focal length can capture distant details more clearly, such as when photographing wild animals, to avoid interference while obtaining high-quality images. The minimum focal length is suitable for shooting close objects, increasing the width of the field of view, and is suitable for shooting large scenes, such as open squares. This setting ensures that the camera obtains the best picture composition and detail presentation during shooting.

[0041] It should be noted that the server needs to first determine whether to reset the focal length of the target camera to the maximum value or the minimum value. Taking the reset target as the maximum value of the focal length as an example, each time the target camera is controlled to move in the vertical direction, the focal length needs to be reset to the maximum value, and then the focal length of the target camera is adjusted towards the minimum value.

[0042] 203. Adjust the focus of the target camera at a preset focus change rate.

[0043] After the focus is set, the server adjusts the focus of the target camera at a preset focus change rate. The adjustment process is performed by a servo motor or a stepper motor to achieve smooth and precise focus changes. The preset rate means that the focus adjustment will be performed at a certain speed to avoid sudden changes that cause the picture to be out of focus. For example, when shooting a sports scene, the server can set the focus to change at a faster rate to quickly track the movements of the athletes and ensure that the image remains clear at all times. In this way, users can get a more stable picture effect during the shooting process and improve the overall shooting quality.

[0044] By controlling the vertical movement of the camera, the best viewing angle can be captured, which improves the flexibility of shooting. The precise setting and adjustment of the focal length ensures the ideal image details and field of view in different scenes. At the same time, combined with the preset focal length change rate, the stability and professionalism of the shooting process are further improved, allowing users to obtain high-quality shooting effects under various conditions.

[0045] See also Figure 3 In some embodiments of the present application, the focal length of the target camera is controlled by a focal length motor. In the process of changing the focal length and height of the target camera, step 102 in the above embodiment obtains a group of photos of the target object taken by the target camera in real time, which may include the following steps 301 to 302: 301. Whenever the focus motor moves a preset distance, the target camera is controlled to shoot the target object; Whenever the focus motor moves a preset distance, the server controls the target camera to shoot the target object. This design ensures that the camera can automatically capture images during the focus adjustment process, using precise mechanical control to reduce the need for human intervention. For example, when the focus motor moves forward a certain distance, the camera automatically takes a photo, which can record the image changes at different focal lengths and provide rich data support for subsequent analysis. This automated shooting not only improves work efficiency, but also ensures the consistency and reliability of the shooting process.

[0046] 302. Obtain a group of photos of the target object taken by the target camera in real time.

[0047] After the focus motor moves and takes pictures, the server will obtain a set of photos of the target object taken by the target camera in real time. This process means that every photo taken by the camera at different focus settings will be stored and form a complete image data set. For example, when doing product photography, the server can capture various perspectives from far to near to form a series of images, which provides a diverse basis for subsequent image processing and analysis. By obtaining multiple photos, the system can more comprehensively evaluate the appearance and details of the target object and provide data support for subsequent decision-making.

[0048] See also Figure 4 In some embodiments of the present application, step 103 in the above embodiment of obtaining a photo with the highest definition from a group of photos as a target photo may include the following steps 401 to 403: 401. Calculate the variance of each photo in a group of photos respectively; The server will calculate the variance of each photo in a set of photos. Variance is a statistical measure of the degree of dispersion of data and can reflect the clarity of the image. Specifically, the smaller the variance, the smaller the variation in the pixel values ​​of the image, which usually means that the image is clearer and more detailed. The process of calculating variance involves extracting the pixel values ​​of each photo and performing statistical analysis on these values. For example, the server will sum the brightness values ​​of each pixel in the image and then calculate its deviation from the average brightness to get the variance value.

[0049] 402. Compare the variance of each photo, and determine the photo with the largest variance as the photo with the highest clarity; After calculating the variance of all photos, the server will compare the variance of each photo. The photo with the largest variance usually means that the best detail was achieved during the shooting process, which may be due to factors such as lighting conditions, focal length settings, etc. The server determines the photo with the largest variance as the photo with the highest clarity through a simple numerical comparison, ensuring that the final selected image is the most visually prominent. For example, in a group of photos taken with different focal lengths and lighting conditions, the one with the largest variance is likely to show the richest details.

[0050] 403. Use the photo with the highest resolution as the target photo.

[0051] After comparison, the server selects the photo with the largest variance as the target photo. This step means that the system will use this image with the highest clarity as the basis for subsequent processing, such as dimensional measurement or further image analysis. The target photo not only reflects the best shooting effect, but also provides high-quality visual data for subsequent applications to ensure the reliability of the required results. For example, when displaying a product, choosing this clear photo can improve the overall presentation effect and attract the audience's attention.

[0052] By calculating the variance of each photo, the clarity of the image can be objectively evaluated, thus ensuring that the best image is selected as the target photo. This method improves the accuracy of image selection and makes subsequent processing more scientific. At the same time, determining the photo with the highest clarity as the target can provide higher quality image support in practical applications, enhance the overall visual effect and data reliability.

[0053] See also Figure 5 In some embodiments of the present application, step 104 in the above embodiment obtains the size of the target object in the target photo as the target size, which may include the following steps 501 to 504: 501. Obtain a grayscale image of the target photo; The server converts the target photo into a grayscale image, which is an image that removes the color information from the color image and retains only the brightness information. This process makes the value of each pixel represent its brightness, usually ranging from 0 (black) to 255 (white). The benefit of converting to a grayscale image is that it simplifies subsequent image processing steps, especially when performing edge detection, because processing single-channel images is usually much more efficient than processing multi-channel images. For example, when processing a photo showing a product, converting to a grayscale image can help highlight the shape and structure of the product and eliminate the interference of background colors.

[0054] 502. Processing the target photo by using an edge detection algorithm to obtain a corresponding binary image; After obtaining the grayscale image, the server processes the image using an edge detection algorithm to identify and extract the edges in the image. Edge detection algorithms can find the boundaries of objects by analyzing changes in pixel brightness. Common algorithms include Canny and Sobel operators. After processing, the generated binary image only retains the edge portion, and the remaining area is marked as black. This process effectively highlights the outline of the object, making subsequent analysis easier. For example, in product inspection, edge detection can clearly show the outline of the product, laying the foundation for subsequent outline extraction.

[0055] 503. Extract the contour of the binary image to obtain a contour image of the target object; After generating the binary image, the server performs contour extraction to identify the boundaries of the object. The contour extraction process involves identifying the boundary lines of the white area in the binary image and representing it as a contour image. This process can effectively extract the shape information of the target object, facilitating subsequent size measurement and analysis. For example, when detecting the shape of a product, the extracted contour image can clearly show the shape of the product, facilitating subsequent size calculations.

[0056] 504. Calculate the circumscribed rectangle of the contour image, and use the size of the circumscribed rectangle as the target size.

[0057] Finally, the server calculates the bounding rectangle of the contour image. The bounding rectangle is the smallest rectangular box that can completely surround the outline of the object. By measuring the width and height of the bounding rectangle, the server can determine the size of the target object. This size provides an important attribute of the object and is suitable for subsequent analysis and decision-making. For example, in product packaging design, calculating the size of the bounding rectangle can help design the appropriate packaging size to ensure the safety and aesthetics of the product.

[0058] By obtaining the grayscale image of the target photo, edge detection and contour extraction, the shape and size of the target object can be accurately identified. This series of steps improves the efficiency and accuracy of image processing, making subsequent size calculations more reliable. At the same time, the clear contour image and calculated target size provide important data support for practical applications and enhance the effectiveness of the overall operation.

[0059] See also Figure 6 In one embodiment of the present application, an automatic adjustment system for a camera includes: A changing unit 601, used for changing the focal length and height of the target camera in real time; The first acquisition unit 602 is used to acquire a group of photos of the target object taken by the target camera in real time during the process of changing the focal length and height of the target camera, wherein each photo corresponds to the height and focal length of the target camera; A second acquisition unit 603 is used to acquire a photo with the highest definition from a group of photos as a target photo; The third acquisition unit 604 is used to acquire the size of the target object in the target photo as the target size; A determination unit 605 is used to determine whether the ratio of the target size to the actual size of the target object is a preset imaging ratio; An execution unit 606 is configured to execute again the steps executed by the changing unit, the first acquiring unit, the second acquiring unit, the third acquiring unit and the judging unit when the judging unit 605 determines that the ratio of the target size to the actual size of the target object is not the preset imaging ratio; A determination unit 607, configured to determine a target focal length and a target height according to the target photo when the determination unit 605 determines that the ratio of the target size to the actual size of the target object is a preset imaging ratio; The adjustment unit 608 is used to adjust the target camera according to the target focal length and the target height.

[0060] In this embodiment, the change unit 601 changes the focal length and height of the target camera in real time, so that the camera can flexibly adapt to different shooting conditions. By quickly adjusting the focal length, the server can control the magnification and depth of field of the image to ensure the best visual presentation. During the adjustment process, the target camera takes a group of photos, and the first acquisition unit 602 obtains diversified image data, laying the foundation for the subsequent selection of the photos with the highest clarity. The photos with the highest clarity are extracted by the second acquisition unit 603 to ensure that the information obtained is reliable and accurate, providing a high-quality foundation for subsequent size measurement. After the third acquisition unit 604 obtains the size of the target object, the judgment unit 605 judges the ratio between it and the actual size. The automated detection mechanism of this link improves the efficiency of the entire process and can quickly determine whether the camera settings need to be readjusted. Subsequently, the adjustment unit 608 accurately adjusts the target camera according to the focal length and height determined by the determination unit 607 to ensure that each shooting setting can be optimized based on best practices. Finally, according to the adjusted focal length and height, it adapts to the shooting needs in real time, thereby realizing automatic adjustment of the focal length and height and improving efficiency. At the same time, the comprehensive performance and application value of the system are enhanced by obtaining diversified shooting angles, ensuring clarity priority, and supporting precise size measurement.

[0061] Optionally, the changing unit 601 includes: A control module, used for controlling the target camera to move a target distance in a vertical direction; The adjustment module is used to adjust the focal length of the target camera at a preset focal length change rate.

[0062] Optionally, the changing unit 601 further includes: Reset module, used to set the focus of the target camera to the maximum or minimum value.

[0063] Optionally, the first acquiring unit 602 is specifically configured to: Whenever the focus motor moves a preset distance, the target camera is controlled to shoot the target object; Get a set of photos of the target object taken by the target camera in real time.

[0064] Optionally, the second acquiring unit 603 is specifically configured to: Calculate the variance of each photo in a set of photos separately; Compare the variance of each photo, and identify the photo with the largest variance as the photo with the highest clarity; Use the photo with the highest resolution as the target photo.

[0065] Optionally, the third obtaining unit 604 is specifically configured to: Get the grayscale image of the target photo; The target photo is processed by edge detection algorithm to obtain the corresponding binary image; Perform contour extraction on the binary image to obtain the contour image of the target object; Calculate the bounding rectangle of the contour image and use the size of the bounding rectangle as the target size.

[0066] Optionally, the determining unit 605 is specifically configured to: It is determined whether the width ratio and the height ratio of the target size to the actual size of the target object are both preset imaging ratios.

[0067] In this implementation, the functions of each unit and module are the same as those described above. Figures 1 to 5 The steps in the illustrated embodiments correspond to each other and will not be described again here.

[0068] See also Figure 7 In one embodiment of the present application, an automatic adjustment device for a camera includes: Processor 701, memory 702, input and output unit 703 and bus 704; The processor 701 is connected to the memory 702, the input and output unit 703 and the bus 704; The memory 702 stores a program, and the processor 701 calls the program to execute Figures 1 to 5 Steps in the illustrated embodiment.

[0069] In this embodiment, the function of the processor 701 is the same as that of the aforementioned Figures 1 to 5 The steps in the illustrated embodiments correspond to each other and will not be described again here.

[0070] The present application also provides a computer-readable storage medium having a program stored thereon, which, when executed on a computer, causes the computer to execute Figures 1 to 5 The method in the illustrated embodiment.

[0071] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0072] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0073] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0074] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0075] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. An automatic adjustment method for a camera, characterized in that: include: Change the focus and height of the target camera in real time; In the process of changing the focal length and height of the target camera, a group of photos of the target object taken by the target camera in real time are obtained, wherein each photo corresponds to the height and focal length of the target camera; Obtaining a photo with the highest definition from the group of photos as a target photo; Acquire the size of the target object in the target photo as the target size; Determining whether the ratio of the target size to the actual size of the target object is a preset imaging ratio; If not, execute the above steps again; If yes, determining the target focal length and target height according to the target photo; The target camera is adjusted according to the target focal length and the target height.

2. The method according to claim 1, characterized in that The real-time change of the focal length and height of the target camera includes: Control the target camera to move the target distance in the vertical direction; The focus of the target camera is adjusted at a preset focus change rate.

3. The method according to claim 2, characterized in that Before adjusting the focus of the target camera at a preset focus change rate, the method further includes: Set the focus of the target camera to the maximum or minimum value.

4. The method according to claim 2, characterized in that: The focal length of the target camera is controlled by a focal length motor, and the step of obtaining a group of photos of the target object taken by the target camera in real time includes: Whenever the focus motor moves a preset distance, the target camera is controlled to shoot a target object; A group of photos of the target object taken by the target camera in real time is obtained.

5. The method according to claim 1, characterized in that: The step of obtaining the photo with the highest definition from the group of photos as the target photo comprises: Calculate the variance of each photo in the set of photos respectively; Compare the variance of each photo, and identify the photo with the largest variance as the photo with the highest clarity; Use the photo with the highest resolution as the target photo.

6. The method according to any one of claims 1 to 5, characterized in that The obtaining the size of the target object in the target photo as the target size includes: Obtaining a grayscale image of the target photo; Processing the target photo by an edge detection algorithm to obtain a corresponding binary image; Performing contour extraction on the binary image to obtain a contour image of the target object; The circumscribed rectangle of the contour image is calculated, and the size of the circumscribed rectangle is used as the target size.

7. The method according to any one of claims 1 to 5, characterized in that The determining whether the ratio of the target size to the actual size of the target object is a preset imaging ratio includes: It is determined whether the width ratio and the height ratio of the target size to the actual size of the target object are both preset imaging ratios.

8. An automatic adjustment system for a camera, characterized in that: include: A change unit, used to change the focal length and height of the target camera in real time; A first acquisition unit is used to acquire a group of photos of the target object taken by the target camera in real time during the process of changing the focal length and height of the target camera, wherein each photo corresponds to the height and focal length of the target camera; A second acquisition unit, configured to acquire a photo with the highest definition from the group of photos as a target photo; A third acquisition unit is used to acquire the size of the target object in the target photo as the target size; A judging unit, used for judging whether the ratio of the target size to the actual size of the target object is a preset imaging ratio; an execution unit, configured to, when the judgment unit determines that the ratio of the target size to the actual size of the target object is not a preset imaging ratio, re-execute the steps executed by the changing unit, the first acquiring unit, the second acquiring unit, the third acquiring unit and the judging unit; a determination unit, configured to determine a target focal length and a target height according to the target photo when the determination unit determines that the ratio of the target size to the actual size of the target object is a preset imaging ratio; An adjustment unit is used to adjust the target camera according to the target focal length and the target height.

9. An automatic adjustment device for a camera, characterized in that: include: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; A program is stored in the memory, and the processor calls the program to execute the method according to any one of claims 1 to 7. 10 . A computer-readable storage medium having a program stored thereon, wherein when the program is executed on a computer, the computer is caused to execute the method according to claim 1 .

Citation Information

Patent Citations

  • Focusing method and device, equipment and storage medium

    CN116156321A

  • Focal length control method and device based on geographical resolution, equipment and storage medium

    CN118158528A

  • Lens control method and device, target sensing system and storage medium

    CN118283419A

  • Focusing adjustment method, system and equipment of contact lens full-inspection visual equipment and medium

    CN118379360A