A camera focusing method and device, electronic equipment and storage medium

CN122513660APending Publication Date: 2026-08-04HANGZHOU HIKROBOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU HIKROBOT TECH CO LTD
Filing Date
2026-04-20
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

[0006]本申请实施例的目的在于提供一种相机调焦方法、装置、电子设备及存储介质,用以解决目前调焦方式难以对局部特征进行精确对焦的问题

Benefits of technology

[0097]本申请实施例提供的方案中,电子设备可以确定界面中所显示的相机镜头拍摄的图像中的感兴趣位置,控制相机镜头进行光学变焦,以使相机镜头拍摄聚焦清晰的感兴趣位置对应的目标图像,进而获取目标图像,并显示目标图像。针对图像中用户感兴趣的局部位置即感兴趣位置,电子设备可以控制相机镜头进行光学变焦,由于光学变焦可以无损放大所拍摄的画面,所以可以拍摄得到聚焦清晰的感兴趣位置对应的目标图像,实现对局部特征进行精确对焦,满足局部特征的检测需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122513660A_ABST
    Figure CN122513660A_ABST
Patent Text Reader

Abstract

This application provides a camera focusing method, apparatus, electronic device, and storage medium. The method includes: determining a position of interest (POI) in an image captured by a camera lens displayed on an interface; controlling the camera lens to perform optical zoom so that the camera lens captures a target image corresponding to the POI with clear focus; acquiring the target image; and displaying the target image. For a local position of interest (POI) in an image that the user is interested in, the electronic device can control the camera lens to perform optical zoom. Since optical zoom can losslessly magnify the captured image, it can capture a target image corresponding to the POI with clear focus, achieving precise focusing on local features and meeting the requirements for local feature detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine vision technology, and in particular to a camera focusing method, apparatus, electronic device and storage medium. Background Technology

[0002] Currently, in fields such as industrial automation and intelligent manufacturing, industrial cameras serve as the core component of machine vision systems. They are responsible for accurately transmitting the optical information of target objects to image sensors, and their imaging quality directly determines the accuracy and efficiency of subsequent detection, recognition, and positioning. Industrial cameras support functions such as focus adjustment and image scaling to improve operational accuracy.

[0003] Traditional industrial cameras use fixed-focus lenses, meaning their focal length cannot be changed. When the camera moves away from the target, the image sensor captures more of the scene. Since the number of pixels on the sensor remains constant, when the user needs to enlarge the image, the only solution is to crop the image, using fewer pixels to represent the content originally captured at close range. Therefore, fixed-focus cameras lose a significant number of pixels when the image is enlarged, resulting in a decrease in image accuracy.

[0004] Industrial cameras equipped with zoom lenses, due to their physical lens structure, can shift the lens elements during image magnification. This ensures that even if the working distance changes, the content mapped on the image sensor remains unchanged, pixels are not lost, and image accuracy does not decrease. Industrial cameras with zoom lenses are suitable for high-precision operations in complex and variable environments.

[0005] In zoom lens focusing methods, traditional methods are mostly purely manual focusing, which relies on the operator's professional experience, resulting in low efficiency and unstable accuracy. Some automatic focusing methods support global focusing, which can improve focusing efficiency, but it is difficult to accurately focus on local features (such as weld points or defects), thus failing to meet the needs of local feature detection. Summary of the Invention

[0006] The purpose of this application is to provide a camera focusing method, apparatus, electronic device, and storage medium to solve the problem that current focusing methods struggle to accurately focus on local features. The specific technical solution is as follows:

[0007] In a first aspect, embodiments of this application provide a camera focusing method, the method comprising:

[0008] Identify the location of interest in the image captured by the camera lens displayed on the interface;

[0009] Control the camera lens to perform optical zoom so that the camera lens captures a target image corresponding to the position of interest that is clearly focused;

[0010] Acquire the target image and display the target image.

[0011] Optionally, the step of determining the location of interest in the image captured by the camera lens displayed in the interface includes at least one of the following:

[0012] Identify the region of interest drawn by the user in the image captured by the camera lens displayed on the interface, and use it as the location of interest;

[0013] A preset reference area is displayed in the image captured by the camera lens. The reference area is adjusted according to the user's adjustment operation, and the adjusted reference area is determined as the location of interest.

[0014] The image center of the image captured by the displayed camera lens is identified as the location of interest.

[0015] Optionally, the interface displays a region of interest selection control;

[0016] The step of determining the region of interest drawn by the user in the displayed image includes:

[0017] In response to a trigger operation on the region of interest selection control, if a target selection operation is detected, the region of interest box is displayed following the target selection operation, wherein the target selection operation is a selection operation within the range of the image captured by the displayed camera lens;

[0018] If the target selection operation is detected to have stopped, the area currently selected by the region of interest box is determined as the region of interest.

[0019] Optionally, the location of interest is a region of interest; after the step of displaying the target image, the method further includes:

[0020] Obtain the sub-region of interest drawn by the user within the region of interest;

[0021] Update the location of interest to the sub-region of interest, and return to the step of controlling the camera lens to perform optical zoom.

[0022] Optionally, after the step of determining the location of interest in the image captured by the camera lens displayed in the interface, the method further includes:

[0023] In response to a selection operation for a pixel quantity option in the interface, the pixel quantity represented by the pixel quantity option indicated by the selection operation is determined as the target pixel quantity; or, the preset default pixel quantity is determined as the target pixel quantity.

[0024] The step of displaying the target image includes:

[0025] The target image is displayed according to the target pixel count.

[0026] Optionally, the interface displays zoom controls and focus controls;

[0027] The step of controlling the camera lens to perform optical zoom includes:

[0028] In response to a trigger operation on the zoom control, the camera lens is controlled to perform optical zoom based on the position of interest;

[0029] Acquire and display the magnified image captured by the camera lens after optical zoom.

[0030] If the zoomed image meets the zoom requirements, in response to the adjustment operation of the focus control, the camera lens is controlled to perform optical focus according to the focus parameters indicated by the adjustment operation, so as to capture the target image corresponding to the position of interest.

[0031] Optionally, the step of controlling the camera lens to perform optical zoom based on the position of interest in response to a trigger operation on the zoom control includes:

[0032] When the location of interest is a region of interest, in response to the triggering operation of the zoom control corresponding to the region of interest, magnification parameters are determined based on the size and position of the region of interest, and the camera lens is controlled to perform optical zoom according to the magnification parameters; or,

[0033] When the location of interest is the image center of the displayed image, in response to the zoom adjustment operation of the zoom parameter control in the interface, the magnification factor is determined, and the camera lens is controlled to perform optical zoom with the image center as the magnification center according to the magnification factor.

[0034] Optionally, the scaling parameter control includes a scaling parameter slider, a scaling parameter base value display box, and a scaling parameter step button; the step of determining the magnification factor in response to a magnification adjustment operation on the scaling parameter control in the interface includes:

[0035] In response to a sliding operation on the scaling parameter slider, based on the current position of the scaling parameter slider and a preset correspondence between slider position and magnification, the magnification corresponding to the current position is determined; or,

[0036] In response to the trigger operation of the zoom parameter step button, the magnification factor is determined based on the current value displayed in the zoom parameter base value display box and the step value corresponding to the zoom parameter step button, and the determined magnification factor is displayed in the zoom parameter base value display box.

[0037] Optionally, the scaling parameter step button includes a primary step button and a secondary step button, wherein the primary step button is a preset unit step button, and the secondary step button includes a step unit selection indicator; the method further includes:

[0038] In response to a trigger operation for the step unit selection identifier, a step unit selection drop-down menu is displayed, wherein the step unit selection drop-down menu includes multiple step units;

[0039] In response to a selection operation for the step unit, the step unit indicated by the selection operation is displayed on the secondary step button, and the step unit selection drop-down menu is closed.

[0040] Optionally, the interface displays controls for adjusting the horizontal and vertical positions; after the step of displaying the zoomed image, the method further includes:

[0041] In response to a trigger operation on a target adjustment control, the position adjustment parameters indicated by the trigger operation are determined, wherein the target adjustment control is the horizontal position adjustment control and / or the vertical position adjustment control;

[0042] Adjust the image center of the zoomed image according to the adjustment direction indicated by the target adjustment control and the position adjustment parameters.

[0043] Optionally, after the step of displaying the zoomed image, the method further includes:

[0044] In response to a trigger action on the field-of-view reset control in the interface, display the image before optical zoom; and / or,

[0045] In response to a zoom-out adjustment operation on the zoom parameter control in the interface, a zoom factor is determined, and the camera lens is controlled to perform optical zoom with the image center as the zoom center, according to the zoom factor, to capture a zoomed-out image; the zoomed-out image is acquired and displayed.

[0046] Optionally, prior to the step of determining the location of interest in the image captured by the camera lens displayed in the interface, the method further includes:

[0047] In response to a triggering operation of the tuning controls displayed on the interface, the lens parameters of the camera lens are adjusted; or, in response to an adjustment operation issued by the lens parameter adjustment controls displayed on the interface, the lens parameters of the camera lens are adjusted according to the lens parameter value indicated by the adjustment operation.

[0048] The system acquires images captured by the camera lens after adjusting the lens parameters and displays these images on the interface.

[0049] Secondly, embodiments of this application provide a camera focusing device, the device comprising:

[0050] The location of interest determination module is used to determine the location of interest in the image captured by the camera lens displayed on the interface;

[0051] An optical zoom module is used to control the camera lens to perform optical zoom so that the camera lens can capture a clear image of the target corresponding to the position of interest.

[0052] An image display module is used to acquire the target image and display the target image.

[0053] Optionally, the location of interest determination module includes:

[0054] The location of interest determination unit is used to perform at least one of the following processes:

[0055] Identify the region of interest drawn by the user in the image captured by the camera lens displayed on the interface, and use it as the location of interest;

[0056] A preset reference area is displayed in the image captured by the camera lens. The reference area is adjusted according to the user's adjustment operation, and the adjusted reference area is determined as the location of interest.

[0057] The image center of the image captured by the displayed camera lens is identified as the location of interest.

[0058] Optionally, the interface displays a region of interest selection control;

[0059] The unit for determining the location of interest includes:

[0060] The first region of interest drawing subunit is configured to respond to a trigger operation of the region of interest selection control, and, upon detecting a target selection operation, display the region of interest box following the target selection operation, wherein the target selection operation is a selection operation within the range of the image captured by the displayed camera lens;

[0061] The region of interest determination subunit is used to determine the region selected by the current region of interest box as the region of interest when the target selection operation is detected to have stopped.

[0062] Optionally, the location of interest is a region of interest; the location of interest determination unit further includes:

[0063] The second region of interest drawing subunit is used to obtain the sub-region of interest drawn by the user in the region of interest after the target image is displayed;

[0064] The region of interest update subunit is used to update the location of interest to the sub-region of interest and trigger the corresponding optical zoom module.

[0065] Optionally, the device further includes:

[0066] The pixel quantity determination module is used to, after determining the position of interest in the image captured by the camera lens displayed in the determination interface, in response to a selection operation for the pixel quantity options in the interface, determine the pixel quantity represented by the pixel quantity option indicated by the selection operation as the target pixel quantity; or, determine the preset default pixel quantity as the target pixel quantity.

[0067] The image display module includes:

[0068] An image display unit is used to display the target image according to the target pixel count.

[0069] Optionally, the interface displays zoom controls and focus controls;

[0070] The optical zoom module includes:

[0071] An optical zoom unit is configured to control the camera lens to perform optical zoom based on the position of interest in response to a trigger operation of the zoom control.

[0072] A zoom image display unit is used to acquire and display a zoomed image captured by the camera lens after optical zoom.

[0073] An optical focusing unit is configured to, in response to an adjustment operation on the focusing control, control the camera lens to perform optical focusing according to the focusing parameters indicated by the adjustment operation, in order to capture a target image corresponding to the position of interest, when it is determined that the zoomed image meets the zoom requirements.

[0074] Optionally, the optical zoom unit includes:

[0075] An optical zoom subunit, configured to, in response to a triggering operation of a zoom control corresponding to the region of interest when the location of interest is a region of interest, determine magnification parameters based on the size and position of the region of interest, and control the camera lens to perform optical zoom according to the magnification parameters; or,

[0076] When the location of interest is the image center of the displayed image, in response to a zoom adjustment operation on the zoom parameter control in the interface, the camera lens is configured to perform optical zoom with the image center as the zoom center and according to the zoom factor.

[0077] Optionally, the scaling parameter control includes a scaling parameter slider, a scaling parameter base value display box, and a scaling parameter step button; the optical zoom subunit includes:

[0078] A magnification determination subunit is used to, in response to a sliding operation on the scaling parameter slider, determine the magnification corresponding to the current position based on the current position of the scaling parameter slider and a preset correspondence between slider positions and magnification factors; or,

[0079] In response to a trigger operation on the zoom parameter step button, the zoom factor is determined based on the current value displayed in the zoom parameter base value display box and the step value corresponding to the zoom parameter step button, and the determined zoom factor is displayed in the zoom parameter base value display box.

[0080] Optionally, the scaling parameter step button includes a primary step button and a secondary step button. The primary step button is a preset unit step button, and the secondary step button includes a step unit selection indicator. The optical zoom subunit further includes:

[0081] A drop-down menu display sub-unit is used to display a step unit selection drop-down menu in response to a trigger operation for the step unit selection identifier, wherein the step unit selection drop-down menu includes multiple step units;

[0082] A step unit determination subunit is configured to, in response to a selection operation for the step unit, display the step unit indicated by the selection operation on the secondary step button and close the step unit selection drop-down menu.

[0083] Optionally, the interface displays controls for adjusting the horizontal and vertical positions; the device further includes:

[0084] The position adjustment parameter determination module is used to determine the position adjustment parameters indicated by the triggering operation in response to the triggering operation of the target adjustment control after the zoomed image is displayed, wherein the target adjustment control is the horizontal position adjustment control and / or the vertical position adjustment control;

[0085] The image center adjustment module is used to adjust the image center of the zoomed image according to the adjustment direction indicated by the target adjustment control and the position adjustment parameters.

[0086] Optionally, the device further includes:

[0087] A field-of-view restoration module is configured to, after the step of displaying the zoomed image, in response to a trigger operation on a field-of-view reset control in the interface, display an image before optical zoom; and / or,

[0088] The image reduction module is used to respond to the reduction adjustment operation of the zoom parameter control in the interface, determine the reduction factor, and control the camera lens to perform optical zoom with the image center as the reduction center according to the reduction factor to capture the reduced image; acquire the reduced image, and display the reduced image.

[0089] Optionally, the device further includes:

[0090] The lens parameter adjustment module is used to adjust the lens parameters of the camera lens in response to a trigger operation of the tuning control displayed in the interface before determining the position of interest in the image captured by the camera lens in the interface, or to adjust the lens parameters of the camera lens according to the lens parameter value indicated by the adjustment operation in response to an adjustment operation issued to the lens parameter adjustment control displayed in the interface.

[0091] The image display module is also used to acquire images captured by the camera lens after adjusting the lens parameters, and to display the images in the interface.

[0092] Thirdly, embodiments of this application provide an electronic device, including:

[0093] Memory, used to store computer programs;

[0094] When a processor executes a program stored in memory, it implements any of the methods described in the first aspect above.

[0095] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the methods described in the first aspect above.

[0096] Beneficial effects of the embodiments in this application:

[0097] In the solution provided in this application embodiment, the electronic device can determine the position of interest (POI) in the image captured by the camera lens displayed on the interface, control the camera lens to perform optical zoom, so that the camera lens captures a target image corresponding to the POI with clear focus, thereby acquiring and displaying the target image. For the local position of interest (POI) in the image that the user is interested in, the electronic device can control the camera lens to perform optical zoom. Since optical zoom can losslessly magnify the captured image, it can capture a target image corresponding to the POI with clear focus, achieving precise focusing on local features and meeting the detection requirements of local features.

[0098] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0099] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0100] Figure 1 A flowchart illustrating a camera focusing method provided in this application embodiment;

[0101] Figure 2 for Figure 1 A specific flowchart of step S101;

[0102] Figure 3 Based on Figure 1 A schematic diagram of the magnification adjustment interface in the illustrated embodiment;

[0103] Figure 4 Based on Figure 1 Another schematic diagram of the magnification adjustment interface in the illustrated embodiment;

[0104] Figure 5 for Figure 1 A specific flowchart of step S102;

[0105] Figure 6 Based on Figure 1 Another schematic diagram of the magnification adjustment interface in the illustrated embodiment;

[0106] Figure 7 Based on Figure 1 Another schematic diagram of the magnification adjustment interface in the illustrated embodiment;

[0107] Figure 8 Based on Figure 1 A schematic diagram of a pixel quantity selection interface in the illustrated embodiment;

[0108] Figure 9 Based on Figure 1 A schematic diagram of the interaction method of the scaling parameter control in the embodiment shown;

[0109] Figure 10 Based on Figure 1 A flowchart of an image center adjustment method according to the embodiment shown;

[0110] Figure 11 Based on Figure 1 A schematic diagram of a lens parameter adjustment interface in the illustrated embodiment;

[0111] Figure 12 Based on Figure 1 A schematic flowchart of a camera focusing method according to the embodiment shown;

[0112] Figure 13 This is a schematic diagram of the structure of a camera focusing device provided in an embodiment of this application;

[0113] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0114] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0115] To achieve precise focusing on local features and meet the requirements for local feature detection, embodiments of this application provide a camera focusing method, apparatus, electronic device, computer-readable storage medium, and computer program product. The camera focusing method provided in this application embodiment is described below.

[0116] The camera focusing method provided in this application can be applied to any electronic device that needs to control the focusing of a camera lens to achieve precise focusing on local features. For example, it can be a host computer, control device, processing device, etc. connected to the camera; for clarity, it will be referred to as an electronic device below. The camera can be an industrial camera, an industrial intelligent camera, a surveillance camera, etc., and is not specifically limited here.

[0117] See Figure 1A camera focusing method is disclosed, comprising: S101, determining a position of interest (POI) in an image captured by a camera lens displayed on an interface; S102, controlling the camera lens to perform optical zoom, so that the camera lens captures a target image corresponding to the POI with clear focus; S103, acquiring the target image and displaying the target image. In this embodiment, for a local position of interest (POI) in an image that is of interest to the user, the electronic device can control the camera lens to perform optical zoom. Since optical zoom can losslessly magnify the captured image, a target image corresponding to the POI with clear focus can be captured, achieving precise focusing on local features and meeting the detection requirements of local features.

[0118] In the camera focusing method provided in this application embodiment, the electronic device can display a camera focusing interface, which may include an image display area, such as an image display window. The image display area may display an image captured by the camera lens. This image may include targets of interest to the user, such as targets to be detected, targets to be identified, targets to be classified, etc., without specific limitations herein.

[0119] Based on the image captured by the displayed camera lens, the electronic device can determine the location of interest (ROI) within the image, that is, the local area in the image that the user is interested in. In one implementation, the user can determine the ROI through an interactive interface, and the electronic device acquires the user-determined ROI. In another implementation, the electronic device can automatically determine the ROI. For example, in a historical task, if all ROIs in the image are region A, then the electronic device can determine the location corresponding to region A in the currently displayed image as the ROI.

[0120] After determining the location of interest, the electronic device can execute step S102, which involves controlling the camera lens to perform optical zoom, so that the camera lens can capture a clearly focused image of the target corresponding to the location of interest. The electronic device can control the camera lens to perform optical zoom; the determination of the location of interest can be used as a zoom command to trigger the action of controlling the camera lens to perform optical zoom. Alternatively, a zoom control can be displayed on the interface, which the user can trigger to issue a zoom command. Once the electronic device receives this zoom command, it can control the camera lens to perform optical zoom.

[0121] Optical zoom refers to the continuous change of the effective focal length of a camera lens through the coordinated and precise movement of the zoom and compensation lens groups within the lens, thereby adjusting the field of view and image magnification. Optical zoom eliminates the need to change lenses, does not compromise image quality, and can flexibly adapt to targets of different sizes and distances. By using optical zoom, precise focusing on a location of interest can be achieved, resulting in a clearly focused image of that location—the target image.

[0122] In step S103 above, the electronic device can acquire and display the target image. The interface will then present a clear image of the target image corresponding to the location of interest, including local features corresponding to that location. Users can view these local features through the interface. The target image can also be used for subsequent image processing, such as target detection, target recognition, and target localization, all of which provide clear local features to ensure the accuracy and efficiency of subsequent image processing.

[0123] In one possible implementation, the step of determining the position of interest (POI) in the image captured by the camera lens displayed on the interface may include at least one of the following: determining a region of interest drawn by the user in the image captured by the camera lens displayed on the interface as the POI; displaying a preset reference region in the displayed image captured by the camera lens, adjusting the reference region according to the user's adjustment operation, and determining the adjusted reference region as the POI; and determining the image center of the displayed image captured by the camera lens as the POI. In this embodiment, the POI can be determined in various ways. Regardless of the method used to determine the POI, the electronic device can accurately determine the POI, ensuring that subsequent precise focusing can be performed on the POI.

[0124] In one implementation, the electronic device can determine the region of interest (ROI) drawn by the user in an image captured by a camera lens displayed on the interface, as the location of interest. The user can draw the ROI in the displayed image according to actual image processing needs; the image area included by the ROI is the area that needs to be magnified and focused, and the electronic device can determine this as the location of interest.

[0125] As another implementation, to facilitate user operation, the electronic device can display a preset reference area in the image captured by the camera lens. For example, a rectangular area of ​​a preset size can be displayed in the center of the image. Users can adjust the displayed reference area according to their actual needs, including adjusting the size and / or position of the reference area. Of course, if the size and position of the reference area both match the area that the user wants to zoom in on, then the user can leave the reference area unchanged; in this case, the reference area is the position of interest.

[0126] Users can change the position of the reference area by dragging it, and change its size by dragging its boundaries; no specific limitations are specified here. The electronic device can then adjust the reference area according to the user's adjustments and select the adjusted reference area as the location of interest.

[0127] As another implementation, the electronic device can also determine the image center of the image captured by the displayed camera lens as the location of interest. Since the local feature to be focused on is generally more likely to be located near the center of the image, the electronic device can determine the image center of the image captured by the displayed camera lens as the location of interest to focus on the area near the image center.

[0128] In one possible implementation, the interface displays a region of interest selection control, see [link to relevant documentation]. Figure 2 The steps described above for determining the region of interest (ROI) drawn by the user in the displayed image may include: S201, in response to a trigger operation on the ROI selection control, displaying an ROI box following the target selection operation when a target selection operation is detected, wherein the target selection operation is a selection operation within the range of the image captured by the displayed camera lens; S202, determining the area selected by the current ROI box as the ROI when the target selection operation is detected to have stopped. In this embodiment, the interface can provide an ROI selection control to facilitate the user in drawing the ROI. After the user issues a trigger operation on the ROI selection control, the electronic device can display the ROI box following the selection operation when it detects that the user is performing a selection operation within the range of the displayed image, and determine the area selected by the current ROI box as the ROI when the target selection operation is detected to have stopped. This provides an interactive interface to facilitate the user in determining the ROI to be precisely focused.

[0129] The interface can provide a region of interest selection control for user interaction, allowing users to draw regions of interest using this control. For example, see [link to example]. Figure 3 The zoom adjustment area on the left side of the interface displays a "select area of ​​interest" button, which allows users to select the region of interest. Users can trigger this selection by clicking, long-pressing, or hovering the mouse. The right side of the interface displays the camera view window, which shows the image captured by the camera lens.

[0130] After the user issues the above trigger operation, the electronic device can continuously detect whether the user issues a selection operation and the position of the selection operation. The selection operation can be an operation of pressing and holding the mouse at the first position and dragging the cursor to the second position. This selection operation is used to select a rectangle with the first position and the second position as diagonal vertices.

[0131] When an electronic device detects a target selection operation, it can follow the target selection operation to display a region of interest box. The target selection operation is a selection operation within the range of the image captured by the displayed camera lens. In other words, when the electronic device detects that the user presses down the mouse and drags the cursor at the first position within the range of the image, it can follow the user's operation and display a rectangle with the first position as the vertex and the direction of the cursor dragging as the diagonal direction.

[0132] Furthermore, upon detecting that the target selection operation has stopped, the area currently selected by the region of interest box is determined as the region of interest. When the electronic device detects that the user has dragged the cursor to a second position within the image's range and released the mouse, it can determine that the target selection operation has stopped, and thus determine the rectangle with the first position as its vertex and the second position as its diagonal vertex as its first position as the region of interest.

[0133] For example, see Figure 4 Users can draw the region of interest in the image in the camera window displayed on the right side of the interface according to the above drawing process, and the region of interest 410 drawn by the user can then be displayed in the image.

[0134] In one implementation, if a user is not satisfied with the region of interest displayed in the current image, they can adjust the region of interest. For example, they can change the position of the region of interest by dragging it, or change its size by dragging its boundaries. No specific limitations are made here.

[0135] In one possible implementation, the aforementioned location of interest is a region of interest (ROI). After the step of displaying the target image, the method further includes: acquiring a sub-region of interest drawn by the user within the ROI; updating the location of interest to the sub-region of interest; and returning to the step of controlling the camera lens to perform optical zoom. In this embodiment, if the displayed target image does not meet the user's needs, the user can continue to draw a region of interest, i.e., a sub-region of interest, within the ROI. In this way, the electronic device can update the location of interest to the sub-region of interest and return to the step of controlling the camera lens to perform optical zoom, thereby obtaining a target image corresponding to a clearly focused sub-region of interest captured by the camera lens, achieving precise focusing on further local features.

[0136] The method by which the user draws a sub-region of interest within the region of interest is the same as the method by which the user draws the region of interest in the image in the above embodiments, and will not be repeated here. After the user completes the drawing of the sub-region of interest, it indicates that the user wants to further refine the focus on the local content included in the sub-region of interest from the original region of interest. Therefore, the electronic device can update the above-mentioned position of interest as the sub-region of interest and execute the step of controlling the camera lens to perform optical zoom.

[0137] The process of drawing the sub-region of interest and performing optical zoom based on the updated position of interest can be repeated multiple times until the target image displayed on the interface meets the user's needs.

[0138] In one possible implementation, the interface displays zoom and focus controls, see [link to relevant documentation]. Figure 5 The steps described above for controlling the camera lens to perform optical zoom may include: S501, responding to a trigger operation on the zoom control, controlling the camera lens to perform optical zoom based on the position of interest; S502, acquiring and displaying the zoomed image captured by the camera lens; S503, if the zoomed image meets the zoom requirements, responding to an adjustment operation on the focus control, controlling the camera lens to perform optical focus according to the focus parameters indicated by the adjustment operation, so as to capture the target image corresponding to the position of interest. In this embodiment, the interface provides zoom control and focus control. Users only need to issue corresponding operations on the zoom control and focus control to trigger the zoom and focus actions of the camera lens respectively, so as to obtain the target image corresponding to the precisely focused position of interest. For multi-specification and multi-scenario detection needs, there is no need to repeatedly manually adjust parameters, the changeover configuration time is short, and the focus configuration process is highly efficient, which can meet the needs of efficient production line production.

[0139] To capture a sharp image, a camera lens employs a focusing process that includes zooming and focusing. Zooming magnifies or reduces the size of the image being captured. Essentially, zooming is the ratio of the focal length change of an optical zoom lens—the ratio of its maximum effective focal length to its minimum effective focal length—and is used to quantify the lens's ability to magnify or reduce the image. The zoom value is determined by the movement of the zoom and compensation lens groups within the lens. A larger zoom range allows for a wider field of view and a broader range of magnification. Focusing, on the zoomed image, involves adjusting the focus parameters of the current camera image to achieve a sharp and visible focus.

[0140] The user can trigger an operation on the zoom control displayed on the interface. In step S501 above, the electronic device can respond to the trigger operation and control the camera lens to perform optical zoom based on the location of interest. In one embodiment, the electronic device can drive the camera's zoom motor to move the lens group, thereby completing the zoom.

[0141] Since users want to focus precisely on the location of interest, zooming generally refers to magnifying the displayed image. Electronic devices can control the camera lens to perform optical zoom to magnify and capture the location of interest in a localized manner.

[0142] Furthermore, the electronic device can acquire and display the zoomed image (optically magnified) captured by the camera lens. For example, see [link to example]. Figure 6 The camera view window on the right side of the interface displays the zoomed image after optical zoom. As you can see, the zoomed image shows a local view of the area of ​​interest.

[0143] Next, the electronic device can perform the above step S503, that is, when it is determined that the zoomed image meets the zoom requirements, in response to the adjustment operation of the focus control, it controls the camera lens to perform optical focus according to the focus parameters indicated by the adjustment operation, so as to capture the target image corresponding to the position of interest.

[0144] Whether the zoomed image meets the zoom requirements can be determined manually. That is, the user can determine whether the zoomed image meets the zoom requirements by observation. For example, the user can determine whether all the details to be captured in the zoomed image have been included. If so, the zoomed image meets the zoom requirements. If not, the zoomed image does not meet the zoom requirements. The user can continue to control the camera lens to perform optical zoom until the zoomed image meets the zoom requirements.

[0145] Of course, electronic devices can also determine whether the details to be captured have been fully included based on the content of the zoomed image and the details to be captured, thereby determining whether the zoomed image meets the zoom requirements, which is all reasonable.

[0146] Once the zoomed image meets the zoom requirements, the user can issue an adjustment operation to the aforementioned focus control. The electronic device can then respond to the adjustment operation, determine the focus parameters indicated by the adjustment operation, and then control the camera lens to perform optical focus according to the focus parameters. As a result, the camera lens can capture the target image corresponding to the location of interest.

[0147] The focus control can be displayed in the form of an input box, a slider, etc., without specific limitations. Users can make adjustments by entering focus parameters in the input box or dragging the slider. In one embodiment, the electronic device can determine the focus parameters indicated by the adjustment operation, and then drive the camera's focus motor according to the focus parameters to move the lens group, thereby completing the focusing and capturing the target image corresponding to the position of interest.

[0148] For example, see Figure 6 The focus control 610 is displayed on the lower left side of the interface, specifically including the "Focus" prompt text, an adjustment slider, and a focus parameter display box. The focus parameter display box also includes adjustment buttons. Users can adjust the focus by dragging the slider or clicking the adjustment buttons. The current focus parameter values ​​are simultaneously displayed in the focus parameter display box, for example... Figure 6 The number 1000 is shown in the figure.

[0149] Users can manually adjust the camera lens's focus parameters to fine-tune the focus effect on image details until the image is no longer out of focus, meeting the configuration requirements for high-precision operations. See the image below for the effect after adjustment. Figure 7 The target image displayed in the camera window on the right side of the interface has clear details, enabling precise focusing on local features.

[0150] In one implementation, the camera lens can also perform autofocus, which can continuously change the position of the lens group according to the current image sharpness until it finds the position corresponding to the image with a sharpness threshold, thereby completing autofocus, which is also reasonable.

[0151] In one possible implementation, after the step of determining the location of interest in the image captured by the camera lens displayed in the interface, the method may further include: in response to a selection operation of pixel quantity options in the interface, determining the pixel quantity represented by the pixel quantity option indicated by the selection operation as the target pixel quantity; or, determining a preset default pixel quantity as the target pixel quantity. Correspondingly, the step of displaying the target image may include: displaying the target image according to the target pixel quantity. In this embodiment, after determining the location of interest, the user can select the desired target pixel quantity from the pixel quantity options displayed in the interface, or the electronic device can determine the target pixel quantity as a preset default pixel quantity. Subsequently, after obtaining the target image, the target image can be displayed according to the target pixel quantity. A method for setting the pixel quantity of the displayed image can be provided to the user for convenient operation.

[0152] The pixel quantity options can be displayed as a pop-up window, a drop-down menu, or in a preset area of ​​the current interface; no specific limitation is made here. In one embodiment, after the user draws an area of ​​interest on the interface, the electronic device can display pixel quantity options for the user to select. In another embodiment, after the user triggers the zoom control, pixel quantity options can be displayed for the user to select. In yet another embodiment, pixel quantity options can be displayed after displaying the zoomed image, allowing the user to select, and then adjusting the pixel quantity of the displayed zoomed image based on the user's selected target pixel quantity.

[0153] If the electronic device has determined the target pixel count before displaying the zoomed image, then the zoomed image will be displayed according to the target pixel count. Furthermore, after optical focusing, the interface will also display the target image with the target pixel count.

[0154] For example, see Figure 8 The interface can display a pixel selection pop-up window, which can include prompt text and pixel quantity options. The prompt text is "Please select the number of pixels to be included in the enlarged image". The pixel quantity options include 1.6M and 3.2M. Users can click on the options to select the corresponding number of pixels to be included in the enlarged image, i.e., the target number of pixels.

[0155] The pixel selection pop-up window can also include a confirmation button and a cancel button. As one implementation, after the user clicks the confirmation button, the electronic device can trigger the camera lens to perform optical zoom, magnifying the area of ​​interest to the selected pixel level. After the user clicks the cancel button, the zoom operation can be abandoned.

[0156] In one possible implementation, the step of controlling the camera lens to optically zoom based on the position of interest in response to a trigger operation of the zoom control may include: if the position of interest is a region of interest, in response to a trigger operation of the zoom execution control corresponding to the region of interest, determining a magnification parameter based on the size and position of the region of interest, and controlling the camera lens to optically zoom according to the magnification parameter; or, if the position of interest is the image center of the displayed image, in response to a magnification adjustment operation of the scaling parameter control in the interface, determining a magnification factor, and controlling the camera lens to optically zoom with the image center as the magnification center according to the magnification factor. In this embodiment, two magnification adjustment methods are provided: automatic mode and manual mode, instead of a single, purely manual adjustment mode that relies entirely on the operator's professional experience, resulting in low efficiency and unstable accuracy. This embodiment provides mode adaptation; the automatic mode requires no professional experience and is suitable for batch standardized configuration, improving configuration efficiency by more than 80% compared to the traditional manual method; the manual mode supports personalized and flexible adjustments, meeting high-precision customization needs, adapting to operators with different skill levels and diverse industrial scenarios, offering flexibility and efficiency.

[0157] In automatic mode, the aforementioned location of interest is the region of interest determined by the user. The electronic device can display zoom control on the interface. To facilitate user operation, as one implementation, the zoom control can be displayed near the region of interest. For example, see... Figure 4 A "Double Up" button 420 can be displayed above the area of ​​interest, allowing users to trigger the operation by clicking the button 420. Alternatively, the double-up control can also be displayed... Figure 4 The parameter panel area shown on the left can also be displayed in the form of pop-ups, etc., which are not specifically limited here.

[0158] Furthermore, the electronic device can determine the magnification parameters based on the size and location of the region of interest (ROI). Since the ROI is a local feature in the image that the user wants to magnify, the camera lens should be aligned with the center of the ROI, and the optical axis of the camera lens should be aligned with this center point for zooming. The magnification factor can be determined based on the relationship between the size of the currently displayed image and the size of the ROI. After the magnification parameters are determined, the electronic device can control the camera lens to perform optical zoom according to the magnification parameters.

[0159] In manual mode, the location of interest is the center of the displayed image. In other words, if the user does not select the area of ​​interest but manually adjusts the magnification using the zoom parameter control displayed in the interface, the location of interest will be the center of the displayed image by default.

[0160] When a user performs a zoom adjustment operation on the zoom parameter control in the interface, the electronic device can respond to the zoom adjustment operation and determine the zoom level. The zoom parameter control can be an input box, a selection button, etc., and is not specifically limited here. For example, if the zoom parameter control is an input box, the user can enter a zoom level in the input box, such as 5.6, 8, 10.5, etc., and the electronic device can then obtain that zoom level.

[0161] Once the magnification factor is determined, the electronic device can control the camera lens to perform optical zoom with the image center as the magnification center, thereby presenting magnified local features according to the user's needs.

[0162] In one possible implementation, the scaling parameter control includes a scaling parameter slider, a scaling parameter base value display box, and a scaling parameter step button. The step of determining the magnification factor in response to a zoom adjustment operation on the scaling parameter control in the interface may include: in response to a sliding operation on the scaling parameter slider, determining the magnification factor corresponding to the current position based on the current position of the scaling parameter slider and a preset correspondence between slider positions and magnification factors; or, in response to a trigger operation on the scaling parameter step button, determining the magnification factor based on the current value displayed in the scaling parameter base value display box and the step value corresponding to the scaling parameter step button, and displaying the determined magnification factor in the scaling parameter base value display box. In this embodiment, to facilitate manual operation by the user, the scaling parameter control includes a scaling parameter slider, a scaling parameter base value display box, and a scaling parameter step button. Therefore, the user can manually adjust the scaling parameters in at least two ways, making the operation simple and convenient, and enabling more convenient adjustment of the screen effect.

[0163] The scaling parameter control may include a scaling parameter slider, a scaling parameter base value display box, and a scaling parameter step button. The scaling parameter slider is used to change the scaling parameter by dragging, the scaling parameter base value display box is used to display the scaling parameter value, and the scaling parameter step button is used to change the scaling parameter by clicking. Users can choose to adjust the scaling parameter using the scaling parameter slider and / or the scaling parameter step button according to their own habits and preferences.

[0164] In one implementation, a user can slide the scaling parameter slider, and the electronic device can respond to the sliding operation, determining the magnification corresponding to the current position based on the current position of the scaling parameter slider and the preset correspondence between slider position and magnification.

[0165] The zoom level of a camera lens has a certain range, so the total length of the zoom parameter slider corresponds to the range of zoom levels. There is a one-to-one correspondence between the position of each slider and the magnification. Based on this, the electronic device can determine the magnification corresponding to the current position of the zoom parameter slider.

[0166] For example, see Figure 3 The left side of the interface displays a scaling parameter control 310, specifically including a scaling parameter slider 311, a scaling parameter base value display box 312, and a scaling parameter step button 313. Currently, the scaling parameter slider 311 is located on the far left, corresponding to a scaling factor of 1x. The scaling parameter base value display box 312 displays "1x", indicating that the current scaling factor is 1x. If the user drags the scaling parameter slider to... Figure 6 As shown, the electronic device can determine the magnification corresponding to the current position, which is 5.6x, based on the current position of the scaling parameter slider and the preset correspondence between slider position and magnification. At this time, the scaling parameter base value display box can display "5.6x", indicating that the current magnification is 5.6x.

[0167] In another implementation, the user can trigger the scaling parameter step button, and the electronic device can respond to the trigger operation, determine the magnification based on the current value displayed in the scaling parameter base value display box and the step value corresponding to the scaling parameter step button, and display the determined magnification in the scaling parameter base value display box.

[0168] Users can trigger the zoom parameter step button by clicking or other means, adjusting the magnification according to the corresponding step size. The electronic device determines the magnification based on the step size and the current value displayed in the zoom parameter base value display box. If the user selects a zoom parameter step button to decrease the magnification, the electronic device determines the magnification as the difference between the current value displayed in the zoom parameter base value display box and the corresponding step size. If the user selects a zoom parameter step button to increase the magnification, the electronic device determines the magnification as the sum of the current value displayed in the zoom parameter base value display box and the corresponding step size. Then, the value displayed in the zoom parameter base value display box is updated to the determined magnification for easy viewing by the user.

[0169] For example, see Figure 3 The user can click the "+1" button in the scaling parameter step button 313 to trigger an operation. The electronic device then determines the magnification factor (2x) by summing the current value (1) displayed in the scaling parameter base value display box with the step value (1) corresponding to the "+1" button. Therefore, "2x" can be displayed in the scaling parameter base value display box. Figure 3 (Not shown in the image) indicates that the current magnification is 2x.

[0170] In one possible implementation, the scaling parameter step button includes a primary step button and a secondary step button. The primary step button is a preset unit step button, and the secondary step button includes a step unit selection indicator. The method may further include: in response to a trigger operation on the step unit selection indicator, displaying a step unit selection drop-down menu, wherein the step unit selection drop-down menu includes multiple step units; in response to a selection operation on the step unit, displaying the step unit indicated by the selection operation on the secondary step button, and closing the step unit selection drop-down menu. In this embodiment, the user can adjust the magnification according to a preset unit step size using the primary step button, and can select different step units using the step unit selection indicator included in the secondary step button, thereby adjusting the magnification according to the step size corresponding to the user's desired step unit. The user can flexibly select the step unit, further facilitating manual adjustment of the magnification.

[0171] The first-level step button is a preset unit step button, which can be set to 1 unit step, meaning the adjustment step size for the first-level step button is 1. Users can adjust the magnification in steps of 1 using the first-level step button.

[0172] The secondary step button includes a step unit selection indicator. Users can trigger the step unit selection indicator by clicking or other means. In turn, the electronic device can respond to the user's trigger operation and display a step unit selection drop-down menu, which includes multiple step units.

[0173] Furthermore, users can select their desired step unit from the multiple step units included in the step unit selection drop-down menu, and can make the selection operation by clicking, long-pressing, or other actions. The electronic device can then display the step unit indicated by the user's selection operation on the secondary step button, indicating that the currently displayed secondary step unit is the selected step unit. At this point, the step unit selection drop-down menu can be closed.

[0174] See Figure 9The scaling parameter step buttons include a primary step button 910 and a secondary step button 920. The primary step button 910 has a preset unit of 0.1, and the secondary step button includes a step unit selection indicator 921. When the user clicks the step unit selection indicator 921, a step unit selection drop-down menu 930 is displayed, which includes multiple step units: +1, +2, +2.5, and +3. If the user clicks "+3", it means that the user wants to change the step unit corresponding to the secondary step button to 3 steps. The electronic device can display "+3" in the secondary step button 920, indicating that the current step unit corresponding to the secondary step button is modified to 3 steps, and can simultaneously close the step unit selection drop-down menu 930.

[0175] In one possible implementation, the interface displays controls for adjusting the horizontal and vertical positions. Following the step of displaying the zoomed image, see [link to relevant documentation]. Figure 10 The above method may further include: S1001, in response to a trigger operation on a target adjustment control, determining the position adjustment parameters indicated by the trigger operation, wherein the target adjustment control is the horizontal position adjustment control and / or the vertical position adjustment control; S1002, adjusting the image center of the zoomed image according to the adjustment direction indicated by the target adjustment control and the position adjustment parameters. In this embodiment, a horizontal position adjustment control and a vertical position adjustment control are provided in the interface. Users can adjust the image center of the zoomed image using the horizontal position adjustment control and / or the vertical position adjustment control to adjust the center of the field of view of the display screen, so as to facilitate users to view the target to be observed in the magnified zoomed image.

[0176] In some cases, such as in the manual mode described above, the zoomed image is obtained by optically zooming with the center of the displayed image as the magnification center. Therefore, the local target that the user wants to photograph may be off-center from the zoomed image, or may not be visible in the zoomed image. For example, if the magnification is high, the local target that the user wants to photograph may appear very large in the zoomed image, making it difficult to identify whether it is indeed the target.

[0177] At this point, users can adjust the image center position using the horizontal and / or vertical position adjustment controls for easier viewing of local targets. Users can trigger operations on the target adjustment controls, which can be horizontal, vertical, or both. Users can choose to trigger any of the adjustment controls as needed.

[0178] The horizontal position adjustment control is used to adjust the position of the image center of the zoomed image in the horizontal direction, and the vertical position adjustment control is used to adjust the position of the image center of the zoomed image in the vertical direction.

[0179] In response to a trigger operation on a target adjustment control, the electronic device can determine the position adjustment parameters indicated by the trigger operation, which can be a specific adjustment amount. Then, the electronic device can adjust the image center of the zoomed image according to the adjustment direction and position adjustment parameters indicated by the target adjustment control; the adjustment direction is the horizontal direction and / or the vertical direction of the image.

[0180] For example, see Figure 6 The interface displays a horizontal position adjustment control 620 and a vertical position adjustment control 630 in the middle left area. Users can use the horizontal position adjustment control 620 to adjust the horizontal position of the center of the zoomed image displayed on the right side of the interface, and use the vertical position adjustment control 630 to adjust the vertical position of the center of the zoomed image displayed on the right side of the interface. When the user triggers the horizontal position adjustment control 620, the electronic device determines the adjustment direction to be horizontal; when the user triggers the vertical position adjustment control 630, the electronic device determines the adjustment direction to be vertical.

[0181] As one implementation, the horizontal and vertical position adjustment controls can also consist of a slider, a primary step button, a position display box, and a secondary step button for user convenience. See also Figure 6 Taking the vertical position adjustment control as an example, the vertical position adjustment control can specifically include a slider on the left and a first-level step button, a position display box, and a second-level step button on the right. The second-level step button can include a step unit selection indicator. The position display box shows the current vertical position of the image center of the zoomed image. Users can adjust the vertical position of the image center of the zoomed image according to the corresponding step size by clicking the first-level step button or the second-level step button. They can also select different second-level step units by using the step unit selection indicator. See [link to relevant documentation]. Figure 9 The operation methods and interface display interactions of the horizontal and vertical position adjustment controls are similar to those of the scaling parameter controls described above. For details, please refer to the description of the scaling parameter controls above, which will not be repeated here.

[0182] In one possible implementation, after the step of displaying the zoomed image described above, the method may further include: displaying the image before optical zoom in response to a trigger operation of a field-of-view reset control in the interface; and / or, in response to a zoom-out adjustment operation of a zoom parameter control in the interface, determining a zoom factor and controlling the camera lens to perform optical zoom with the image center as the zoom-out center according to the zoom factor to capture a zoomed-out image; acquiring the zoomed-out image and displaying the zoomed-out image. In this embodiment, the user can process the zoomed image in at least one of the above two methods. This allows the user to easily adjust the magnification effect of the image when the zoomed image is magnified too much, resulting in excessive detail of the local target to be observed, so that the visibility of the local target to be observed meets the requirements.

[0183] In one embodiment, a field-of-view reset control can be displayed on the interface. Users can trigger the field-of-view reset control by clicking or other means. This indicates that the user wants to reset the field of view of the image captured by the current camera lens, that is, return to the field of view of the image displayed before the zoom operation. The electronic device can then respond to the trigger operation and display the image before optical zoom.

[0184] For example, see Figure 6 The upper left side of the interface displays a field-of-view reset control, also known as a field-of-view reset button. After the user clicks the field-of-view reset button, the electronic device can display the image before optical zoom in the display window on the right side of the interface. For example, it can display... Figure 3 The image shown is before zooming. Users can use it based on... Figure 3 The image before zooming is shown, and the location of interest is redefined.

[0185] In another implementation, the user can use the zoom parameter control in the interface to adjust the zoom level of the camera lens. The user can issue a zoom adjustment operation to the zoom parameter control, and the electronic device can determine the zoom level indicated by the zoom adjustment operation and control the camera lens to perform optical zoom with the image center as the zoom center and according to the zoom level. The camera lens can then capture the zoomed-down image, and the electronic device can then acquire and display the zoomed-down image.

[0186] The specific process of optical zooming of a camera lens according to the reduction factor is basically the same as the specific process of optical zooming of a camera lens according to the magnification factor, except that the movement direction of the lens group is reversed. Please refer to the explanation of the specific process of optical zooming according to the magnification factor above, which will not be repeated here.

[0187] For example, see Figure 6The left side of the interface displays adjustment buttons for "Zoom Scale," including a "-1" button and a "-0.1" button. The "-1" button subtracts 1 from the current magnification, and the "-0.1" button subtracts 0.1 from the current magnification. Users can click the adjustment buttons to zoom out. The electronic device then determines the zoom level by subtracting the value corresponding to the clicked adjustment button from the current magnification. The device then controls the camera lens to optically zoom according to this zoom level, acquiring and displaying the reduced image captured by the camera lens.

[0188] In one possible implementation, prior to the step of determining the position of interest in the image captured by the camera lens displayed on the interface, the method may further include: adjusting the lens parameters of the camera lens in response to a trigger operation of a tuning control displayed on the interface, or adjusting the lens parameters of the camera lens according to the lens parameter value indicated by the adjustment operation in response to an adjustment operation issued by the lens parameter adjustment control displayed on the interface; acquiring an image captured by the camera lens after adjusting the lens parameters, and displaying the image on the interface. In this embodiment, when performing... Figure 1 Before the camera focusing process in the illustrated embodiment, a coarse adjustment of the camera lens can be performed first. This involves adjusting the lens parameters to ensure that the image captured by the displayed camera lens is basically clear, making it easier for the user to identify the location of interest. Compared to the single focusing process in current related solutions, this embodiment constructs a closed-loop verification logic of "coarse adjustment-fine adjustment-final adjustment" to ensure the clarity of key details and reduce the misjudgment rate in subsequent image processing.

[0189] In this embodiment, "coarse adjustment" refers to the process of adjusting the lens parameters of the camera lens; "fine adjustment" refers to the process of controlling the camera lens to perform optical zoom as described in the above embodiment; and "final adjustment" refers to the process of controlling the camera lens to perform optical focus. After the "coarse adjustment-fine adjustment-final adjustment" process, an image with clear local features is obtained.

[0190] In one implementation, a tuning control can be displayed on the interface. The user can trigger the tuning control to activate the "one-click tuning function," allowing the electronic device to automatically adjust the camera lens parameters to meet the expected algorithm standards, essentially ensuring image clarity. In another implementation, a lens parameter adjustment control can be displayed on the interface. The user can adjust the lens parameter values ​​indicated by the adjustment operation, and the electronic device can adjust the camera lens parameters accordingly. These lens parameters include, but are not limited to, brightness, exposure, focus, white balance, and gain.

[0191] See Figure 11The interface features a one-click tuning button at the top left. Users can click this button to trigger the adjustment, and the electronic device will automatically adjust the camera lens parameters based on a preset algorithm, ensuring the image captured is generally clear. The interface also displays the parameter categories for each lens and automatic adjustment functions, such as "Auto Exposure" and "Auto Focus." Clicking these buttons automatically adjusts multiple parameters. For example, Auto Exposure adjusts brightness, exposure, and gain to meet algorithm standards, while Auto Focus automatically controls the camera lens to adjust to the focal length corresponding to the focus item according to the specified step size.

[0192] Users can also adjust the corresponding lens parameters using the adjustment controls displayed on the interface. For example, users can adjust the lens parameters by... Figure 11 Enter the exposure time value in the exposure time input box shown to initiate the adjustment operation. The electronic device will then adjust the camera lens exposure time to that value. Other lens parameters can be adjusted in the same way, which will not be elaborated here. The interface provides lens parameter adjustment controls from general to specific, offering users the interactive methods and automated adjustment functions they need.

[0193] In one implementation, if the image captured by the camera lens after adjusting the lens parameters, as displayed in the interface, already meets the high-precision focusing requirements for the current target and satisfies the configuration requirements for subsequent image processing, then the camera focusing process can be directly terminated, the imaging effect adjustment completed, and the configuration work for subsequent image processing carried out.

[0194] If the current target's focus is not yet sufficient for high-precision focusing, the process can continue. Figure 1 The camera focusing process in the illustrated embodiment. For an example, see [link to example]. Figure 11 Users can access the magnification adjustment interface by clicking the "Magnification Adjustment" button located under the "Zoom" related parameters on the interface. Figure 3 The interface shown can then be based on Figure 3 The interface shown allows for operations such as drawing the region of interest and adjusting the scaling factor as described in the above embodiments.

[0195] The pixel count of the image displayed on the interface of an electronic device can be the same as the pixel count of the image sensor of a camera lens. In other words, the image displayed on the interface is the original image captured by the image sensor. For example, if the image sensor has a pixel count of 200M, then the image displayed on the interface will also have a pixel count of 200M. Subsequent operations such as region of interest selection and optical zoom are all performed based on the original image captured by the image sensor.

[0196] Of course, the pixel count of the image displayed on the interface can also be a preset value, such as 100M, 32M, 10M, etc. Then, electronic devices can compress images captured by camera lenses to obtain the desired image for display. All of this is reasonable.

[0197] Regarding the above Figures 3-11 The same interface content is not repeated in the descriptions of all interface diagrams; please refer to the explanations of each interface diagram. Each interface can also display text prompts, including "Manually adjust to increase the difficulty of focusing by non-destructively zooming in on the details of the specified target image," "Use ROI to frame the target object requiring fine focusing for non-destructive local image zooming," and "Adjust the parameters below or drag the image directly with the mouse to modify the field of view position on the right side of the image." The upper right corner of the image display window on the right side of the interface also displays image adjustment buttons, including small, large, 1:1, and full screen; clicking them will display the image in the corresponding manner.

[0198] In one possible implementation, prior to the step of adjusting the camera lens parameters in response to the triggering operation of the tuning controls displayed on the interface, pre-focusing preparation work is also included. In this embodiment, a complete closed-loop verification process of "preliminary preparation - initial coarse adjustment - mode-magnification fine adjustment - final focus fine adjustment" is constructed, gradually optimizing parameters from coarse to fine, solving the problem of insufficient accuracy of traditional single-shot focusing, reducing the probability of misadjustment, and improving configuration stability and reliability.

[0199] Preparations before focusing may include: setting up the camera station, properly positioning the target, establishing a stable communication connection between the camera and the electronic equipment software, and ensuring the hardware link and power supply system are functioning correctly. These steps provide the foundation for subsequent lens parameter adjustments and focus configuration. The communication connection between the camera and the electronic equipment software can be an Ethernet connection, a USB (Universal Serial Bus) connection, etc., and is not specifically limited here.

[0200] In one possible implementation, see Figure 12 The camera focusing method provided in this application embodiment will be described exemplarily. The camera focusing method provided in this application embodiment may include the following steps:

[0201] 1. Preparatory work before focusing, including but not limited to setting up the camera, positioning the target, and connecting to the camera. 2. Initial adjustments to the camera image until the target is basically visible. This includes, but is not limited to, parameters such as brightness, exposure, focus, and white balance. This can be done automatically or manually. 3. Does the target focus meet the requirements for high-precision configuration? If yes, proceed to step 12 to complete the camera focusing process; if not, proceed to step 4 to enter the magnification adjustment module, i.e., trigger the magnification adjustment process. Users can decide to enter the automatic or manual process according to their needs.

[0202] In the automated workflow, the user can perform step 5: selecting the target detail area requiring high-precision adjustment, i.e., drawing the region of interest. Then, step 6: performing optical zoom, selecting the number of pixels in the magnified area, and automatically zooming the selected area to the chosen pixel count. Next, step 7: checking if the required details are visible after zooming. If yes, proceed to step 11: manually adjusting focus parameters to modify the focus effect on image details until the desired result is achieved. If not, return to step 5 to redefine the region of interest. After step 11 is completed, proceed to step 12: completing the camera focusing process.

[0203] In the manual process, you can proceed to step 8. Use the zoom parameter controls to manually adjust the image magnification for lossless zoom, then proceed to step 9. Use the move parameter controls to manually adjust the image field of view movement so that the desired detail is centered in the field of view. Then proceed to step 10. Check if the desired detail is visible after zooming. If yes, proceed to step 11. If not, return to step 8 to manually adjust the image magnification again until the desired detail is visible, completing the camera focusing process.

[0204] The above methods have low barriers to entry and high practicality: the automatic process enables "one-click" high-precision configuration, reducing the skill requirements for operators; the manual mode retains flexible adjustment space, balancing efficiency and flexibility, and can be widely applied to various industrial intelligent manufacturing scenarios.

[0205] Corresponding to the above-described camera focusing method, this application also provides a camera focusing device. The following is a description of the camera focusing device provided in this application.

[0206] See Figure 13A camera focusing device includes: a position of interest (POI) determination module 1310, used to determine the POI in an image captured by a camera lens displayed on an interface; an optical zoom module 1320, used to control the camera lens to perform optical zoom so that the camera lens captures a clearly focused target image corresponding to the POI; and an image display module 1330, used to acquire and display the target image. In this embodiment, for a local position of interest (POI) in an image, the electronic device can control the camera lens to perform optical zoom. Since optical zoom can losslessly magnify the captured image, a clearly focused target image corresponding to the POI can be obtained, achieving precise focusing on local features and meeting the requirements for local feature detection.

[0207] In one possible implementation, the location of interest determination module includes:

[0208] The location of interest determination unit is used to perform at least one of the following processes:

[0209] Identify the region of interest drawn by the user in the image captured by the camera lens displayed on the interface, and use it as the location of interest;

[0210] A preset reference area is displayed in the image captured by the camera lens. The reference area is adjusted according to the user's adjustment operation, and the adjusted reference area is determined as the location of interest.

[0211] The image center of the image captured by the displayed camera lens is identified as the location of interest.

[0212] In one possible implementation, the interface displays a region of interest selection control;

[0213] The unit for determining the location of interest includes:

[0214] The first region of interest drawing subunit is configured to respond to a trigger operation of the region of interest selection control, and, upon detecting a target selection operation, display the region of interest box following the target selection operation, wherein the target selection operation is a selection operation within the range of the image captured by the displayed camera lens;

[0215] The region of interest determination subunit is used to determine the region selected by the current region of interest box as the region of interest when the target selection operation is detected to have stopped.

[0216] In one possible implementation, the location of interest is a region of interest; the location of interest determination unit further includes:

[0217] The second region of interest drawing subunit is used to obtain the sub-region of interest drawn by the user in the region of interest after the target image is displayed;

[0218] The region of interest update subunit is used to update the location of interest to the sub-region of interest and trigger the corresponding optical zoom module.

[0219] In one possible implementation, the device further includes:

[0220] The pixel quantity determination module is used to, after determining the position of interest in the image captured by the camera lens displayed in the determination interface, in response to a selection operation for the pixel quantity options in the interface, determine the pixel quantity represented by the pixel quantity option indicated by the selection operation as the target pixel quantity; or, determine the preset default pixel quantity as the target pixel quantity.

[0221] The image display module includes:

[0222] An image display unit is used to display the target image according to the target pixel count.

[0223] In one possible implementation, the interface displays a zoom control and a focus control;

[0224] The optical zoom module includes:

[0225] An optical zoom unit is configured to control the camera lens to perform optical zoom based on the position of interest in response to a trigger operation of the zoom control.

[0226] A zoom image display unit is used to acquire and display a zoomed image captured by the camera lens after optical zoom.

[0227] An optical focusing unit is configured to, in response to an adjustment operation on the focusing control, control the camera lens to perform optical focusing according to the focusing parameters indicated by the adjustment operation, in order to capture a target image corresponding to the position of interest, when it is determined that the zoomed image meets the zoom requirements.

[0228] In one possible implementation, the optical zoom unit includes:

[0229] An optical zoom subunit, configured to, in response to a triggering operation of a zoom control corresponding to the region of interest when the location of interest is a region of interest, determine magnification parameters based on the size and position of the region of interest, and control the camera lens to perform optical zoom according to the magnification parameters; or,

[0230] When the location of interest is the image center of the displayed image, in response to a zoom adjustment operation on the zoom parameter control in the interface, the camera lens is configured to perform optical zoom with the image center as the zoom center and according to the zoom factor.

[0231] In one possible implementation, the scaling parameter control includes a scaling parameter slider, a scaling parameter base value display box, and a scaling parameter step button; the optical zoom subunit includes:

[0232] A magnification determination subunit is used to, in response to a sliding operation on the scaling parameter slider, determine the magnification corresponding to the current position based on the current position of the scaling parameter slider and a preset correspondence between slider positions and magnification factors; or,

[0233] In response to a trigger operation on the zoom parameter step button, the zoom factor is determined based on the current value displayed in the zoom parameter base value display box and the step value corresponding to the zoom parameter step button, and the determined zoom factor is displayed in the zoom parameter base value display box.

[0234] In one possible implementation, the scaling parameter step button includes a primary step button and a secondary step button. The primary step button is a preset unit step button, and the secondary step button includes a step unit selection indicator. The optical zoom subunit further includes:

[0235] A drop-down menu display sub-unit is used to display a step unit selection drop-down menu in response to a trigger operation for the step unit selection identifier, wherein the step unit selection drop-down menu includes multiple step units;

[0236] A step unit determination subunit is configured to, in response to a selection operation for the step unit, display the step unit indicated by the selection operation on the secondary step button and close the step unit selection drop-down menu.

[0237] In one possible implementation, the interface displays controls for adjusting horizontal and vertical positions; the device further includes:

[0238] The position adjustment parameter determination module is used to determine the position adjustment parameters indicated by the triggering operation in response to the triggering operation of the target adjustment control after the zoomed image is displayed, wherein the target adjustment control is the horizontal position adjustment control and / or the vertical position adjustment control;

[0239] The image center adjustment module is used to adjust the image center of the zoomed image according to the adjustment direction indicated by the target adjustment control and the position adjustment parameters.

[0240] In one possible implementation, the device further includes:

[0241] A field-of-view restoration module is configured to, after the step of displaying the zoomed image, in response to a trigger operation on a field-of-view reset control in the interface, display an image before optical zoom; and / or,

[0242] The image reduction module is used to respond to the reduction adjustment operation of the zoom parameter control in the interface, determine the reduction factor, and control the camera lens to perform optical zoom with the image center as the reduction center according to the reduction factor to capture the reduced image; acquire the reduced image, and display the reduced image.

[0243] In one possible implementation, the device further includes:

[0244] The lens parameter adjustment module is used to adjust the lens parameters of the camera lens in response to a trigger operation of the tuning control displayed in the interface before determining the position of interest in the image captured by the camera lens in the interface, or to adjust the lens parameters of the camera lens according to the lens parameter value indicated by the adjustment operation in response to an adjustment operation issued to the lens parameter adjustment control displayed in the interface.

[0245] The image display module is also used to acquire images captured by the camera lens after adjusting the lens parameters, and to display the images in the interface.

[0246] This application also provides an electronic device, such as... Figure 14 As shown, it includes:

[0247] Memory 1410 is used to store computer programs;

[0248] When the processor 1420 executes the program stored in the memory 1410, it implements the camera focusing method steps described in any of the above embodiments.

[0249] In this embodiment, for the local location of interest (ROI) in the image that the user is interested in, the electronic device can control the camera lens to perform optical zoom. Since optical zoom can magnify the captured image without loss, it can capture a target image corresponding to the ROI with clear focus, thereby achieving precise focusing on local features and meeting the detection requirements of local features.

[0250] Furthermore, the aforementioned electronic devices may also include a communication bus and / or a communication interface, with the processor, communication interface, and memory communicating with each other via the communication bus.

[0251] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0252] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0253] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0254] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0255] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the camera focusing method steps described in any of the above embodiments.

[0256] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the camera focusing method described in any of the above embodiments.

[0257] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.

[0258] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0259] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0260] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A camera focusing method, characterized in that, The method includes: Identify the location of interest in the image captured by the camera lens displayed on the interface; Control the camera lens to perform optical zoom so that the camera lens captures a target image corresponding to the position of interest that is clearly focused; Acquire the target image and display the target image.

2. The method according to claim 1, characterized in that, The step of determining the location of interest in the image captured by the camera lens displayed on the interface includes at least one of the following: Identify the region of interest drawn by the user in the image captured by the camera lens displayed on the interface, and use it as the location of interest; A preset reference area is displayed in the image captured by the camera lens. The reference area is adjusted according to the user's adjustment operation, and the adjusted reference area is determined as the location of interest. The image center of the image captured by the displayed camera lens is identified as the location of interest.

3. The method according to claim 2, characterized in that, The interface displays a selection control for areas of interest. The step of determining the region of interest drawn by the user in the displayed image includes: In response to a trigger operation on the region of interest selection control, if a target selection operation is detected, the region of interest box is displayed following the target selection operation, wherein the target selection operation is a selection operation within the range of the image captured by the displayed camera lens; If the target selection operation is detected to have stopped, the area currently selected by the region of interest box is determined as the region of interest.

4. The method according to claim 2, characterized in that, The location of interest is a region of interest; after the step of displaying the target image, the method further includes: Obtain the sub-region of interest drawn by the user within the region of interest; Update the location of interest to the sub-region of interest, and return to the step of controlling the camera lens to perform optical zoom.

5. The method according to claim 1, characterized in that, After the step of determining the location of interest in the image captured by the camera lens displayed in the interface, the method further includes: In response to a selection operation for a pixel quantity option in the interface, the pixel quantity represented by the pixel quantity option indicated by the selection operation is determined as the target pixel quantity; or, the preset default pixel quantity is determined as the target pixel quantity. The step of displaying the target image includes: The target image is displayed according to the target pixel count.

6. The method according to any one of claims 1-5, characterized in that, The interface displays zoom and focus controls; The step of controlling the camera lens to perform optical zoom includes: In response to a trigger operation on the zoom control, the camera lens is controlled to perform optical zoom based on the position of interest; Acquire and display the magnified image captured by the camera lens after optical zoom. If the zoomed image meets the zoom requirements, in response to the adjustment operation of the focus control, the camera lens is controlled to perform optical focus according to the focus parameters indicated by the adjustment operation, so as to capture the target image corresponding to the position of interest.

7. The method according to claim 6, characterized in that, The step of controlling the camera lens to perform optical zoom based on the position of interest in response to a trigger operation on the zoom control includes: When the location of interest is a region of interest, in response to the triggering operation of the zoom control corresponding to the region of interest, magnification parameters are determined based on the size and position of the region of interest, and the camera lens is controlled to perform optical zoom according to the magnification parameters; or, When the location of interest is the image center of the displayed image, in response to the zoom adjustment operation of the zoom parameter control in the interface, the magnification factor is determined, and the camera lens is controlled to perform optical zoom with the image center as the magnification center according to the magnification factor.

8. The method according to claim 7, characterized in that, The scaling parameter control includes a scaling parameter slider, a scaling parameter base value display box, and a scaling parameter step button; the step of determining the magnification factor in response to a zoom adjustment operation on the scaling parameter control in the interface includes: In response to a sliding operation on the scaling parameter slider, based on the current position of the scaling parameter slider and a preset correspondence between slider position and magnification, the magnification corresponding to the current position is determined; or, In response to the trigger operation of the zoom parameter step button, the magnification factor is determined based on the current value displayed in the zoom parameter base value display box and the step value corresponding to the zoom parameter step button, and the determined magnification factor is displayed in the zoom parameter base value display box.

9. The method according to claim 8, characterized in that, The scaling parameter step button includes a primary step button and a secondary step button. The primary step button is a preset unit step button, and the secondary step button includes a step unit selection indicator. The method further includes: In response to a trigger operation for the step unit selection identifier, a step unit selection drop-down menu is displayed, wherein the step unit selection drop-down menu includes multiple step units; In response to a selection operation for the step unit, the step unit indicated by the selection operation is displayed on the secondary step button, and the step unit selection drop-down menu is closed.

10. The method according to claim 6, characterized in that, The interface displays controls for adjusting the horizontal and vertical positions; after the step of displaying the zoomed image, the method further includes: In response to a trigger operation on a target adjustment control, the position adjustment parameters indicated by the trigger operation are determined, wherein the target adjustment control is the horizontal position adjustment control and / or the vertical position adjustment control; Adjust the image center of the zoomed image according to the adjustment direction indicated by the target adjustment control and the position adjustment parameters.

11. The method according to claim 6, characterized in that, After the step of displaying the zoomed image, the method further includes: In response to a trigger action on the field-of-view reset control in the interface, display the image before optical zoom; and / or, In response to a zoom-out adjustment operation on the zoom parameter control in the interface, a zoom factor is determined, and the camera lens is controlled to perform optical zoom with the image center as the zoom center, according to the zoom factor, to capture a zoomed-out image; the zoomed-out image is acquired and displayed.

12. The method according to any one of claims 1-5, characterized in that, Prior to the step of determining the location of interest in the image captured by the camera lens displayed in the interface, the method further includes: In response to a triggering operation of the tuning controls displayed on the interface, the lens parameters of the camera lens are adjusted; or, in response to an adjustment operation issued by the lens parameter adjustment controls displayed on the interface, the lens parameters of the camera lens are adjusted according to the lens parameter value indicated by the adjustment operation. The system acquires images captured by the camera lens after adjusting the lens parameters and displays these images on the interface.

13. A camera focusing device, characterized in that, The device includes: The location of interest determination module is used to determine the location of interest in the image captured by the camera lens displayed on the interface; An optical zoom module is used to control the camera lens to perform optical zoom so that the camera lens can capture a clear image of the target corresponding to the position of interest. An image display module is used to acquire the target image and display the target image.

14. The apparatus according to claim 13, characterized in that, The location of interest determination module includes: The location of interest determination unit is used to perform at least one of the following processes: Identify the region of interest drawn by the user in the image captured by the camera lens displayed on the interface, and use it as the location of interest; A preset reference area is displayed in the image captured by the camera lens. The reference area is adjusted according to the user's adjustment operation, and the adjusted reference area is determined as the location of interest. The image center of the image captured by the displayed camera lens is determined as the location of interest; And / or, The interface displays a selection control for areas of interest. The unit for determining the location of interest includes: The first region of interest drawing subunit is configured to respond to a trigger operation of the region of interest selection control, and, upon detecting a target selection operation, display the region of interest box following the target selection operation, wherein the target selection operation is a selection operation within the range of the image captured by the displayed camera lens; The region of interest determination subunit is used to determine the region selected by the current region of interest box as the region of interest when the target selection operation is detected to have stopped. And / or, The location of interest is a region of interest; the location of interest determination unit further includes: The second region of interest drawing subunit is used to obtain the sub-region of interest drawn by the user in the region of interest after the target image is displayed; The region of interest update subunit is used to update the location of interest to the sub-region of interest and trigger the corresponding optical zoom module; And / or, The device further includes: The pixel quantity determination module is used to, after determining the position of interest in the image captured by the camera lens displayed in the determination interface, in response to a selection operation for the pixel quantity options in the interface, determine the pixel quantity represented by the pixel quantity option indicated by the selection operation as the target pixel quantity; or, determine the preset default pixel quantity as the target pixel quantity. The image display module includes: An image display unit is used to display the target image according to the target pixel count; And / or, The interface displays zoom and focus controls; The optical zoom module includes: An optical zoom unit is configured to control the camera lens to perform optical zoom based on the position of interest in response to a trigger operation of the zoom control. A zoom image display unit is used to acquire and display a zoomed image captured by the camera lens after optical zoom. An optical focusing unit is configured to, in response to an adjustment operation on the focusing control, control the camera lens to perform optical focusing according to the focusing parameters indicated by the adjustment operation, so as to capture a target image corresponding to the position of interest when it is determined that the zoomed image meets the zoom requirements; And / or, The optical zoom unit includes: An optical zoom subunit, configured to, in response to a triggering operation of a zoom control corresponding to the region of interest when the location of interest is a region of interest, determine magnification parameters based on the size and position of the region of interest, and control the camera lens to perform optical zoom according to the magnification parameters; or, When the location of interest is the image center of the displayed image, in response to a zoom adjustment operation on the zoom parameter control in the interface, the camera lens is configured to perform optical zoom with the image center as the zoom center and according to the zoom factor. And / or, The scaling parameter control includes a scaling parameter slider, a scaling parameter base value display box, and a scaling parameter step button; the optical zoom subunit includes: A magnification determination subunit is used to, in response to a sliding operation on the scaling parameter slider, determine the magnification corresponding to the current position based on the current position of the scaling parameter slider and a preset correspondence between slider positions and magnification factors; or, In response to a trigger operation on the zoom parameter step button, the zoom factor is determined based on the current value displayed in the zoom parameter base value display box and the step value corresponding to the zoom parameter step button, and the determined zoom factor is displayed in the zoom parameter base value display box. And / or, The scaling parameter step button includes a primary step button and a secondary step button. The primary step button is a preset unit step button, and the secondary step button includes a step unit selection indicator. The optical zoom subunit also includes: A drop-down menu display sub-unit is used to display a step unit selection drop-down menu in response to a trigger operation for the step unit selection identifier, wherein the step unit selection drop-down menu includes multiple step units; A step unit determination subunit is configured to, in response to a selection operation for the step unit, display the step unit indicated by the selection operation on the secondary step button and close the step unit selection drop-down menu; And / or, The interface displays controls for adjusting horizontal and vertical positions; the device also includes: The position adjustment parameter determination module is used to determine the position adjustment parameters indicated by the triggering operation in response to the triggering operation of the target adjustment control after the zoomed image is displayed, wherein the target adjustment control is the horizontal position adjustment control and / or the vertical position adjustment control; The image center adjustment module is used to adjust the image center of the zoomed image according to the adjustment direction indicated by the target adjustment control and the position adjustment parameters; And / or, The device further includes: A field-of-view restoration module is configured to, after the step of displaying the zoomed image, in response to a trigger operation on a field-of-view reset control in the interface, display an image before optical zoom; and / or, The image reduction module is used to respond to the reduction adjustment operation of the zoom parameter control in the interface, determine the reduction factor, and control the camera lens to perform optical zoom with the image center as the reduction center according to the reduction factor to capture the reduced image; acquire the reduced image, and display the reduced image; And / or, The device further includes: The lens parameter adjustment module is used to adjust the lens parameters of the camera lens in response to a trigger operation of the tuning control displayed in the interface before determining the position of interest in the image captured by the camera lens in the interface, or to adjust the lens parameters of the camera lens according to the lens parameter value indicated by the adjustment operation in response to an adjustment operation issued to the lens parameter adjustment control displayed in the interface. The image display module is also used to acquire images captured by the camera lens after adjusting the lens parameters, and to display the images in the interface.

15. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-12.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-12.