Focusing method, device and equipment
By acquiring and displaying the changes in the sharpness of frame images in the camera video stream, the problem of debugging personnel having difficulty accurately evaluating sharpness is solved, achieving high efficiency and accuracy in focus debugging and adapting to flexible debugging in traffic monitoring scenarios.
Patent Information
- Application Number
- CN202410726494.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2025-12-05
AI Technical Summary
In traffic monitoring scenarios, it is difficult for debugging personnel to accurately evaluate the clarity of the camera's capture area, making it difficult to adjust the focusing lens to the optimal position and resulting in low debugging efficiency.
By acquiring the image sharpness values of frames in the video stream captured by the camera and displaying the changes in sharpness on the interface, the system assists in focus adjustment, ensures that the sharpness is determined when the monitored content remains unchanged in a stable environment, prevents misjudgments caused by traffic light state transitions, and records the sharpness changes in each state.
It improves the efficiency and accuracy of focus adjustment, ensures the accuracy of sharpness evaluation, prevents misjudgment, and allows for flexible adjustment in different scenarios.
Smart Images

Figure CN121078321A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image acquisition technology, and in particular to a focusing method, apparatus and device. Background Technology
[0002] In some scenarios, it's necessary to focus the camera's capture area. For example, in traffic monitoring. Cameras used for capturing traffic violations in traffic monitoring are typically equipped with manual focus lenses. During camera installation, technicians need to observe the image clarity on the camera screen to confirm whether the capture area is in focus. Due to objective factors such as image processing, encoding, decoding, and screen quality, as well as subjective factors such as the technician's accuracy in evaluating clarity, it's difficult for technicians to accurately assess the clarity of the capture area. This makes it difficult to adjust the focus ring of the focusing lens to the optimal position, resulting in poor image clarity and low debugging efficiency. Summary of the Invention
[0003] This application provides a focusing method, apparatus, and device to solve the problems provided by related technologies. The technical solution is as follows:
[0004] In a first aspect, a focusing method is provided, the method comprising: acquiring a first video stream of a first region, the first video stream including multiple frame images, the multiple frame images being acquired during focusing of the first region; determining a sharpness value for each frame image in the first video stream; displaying a first interface, the first interface displaying sharpness changes, the sharpness changes being used to assist focusing, the sharpness changes being determined based on the sharpness value of each frame image in the first video stream.
[0005] In this application, during the process of adjusting the camera to focus on the first area, the first video stream of the first area is acquired, and the sharpness of each frame image in the first video stream is determined. By displaying the sharpness changes based on the sharpness of the frame images on the interface, the changes in sharpness can be viewed intuitively during the focus adjustment process, which can effectively assist in focus adjustment and improve adjustment efficiency.
[0006] In one possible implementation, after acquiring the first video stream of the first region, the method further includes: monitoring whether the content of the first region has changed based on the image features of each frame image in the first video stream; determining the sharpness value of each frame image in the first video stream includes: determining the sharpness value of each frame image in the first video stream when it is detected that the content of the first region has not changed. In this application, by monitoring whether the content of the first region has changed, the focus sharpness is determined only when the content of the first region has not changed, ensuring that the sharpness value is determined in a stable environment, ensuring the accuracy of the sharpness, and providing accurate data reference.
[0007] In one possible implementation, the first region includes a traffic light region. Determining the sharpness value of each frame in the first video stream when the content of the first region has not changed includes: calculating the sharpness value of each frame in the video stream of the traffic light region in the first state when the traffic light region is detected to be in a first state. The first state characterizes the working state of the traffic lights in the traffic light region. In this application, in a traffic light scenario, by calculating the focus sharpness in the corresponding state when the traffic light region is in a first state, the sharpness changes in each state can be obtained, ensuring the accuracy of the sharpness and providing accurate data reference.
[0008] In one possible implementation, the method further includes: upon detecting a change in the content of the first region, stopping the determination of the sharpness value of each frame image in the first video stream, and stopping the display of the sharpness change on the first interface. In this application, by stopping the determination of the focus sharpness of the first region upon detecting a change in the content of the first region, misjudgment of focus sharpness caused by changes in the region's content can be effectively prevented.
[0009] In one possible implementation, the first region includes a traffic light region. The step of stopping the determination of the sharpness value of each frame in the first video stream when a change in the content of the first region is detected includes: stopping the calculation of the sharpness value of each frame in the video stream of the traffic light region in the first state when a change in the traffic light region is detected from a first state to a second state, and calculating the sharpness value of each frame in the video stream of the traffic light region in the second state. The first interface displays the sharpness change corresponding to the video stream in the second state. The second state is used to characterize the working state of the traffic lights in the traffic light region, and the second state is different from the first state.
[0010] In this application, in a traffic light scenario, the focus sharpness of the traffic light area is monitored. Upon detecting a transition from a first state to a second state, the calculation of focus sharpness in the traffic light area is stopped in the first state, and the focus sharpness in the second state is calculated instead. This effectively prevents misjudgments of focus sharpness caused by traffic light transitions.
[0011] In one possible implementation, the method further includes: upon detecting that the traffic light area has switched back to the first state, calculating the sharpness value of each frame in the video stream of the traffic light area in the first state; recording the sharpness value of each frame in the video stream of the traffic light area in the first state according to the time sequence of each conversion cycle; and displaying the sharpness change of the video stream corresponding to the first state on the first interface. In this application, in the traffic light scenario, since the states of each traffic light are relatively short, when switching back to the first state, continuing to calculate the sharpness of the traffic light area in the first state and recording the sharpness of the first state in each conversion cycle can obtain the complete sharpness change in the first state. This can effectively record the sharpness change in each state and effectively prevent misjudgment of sharpness caused by interference between states.
[0012] In one possible implementation, acquiring the first video stream of the first region includes: acquiring a second video stream of a second region, the second region including the first region; displaying a second interface, the second interface displaying the second video stream and a first control for determining the first region, the second video stream including the first video stream; and determining the first region and the first video stream of the first region in response to an operation on the first control. In this application, by displaying the video stream of the second region on the second interface and determining the first region by operating the second interface, different debugging regions can be specified for different scenarios, offering high flexibility and strong applicability.
[0013] In one possible implementation, after determining the sharpness value of each frame image in the first video stream, the method further includes: determining a relative sharpness value of each frame image in the first video stream based on the sharpness value of each frame image in the first video stream and the maximum sharpness value of the frame images in the first video stream, wherein the relative sharpness value is used to assist in determining the rotation direction of the focus ring of the camera; the relative sharpness value of each frame image is also displayed on the first interface. In this application, by determining the relative sharpness value of each frame image in the first video stream, the rotation direction of the focus ring can be determined during the focus adjustment process, thereby improving adjustment efficiency.
[0014] Secondly, a focusing device is provided, the device comprising: an acquisition module for acquiring a first video stream of a first region, the first video stream including multiple frame images, the multiple frame images being acquired during focusing of the first region; a determination module for determining the sharpness value of each frame image in the first video stream; and a display module for displaying a first interface, the first interface displaying sharpness changes, the sharpness changes being used to assist focusing, the sharpness changes being determined based on the sharpness value of each frame image in the first video stream.
[0015] In one possible implementation, the apparatus further includes: a monitoring module, configured to monitor whether the content of the first region has changed based on the image features of each frame image in the first video stream; and a determining module, configured to determine the sharpness value of each frame image in the first video stream if the content of the first region has not changed.
[0016] In one possible implementation, the first region includes a traffic light region, and the determining module is used to calculate the sharpness value of each frame image in the video stream of the traffic light region in the first state when the traffic light region is detected to be in a first state, wherein the first state is used to characterize the working state of the traffic lights in the traffic light region.
[0017] In one possible implementation, the determining module is configured to stop determining the sharpness value of each frame image in the first video stream when a change in the content of the first region is detected, and the first interface stops displaying the change in sharpness.
[0018] In one possible implementation, the first region includes a traffic light region. The determining module is configured to, upon detecting that the traffic light region has changed from a first state to a second state, stop calculating the sharpness value of each frame image in the video stream of the traffic light region in the first state, and calculate the sharpness value of each frame image in the video stream of the traffic light region in the second state. The second state is used to characterize the working state of the traffic lights in the traffic light region, and the second state is different from the first state.
[0019] In one possible implementation, the determining module is configured to, upon detecting that the traffic light area has switched back to the first state, calculate the sharpness value of each frame image in the video stream of the traffic light area in the first state; record the sharpness value of each frame image in the video stream of the traffic light area in the first state according to the time sequence of each switching cycle; and display the sharpness change of the video stream corresponding to the first state on the first interface.
[0020] In one possible implementation, the acquisition module is configured to acquire a second video stream of a second region, the second region including the first region; the display module is configured to display a second interface, the second interface displaying the second video stream and a first control for determining the first region, the second video stream including the first video stream; the determination module is configured to determine the first region and the first video stream of the first region in response to an operation on the first control.
[0021] In one possible implementation, the determining module is further configured to determine a relative sharpness value for each frame in the first video stream based on the sharpness value of each frame in the first video stream and the maximum sharpness value of the frame in the first video stream, wherein the relative sharpness value is used to assist in determining the rotation direction of the focus ring of the camera; the relative sharpness value of each frame is also displayed on the first interface.
[0022] Thirdly, an electronic device is provided, the device including a memory and a processor; the memory stores at least one instruction, the at least one instruction being loaded and executed by the processor to enable the electronic device to implement the method described in the first aspect.
[0023] Fourthly, a computer program (product) is provided, the computer program (product) comprising: computer program code, which, when executed by a computer, causes the computer to perform the methods described in the above aspects.
[0024] Fifthly, a computer-readable storage medium is provided that stores a program or instructions, wherein when the program or instructions are run on a computer, the methods described in the preceding aspects are performed.
[0025] In a sixth aspect, a chip is provided, including a processor for retrieving and executing instructions stored in a memory, causing a communication device on which the chip is mounted to perform the methods described in the preceding aspects.
[0026] In a seventh aspect, another chip is provided, comprising: an input interface, an output interface, a processor, and a memory, wherein the input interface, the output interface, the processor, and the memory are connected via an internal connection path, and the processor is used to execute code in the memory, wherein when the code is executed, the processor is used to perform the methods in the foregoing aspects.
[0027] It should be understood that the beneficial effects of the technical solutions and corresponding possible implementations of the second to seventh aspects of this application can be found in the above description of the technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description
[0028] Figure 1 This is a schematic diagram of a focusing system provided in an embodiment of this application;
[0029] Figure 2 This is a schematic diagram of another focusing system provided in an embodiment of this application;
[0030] Figure 3 A schematic flowchart of a focusing method provided in an embodiment of this application;
[0031] Figure 4 A flowchart illustrating another focusing method provided in an embodiment of this application;
[0032] Figure 5 A schematic diagram of an interface of an electronic device provided in an embodiment of this application;
[0033] Figure 6 A schematic diagram of an interface of another electronic device provided in an embodiment of this application;
[0034] Figure 7 A schematic diagram of an interface of another electronic device provided in an embodiment of this application;
[0035] Figure 8 A schematic diagram of an interface of another electronic device provided in an embodiment of this application;
[0036] Figure 9 A schematic diagram of an interface of another electronic device provided in an embodiment of this application;
[0037] Figure 10 A block diagram of a focusing device provided in an embodiment of this application;
[0038] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0039] The terminology used in the implementation section of this application is for the purpose of explaining specific embodiments of this application only, and is not intended to limit this application.
[0040] In the field of image processing technology, cameras are used to capture images. These cameras are typically equipped with manual focus lenses, and the sharpness of the image on the camera screen is adjusted by changing the focus ring on the lens. For example, in traffic monitoring scenarios, cameras can be used to capture traffic violations. During camera installation, technicians need to observe the sharpness of the image on the camera screen to confirm whether the captured area is in focus. However, due to the subjective factors in the technicians' evaluation of sharpness, and the objective factors inherent in the camera itself, such as image processing, encoding, decoding, and screen display, it is difficult for technicians to accurately assess the sharpness of the captured area. This makes it difficult to adjust the focus ring to the optimal position, resulting in poor image sharpness and low debugging efficiency.
[0041] This application provides a focusing method to solve the aforementioned technical problems. The method is applied to an electronic device and may include: acquiring a first video stream of a first region, the first video stream including multiple frame images acquired during the focusing process of the first region; determining the sharpness value (hereinafter referred to as sharpness) of each frame image in the first video stream; and displaying a first interface showing changes in sharpness, which is used to assist focusing. The changes in sharpness are determined based on the sharpness of each frame image in the first video stream. In this application embodiment, during the process of focusing the camera on the first region, the first video stream of the first region is acquired, and the sharpness of each frame image in the first video stream is determined. By displaying the changes in sharpness based on the sharpness of the frame images on the interface, the changes in sharpness can be visually observed during focus adjustment, effectively assisting focus adjustment and improving adjustment efficiency.
[0042] The aforementioned electronic device is an electronic device with image display capabilities. For example, the electronic device may be a mobile phone, tablet computer, laptop, notebook computer, ultra-mobile personal computer (UMPC), handheld computer, netbook, and personal digital assistant (PDA), etc.
[0043] Figure 1 This is a schematic diagram of a focusing system provided in an embodiment of this application. Figure 1As shown, the system may include the aforementioned electronic device and camera. The electronic device establishes a communication connection with the camera. This communication connection may include a wired connection or a wireless connection, which is not specifically limited in this embodiment. For example, the camera may include a focusing lens with a focusing ring and an image sensor. The sharpness of the image on the camera's screen is adjusted by adjusting the position of the focusing ring. During the adjustment of the focusing ring's position, the camera's image sensor acquires multiple frames of images of a first region, forming a first video stream. The camera sends the first video stream to the electronic device. The electronic device receives the first video stream sent by the camera. The electronic device determines the sharpness of each frame in the first video stream, and the sharpness of multiple frames forms the sharpness variation of the first region. The electronic device displays the sharpness variation of the first region.
[0044] In one possible implementation of this application embodiment, supplementary lighting processing can be performed when the camera captures images. For example... Figure 2 The diagram shown is a structural schematic of another focusing system provided in an embodiment of this application. Figure 2 The system shown is compared to Figure 1 The difference in the system shown is that, Figure 2 The system shown also includes a supplementary light. The supplementary light is electrically connected to an electronic device. The electronic device can determine the light intensity of the environment in which the camera is located based on frame images sent by the camera. If the electronic device determines that the light intensity of the environment in which the camera is located is below a first threshold, the electronic device controls the supplementary light to perform supplementary lighting operations. For example, as... Figure 2 As shown, the electronic device may include a field-programmable gate array (FPGA) and a system-on-chip (SOC). The FPGA forwards frame images captured by the camera to the SOC. The SOC receives the frame images forwarded by the FPGA and determines the light intensity of the environment in which the camera is located based on the frame images. If the SOC determines that the light intensity of the environment in which the camera is located is below a first threshold, it sends a supplementary lighting command to the FPGA. The FPGA receives the supplementary lighting command sent by the SOC and controls the supplementary lighting lamp to perform supplementary lighting operations according to the supplementary lighting command.
[0045] In one possible implementation, exposure processing can also be performed when the camera captures the image to obtain a high-quality image. Therefore, as... Figure 2 As shown, when the electronic device determines that the light intensity of the environment in which the camera is located is lower than a first threshold, the electronic device controls the camera to perform a supplementary lighting operation. For example, as... Figure 2As shown, the SOC sends an exposure control command to the FPGA when it determines that the light intensity of the environment where the camera is located is below a first threshold. The FPGA receives the exposure control command sent by the SOC and controls the camera lens and image sensor to perform exposure operations according to the exposure control command. In some embodiments, the above-described supplementary lighting processing and exposure processing can be combined, and no specific limitation is made in this application embodiment.
[0046] The following is a detailed description of a focusing method provided by an embodiment of this application. Figure 3 This is a flowchart illustrating a focusing method provided in an embodiment of this application. The subject executing this method may be an electronic device, and the method may include: S301-S303.
[0047] S301. The electronic device acquires a first video stream of a first region, the first video stream including multiple frame images, the multiple frame images being acquired during the focusing process of the first region.
[0048] The first region is the camera's capture area, and the first video stream in the first region is generated from multiple frame images captured by the camera during the focusing process. The first video stream can be generated by the camera itself; for example, the camera captures multiple frame images during focusing and generates the first video stream from these multiple frame images. Alternatively, the first video stream can also be generated by an electronic device. For example, the camera captures multiple frame images during focusing and sends these multiple frame images to an electronic device, which receives the multiple frame images and generates the first video stream from them. Therefore, the generation of the first video stream is not specifically limited in this embodiment.
[0049] In one possible implementation, S301 can be implemented as follows: in response to a focus event from the camera, the electronic device acquires a first video stream of a first region. A focus event can be understood as triggering the camera to perform a focusing operation. For example, a focus event may include an operation on the focus ring of the focusing lens on the camera, such as a rotation operation. No specific limitations are made in the embodiments of this application.
[0050] S302, The electronic device determines the sharpness of each frame image in the first video stream.
[0051] The sharpness of a frame image can be determined using existing methods, and no specific limitations are imposed in this embodiment.
[0052] S303. The electronic device displays a first interface, which shows the changes in sharpness. The changes in sharpness are used to assist focusing. The changes in sharpness are determined based on the sharpness of each frame in the first video stream.
[0053] In one possible implementation, S303 can be implemented as follows: based on the sharpness of each frame image in the first video stream, draw a sharpness curve composed of the sharpness of the first region at each moment, the curve being used to characterize the sharpness change of the first region; display the sharpness curve of the first region on the first interface, i.e., the sharpness change corresponding to the focus event.
[0054] In this embodiment of the application, during the process of operating the camera to focus on the first area, the first video stream of the first area is acquired, and the sharpness of each frame image in the first video stream is determined. The sharpness change formed by the sharpness of each frame image is displayed on the interface, so that the sharpness change can be viewed intuitively during the focus adjustment process, which can effectively assist the focus adjustment and improve the adjustment efficiency.
[0055] Figure 4 This is a flowchart illustrating another focusing method provided in an embodiment of this application. The subject executing this method may be an electronic device, and the method may include: S401-S405 (some of which are optional).
[0056] S401. The electronic device acquires a first video stream of a first region, the first video stream including multiple frame images, the multiple frame images being acquired during the focusing process of the first region.
[0057] The implementation of S401 is described in the relevant description in S301 above, and will not be repeated here.
[0058] In some examples, the first region can be understood as the camera's capture area; or, the first region can also be understood as a designated area within the camera's capture area, such as the target capture area or the traffic light area. Therefore, the designated area can be determined in the following ways:
[0059] In implementation method one, S401 can be implemented as follows: The electronic device acquires a second video stream of a second region, the second video stream including the first video stream, and the second region encompassing the first region. The electronic device identifies a marker on a frame image in the second video stream, for example, a stop line or traffic light. The electronic device determines the region where the marker is located as the first region. The electronic device determines the video stream of the region where the marker is located as the first video stream.
[0060] In this embodiment, the region where the calibrator is located is determined by calibrating the calibrator in the frame image, thereby determining the region to be focused and achieving the purpose of automatically calibrating the region to be focused.
[0061] Implementation Method Two, S401 can be implemented as follows: S4011, the electronic device acquires a second video stream of a second region, the second video stream including the first video stream, and the second region encompassing the first region. S4012, the electronic device displays a second interface, which displays the second video stream and a first control used to determine the first region. The first control can be an input box or a trigger control. Example 1, taking an input box as the first control, the electronic device displays... Figure 5 The interface 501 shown (i.e., the second interface) displays an input box 5011 for inputting the coordinate information of the area to be focused and a control 5012 for confirmation. The operator can input the coordinate information of the area to be focused in the input box 5011, such as "A(u1, v1), B(u2, v2), C(u3, v3), and D(u4, v4)". Then, the operator can click the control 5012. At this time, the electronic device receives the above operation. Example 2, taking the first control as a trigger control as an example, the electronic device displays... Figure 6 The interface 601 shown (i.e., the second interface) displays a control 6011 for selecting the area to be focused and a control 6012 for determining the focus area. The operator can click control 6011, at which point the electronic device configures editable properties for interface 601. The operator can select an area on interface 601 as the area to be focused, or the operator can click at least three points on interface 601 as vertices of the area to be focused to draw the area. Afterwards, the operator can click control 6012. S4013: In response to the operation on the first control, the electronic device determines the first area and the first video stream of the first area. Continuing with the above example, the electronic device receives the operator's operation and, in response, determines the area to be focused as the first area and uses the video stream of the area to be focused as the first video stream. This facilitates subsequent processing of the first video stream; see the relevant description below for details.
[0062] In this embodiment, the area to be focused, i.e., the first area, is determined from the second area by operating the display interface. This allows any area in the second area to be selected as the first area, adapting to various application scenarios and improving adaptability. Furthermore, the first area can be manually selected on the display interface, offering high flexibility and facilitating adjustments for different areas, thus improving adjustment accuracy.
[0063] The content of the aforementioned first region is prone to change. For example, when operating the focus ring of the focusing lens on the camera, the image features of the frames in the video stream acquired by the electronic device change. Consequently, the sharpness obtained from each frame in the video stream also changes. Therefore, using the changing sharpness as the focusing reference data can easily affect focusing accuracy. To shield focusing accuracy from the interference of changes in the content of the first region, it is necessary to monitor whether the content of the first region has changed after S401. Therefore, the focusing method provided in this application embodiment further includes:
[0064] S402. The electronic device monitors whether the content of the first region has changed based on the image features of each frame in the first video.
[0065] In one possible implementation, S402 can be implemented as follows: the electronic device compares the image features of each frame in the first video. If the similarity of the image features of any two adjacent frames in the first video stream is less than a second threshold, the electronic device determines that the content of the first region has changed. Conversely, if the similarity of the image features of any two adjacent frames in the first video stream is greater than or equal to the second threshold, the electronic device determines that the content of the first region has not changed.
[0066] In another possible implementation, S402 can be implemented as follows: the electronic device identifies the position of an object in each frame of the first video stream; if the position of a specified object in each frame is different, the electronic device determines that the content of the first region has changed. Conversely, if the position of the object in each frame of the first video stream has not changed, the electronic device determines that the content of the first region has not changed.
[0067] Of course, the implementation of the electronic device monitoring whether the content of the first area has changed can also include a combination of the above two implementation methods. In this application embodiment, it is not limited to the above-listed methods, and can also include other implementation methods, which will not be listed here.
[0068] In S402, the monitoring results obtained by the electronic device may include: the electronic device detects a change in the content of the first area, or the electronic device detects that the content of the first area has not changed. The implementation of S403 will differ accordingly for different monitoring results, as described below.
[0069] S403, The electronic device determines the sharpness of each frame image in the first video stream.
[0070] The sharpness of a frame image can be determined using existing methods, and no specific limitations are imposed in this embodiment.
[0071] The sharpness of each frame can include a maximum sharpness and a minimum sharpness. This means that during the focus adjustment of the first region, the sharpness of each frame in the first video stream of the first region is considered.
[0072] In one possible implementation, S403 can be implemented as follows: S4031, the electronic device determines the sharpness of each frame image in the first video stream when it detects that the content of the first region has not changed. In this embodiment, by monitoring whether the content of the first region has changed, the focus sharpness is determined only when the content of the first region has not changed, ensuring that the sharpness value is determined in a stable environment, ensuring the accuracy of the sharpness, and providing accurate data reference.
[0073] For example, the first region may include a traffic light region. S4031 can be implemented as follows: when the electronic device detects that the traffic light region is in a first state, it calculates the sharpness of each frame image in the video stream of the traffic light region in the first state. The first state characterizes the working state of the traffic lights in the traffic light region. For example, the first state can be understood as specifying the on / off state of the light, such as a red light, green light, or yellow light. Example 1: In the first transition cycle, the first state of the traffic light region is a red light state, such as... Figure 7 As shown, the electronic device displays interface 701, which shows the traffic light area captured by the camera. The traffic light displayed on interface 701 is red; the red light is on for a period of time T0-T1. In this situation, a focusing operation on the traffic light area is triggered during the T0-T1 period. In response to this operation, the electronic device calculates the sharpness of each frame in the video stream during the T0-T1 period, obtaining... Figure 7 The sharpness change curve under the red light condition. In this embodiment of the application, in a traffic light scenario, by calculating the focus sharpness under the corresponding state when the traffic light area is in a first state, the sharpness change under each state can be obtained, ensuring the accuracy of the sharpness and providing accurate data reference.
[0074] In another possible implementation, S403 can be implemented as follows: S4032, when the electronic device detects a change in the content of the first area, it stops determining the sharpness of each frame image in the first video stream. That is, when the electronic device detects a change in the content of the first area, it stops calculating the sharpness of each frame image in the video stream of the first area. This means that the sharpness change of the frame images corresponding to the stage where the content changed will not be displayed on the interface later. Afterwards, when the content of the first area returns to its initial state, the sharpness of each frame image in the video stream of the first area will continue to be calculated. This means that the calculated sharpness change of each frame image will be displayed on the interface later. The first area may include a capture area or a traffic light area. In this embodiment, by stopping the determination of the focus sharpness of the first area when a change in the content of the first area is detected, misjudgment of focus sharpness caused by changes in the content of the area can be effectively prevented.
[0075] In one example, the first region includes a capture area. S4032 can be implemented as follows: when the electronic device detects a change in the content of the capture area, it stops calculating the sharpness of each frame in the video stream of the capture area. Then, when the content of the capture area returns to its initial state, it continues calculating the sharpness of each frame in the video stream of the capture area. For example, if the content of the capture area changes during the time period t1-t2, the electronic device stops calculating the sharpness of the frames in the video stream during this period. When the content of the capture area returns to its initial state at time t3, the electronic device continues calculating the sharpness of the frames in the video stream from time t3 onwards.
[0076] In another example, the first region includes a traffic light region. S4032 can be implemented as follows: when the traffic light region is detected to transition from a first state to a second state, stop calculating the sharpness of each frame in the video stream of the traffic light region in the first state, and calculate the sharpness of each frame in the video stream of the traffic light region in the second state. Here, the second state characterizes the working state of the traffic lights in the traffic light region, and the second state is different from the first state. Example 2, continuing the above example, the second state is a green light state. In the first transition cycle, the traffic light region transitions from a red light state to a green light state (i.e., the second state). That is, at time T1, the traffic light region transitions from a red light state to a green light state. At this time, the electronic device displays... Figure 8 The interface 801 shown displays a green traffic light. The green light is on for a period of time T1-T2. In this scenario, the electronic device stops calculating the sharpness of each frame in the video stream during the red light state and continues calculating the sharpness of each frame in the video stream during the T1-T2 period, starting from time T1, based on the historical sharpness changes during the green light state. Figure 8 The image shows the sharpness change curve under the green light state. In this embodiment of the application, in a traffic light scenario, the traffic light state transition in the traffic light area is monitored. When a transition from the first state to the second state is detected, the calculation of the focus sharpness of the traffic light area in the first state is stopped, and the focus sharpness in the second state is calculated instead. This can effectively prevent misjudgment of focus sharpness caused by traffic light transitions in the area.
[0077] In another example, the first region includes a traffic light region. S4032 can be implemented as follows: when the traffic light region is detected to switch back to the first state, calculate the sharpness of each frame in the video stream of the traffic light region in the first state. Example 3, following the above example, the traffic light region switches back to the red light state in the second conversion cycle, that is, the traffic light region switches back to the red light state at time T2. The red light state period in the second conversion cycle can be T2-T4. Figure 9 As shown, the electronic device displays interface 901, and the traffic light displayed on interface 801 is red. At this time, the red light is on. In this situation, the technician triggers a focusing operation on the traffic light area at time T2 and thereafter. In response to this operation, the electronic device continues to calculate the sharpness of each frame in the video stream at time T2, based on the image quality of the frame at time T1 under the red light condition, thus obtaining... Figure 9 The sharpness change curve under the red light state is described above. Similarly, the electronic device calculates the sharpness of the frame images of the video stream in the first state during each conversion cycle. Then, according to the time sequence of each conversion cycle, it records the sharpness of each frame image in the video stream of the traffic light area in the first state. For example, the electronic device sequentially records the sharpness of the frame images from T0 to T1, the sharpness of each frame image in the video stream at time T2 and thereafter, and so on, forming the sharpness change curve of the first region in the first state. In this embodiment, in the traffic light scenario, since the states of each traffic light are relatively short, when switching back to the first state, the sharpness of the traffic light area in the first state is calculated again, and the sharpness of the first state in each conversion cycle is recorded. This allows for the complete sharpness change in the first state, effectively recording the sharpness change in each state and effectively preventing misjudgment of sharpness caused by interference between states.
[0078] In some embodiments, to assist in determining the rotation direction of the camera's focus ring, the focusing method provided in this application embodiment may further include:
[0079] S404. The electronic device determines the relative sharpness of each frame in the first video stream based on the sharpness of each frame and the maximum sharpness of the frame in the first video stream. The relative sharpness is used to assist in determining the rotation direction of the camera's focus ring.
[0080] The maximum sharpness of a frame in the first video stream is the maximum sharpness obtained during the focusing process as the image goes from blurry to sharp and then back to blurry. This is the peak sharpness, which can be denoted as FV_max.
[0081] In this step, the relative sharpness of each frame in the first video stream can be the ratio of the sharpness of each frame to the maximum sharpness. The larger the ratio, the closer the image is to its sharpest state at that moment, that is, the closer the focus ring is to the optimal adjustment position.
[0082] For example, such as Figure 7 As shown, during the first conversion cycle, focusing is performed while the camera is in red light mode. At time Tt (which falls within the T0-T1 time period), the frame image sharpness (FV_cur) is 900, and the maximum sharpness is 1200. Therefore, the relative sharpness of this frame image is 900 / 1200 = 75%. If the technician rotates the camera's focus ring clockwise, then... Figure 9 As shown, during the second conversion cycle, the focus operation is performed again by switching to the red light state. At time T3 (which falls within the T2-T4 time period), the image sharpness (FV_cur) is 1000. Therefore, the relative sharpness of this image is 1000 / 1200 = 83.3%. This means the adjustment direction is correct. The assistant prompts the adjustment personnel to continue rotating the camera's focus ring clockwise to approach the optimal position.
[0083] In this embodiment of the application, by determining the relative sharpness value of each frame image in the first video stream, the rotation direction of the focus ring can be determined during the focus adjustment process, thereby improving the adjustment efficiency.
[0084] S405. The electronic device displays a first interface, which shows the changes in sharpness. The changes in sharpness are used to assist focusing. The changes in sharpness are determined based on the sharpness of each frame in the first video stream.
[0085] This should be understood as follows: In S403, the electronic device determines the sharpness of each frame in the first video stream. Then, in S405, the sharpness of each frame in the video stream acquired during the focusing process is displayed on the interface of the electronic device. These sharpness values can be used to plot a sharpness change curve, i.e., the sharpness change corresponding to the focusing event. Continuing with the above example, as... Figures 7-9 The sharpness variation curve shown.
[0086] In some embodiments, in S404, the electronic device determines the relative sharpness of each frame image in the first video stream. Then, in S405, the electronic device also displays the relative sharpness of each frame image on a first interface, for example... Figure 7The 75% shown Figure 9 The figure shown is 83.3%.
[0087] In this embodiment of the application, by displaying the sharpness changes of each frame image on the interface, the sharpness changes can be viewed intuitively during the focus adjustment process, which can effectively assist focus adjustment and improve adjustment efficiency.
[0088] The focusing method provided in this application can be applied to scenarios such as electronic police systems and checkpoint capture in intelligent transportation systems, and is not specifically limited to these scenarios in this application. Of course, it is not limited to the scenarios listed above, and can also be applied to other scenarios, such as monitoring scenarios in public places.
[0089] like Figure 10 As shown in the figure, this application embodiment also provides a focusing device 1000, which includes: an acquisition module 1010, used to acquire a first video stream of a first region, the first video stream including multiple frame images, the multiple frame images being acquired during the focusing process of the first region; a determination module 1020, used to determine the sharpness value of each frame image in the first video stream; and a display module 1030, used to display a first interface, the first interface displaying the sharpness change, the sharpness change being used to assist focusing, and the sharpness change being determined based on the sharpness value of each frame image in the first video stream.
[0090] In one possible implementation, the device 1000 further includes: a monitoring module 1040, configured to monitor whether the content of a first region has changed based on the image features of each frame image in the first video stream; and a determination module 1020, configured to determine the sharpness value of each frame image in the first video stream if the content of the first region has not changed.
[0091] In one possible implementation, the first region includes a traffic light region. The determining module 1020 is used to calculate the sharpness value of each frame image in the video stream of the traffic light region in the first state when the traffic light region is detected to be in the first state. The first state is used to characterize the working state of the traffic lights in the traffic light region.
[0092] In one possible implementation, the determining module 1020 is used to stop determining the sharpness value of each frame image in the first video stream when a change in the content of the first region is detected, and to stop displaying the sharpness change on the first interface.
[0093] In one possible implementation, the first region includes a traffic light region. The determining module 1020 is used to stop calculating the sharpness value of each frame image in the video stream of the traffic light region in the first state when it detects that the traffic light region has changed from a first state to a second state, and to calculate the sharpness value of each frame image in the video stream of the traffic light region in the second state. The second state is used to characterize the working state of the traffic lights in the traffic light region, and the second state is different from the first state.
[0094] In one possible implementation, the determining module 1020 is used to calculate the sharpness value of each frame image in the video stream of the traffic light area in the first state when the traffic light area is detected to switch back to the first state; record the sharpness value of each frame image in the video stream of the traffic light area in the first state according to the time sequence of each switching cycle; and display the sharpness change of the video stream in the first state on the first interface.
[0095] In one possible implementation, the acquisition module 1010 is used to acquire a second video stream of a second region, the second video stream including a first video stream, and the second region including the first region; the display module 1030 is used to display a second interface, the second interface displaying the second video stream and a first control for determining the first region; and the determination module 1020 is used to determine the first region and the first video stream of the first region in response to an operation on the first control.
[0096] In one possible implementation, the determining module 1020 is further configured to determine the relative sharpness value of each frame image in the first video stream based on the sharpness value of each frame image in the first video stream and the maximum sharpness value of the frame images in the first video stream. The relative sharpness value is used to assist in determining the rotation direction of the focus ring of the camera. The relative sharpness value of each frame image is also displayed on the first interface.
[0097] It should be understood that the above Figure 10 The provided device, in implementing its functions, is only illustrated by the division of the above-described functional modules. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, and will not be repeated here.
[0098] See Figure 11 , Figure 11 A schematic diagram of the structure of an electronic device 1100 provided in an exemplary embodiment of this application is shown. Figure 11 The electronic device 1100 shown is used to perform the above. Figure 3 The focusing method shown involves the following operations. Figure 11 As shown, the electronic device 1100 includes at least one processor 1101, a memory 1103, and at least one communication interface 1104.
[0099] Processor 1101 may be, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solutions of this application. For example, processor 1101 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A PLD may be, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in connection with the embodiments of this application. A processor may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0100] Optionally, the electronic device 1100 also includes a bus. The bus is used to transfer information between the various components of the electronic device 1100. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0101] Memory 1103 may be, for example, read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; electrically erasable programmable read-only memory (EEPROM); compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.); magnetic disk storage media or other magnetic storage devices; or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 1103 may exist independently and be connected to processor 1101 via a bus. Memory 1103 may also be integrated with processor 1101.
[0102] Communication interface 1104 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), or Wireless Local Area Network (WLAN). Communication interface 1104 may include wired and wireless communication interfaces. Specifically, communication interface 1104 may be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a WLAN interface, a cellular network communication interface, or a combination thereof. The Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. In this embodiment, communication interface 1104 can be used by electronic device 1100 to communicate with other devices.
[0103] In a specific implementation, as one example, the processor 1101 may include one or more CPUs, such as Figure 11 The CPU0 and CPU1 shown are examples of processors. Each of these processors can be a single-core processor or a multi-core processor. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0104] In a specific implementation, as one example, the electronic device 1100 may include multiple processors, such as... Figure 11 The processors 1101 and 1105 shown are illustrated. Each of these processors can be a single-core processor or a multi-core processor. Here, "processor" can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).
[0105] In a specific implementation, as one embodiment, the electronic device 1100 may further include an output device and an input device. The output device communicates with the processor 1101 and can display information in various ways. For example, the output device may be a liquid crystal display (LCD), a light-emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device communicates with the processor 1101 and can receive user input in various ways. For example, the input device may be a mouse, a keyboard, a touchscreen device, or a sensing device, etc.
[0106] In some embodiments, memory 1103 stores program code 1110 for executing the solution of this application, and processor 1101 can execute the program code 1110 stored in memory 1103. That is, electronic device 1100 can implement the focusing method provided in the method embodiment through processor 1101 and program code 1110 in memory 1103. Program code 1110 may include one or more software modules. Optionally, processor 1101 itself may also store program code or instructions for executing the solution of this application.
[0107] In a specific embodiment, the electronic device 1100 of this application embodiment may correspond to the computing device in the above-described method embodiments.
[0108] in, Figure 3 Each step of the focusing method shown is completed by the integrated logic circuitry of the processor in the electronic device 1100 or by instructions in the form of software. The steps of the method disclosed in the embodiments of this application can be directly implemented by the hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. Since this storage medium is located in memory, the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method; to avoid repetition, these will not be described in detail here.
[0109] This application also provides an electronic device, which includes a processor for loading and executing at least one instruction to enable the electronic device to implement the focusing method provided in this application. Optionally, the electronic device further includes a memory coupled to the processor for storing at least one instruction.
[0110] This application also provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to enable a computer to implement the focusing method as described above.
[0111] This application also provides a computer program (product) that, when executed by a computer, causes the processor or computer to perform the corresponding steps and / or processes in the above method embodiments.
[0112] This application also provides a chip including a processor for calling and executing instructions stored in a memory, causing a device equipped with the chip to perform any of the focusing methods described above.
[0113] This application embodiment also provides another chip, including: an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute any of the focusing methods described above.
[0114] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as 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 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) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer 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 semiconductor medium (e.g., solid-state drive).
[0115] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the setting results involved in this application were obtained with full authorization.
[0116] Those skilled in the art will recognize that the method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. To clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0117] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0118] When implemented using software, it can be implemented wholly or partially as a computer program product. This computer program product includes one or more computer program instructions. As an example, the methods of this application embodiment can be described in the context of machine-executable instructions, such as program modules that execute on a device on a real or virtual processor of the target. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functionality of program modules can be combined or divided among the described program modules. The machine-executable instructions for the program modules can execute within a local or distributed device. In a distributed device, the program modules can reside on both local and remote storage media.
[0119] Computer program code used to implement the methods of the embodiments of this application may be written in one or more programming languages. This computer program code may be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable focusing device, such that when executed by the computer or other programmable focusing device, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a computer, partially on a computer, as a standalone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server.
[0120] In the context of the embodiments of this application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, etc.
[0121] Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.
[0122] A machine-readable medium can be any tangible medium that contains or stores programs for or relating to an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. More detailed examples of machine-readable storage media include electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0123] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be found in the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0124] In the embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or modules, or they may be electrical, mechanical, or other forms of connection.
[0125] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0126] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0127] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or electronic device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0128] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items that have substantially the same function and purpose. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another. For example, without departing from the various examples described, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image. Both the first image and the second image can be images, and in some cases, they can be separate and distinct images.
[0129] It should also be understood that, in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0130] In this application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple second messages refer to two or more second messages. The terms "system" and "network" are often used interchangeably in this document.
[0131] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0132] It should also be understood that the term "and / or" as used herein refers to and covers any and all possible combinations of one or more of the associated listed items. The term "and / or" describes an association between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " in this application generally indicates that the preceding and following related objects are in an "or" relationship.
[0133] It should also be understood that the term “comprising” (also referred to as “includes”, “including”, “comprises” and / or “comprising”) as used in this specification specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0134] It should also be understood that the terms “if” and “if” can be interpreted as meaning “when” or “upon”, or “in response to determination” or “in response to detection”. Similarly, depending on the context, the phrases “if determination…” or “if detection [the stated condition or event]” can be interpreted as meaning “when determination…”, or “in response to determination…”, or “when detection [the stated condition or event]” or “in response to detection [the stated condition or event]”.
[0135] It should be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.
[0136] It should also be understood that the phrases "an embodiment," "an embodiment," and "a possible implementation" used throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment or implementation is included in at least one embodiment of this application. Therefore, the phrases "in an embodiment," "an embodiment," or "a possible implementation" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
Claims
1. A focusing method, characterized in that, The method includes: A first video stream of a first region is acquired, the first video stream comprising multiple frame images, the multiple frame images being captured during the focusing process of the first region; Determine the resolution value of each frame image in the first video stream; The first interface displays the changes in sharpness, which are used to assist focusing. The changes in sharpness are determined based on the sharpness value of each frame in the first video stream.
2. The method according to claim 1, characterized in that, After obtaining the first video stream of the first region, the method further includes: Based on the image features of each frame in the first video stream, monitor whether the content of the first region has changed; Determining the sharpness value of each frame image in the first video stream includes: If the content of the first region remains unchanged, the resolution value of each frame in the first video stream is determined.
3. The method according to claim 2, characterized in that, The first region includes a traffic light area. Determining the sharpness value of each frame in the first video stream, when the content of the first region has not changed, includes: When the traffic light area is detected to be in a first state, the resolution value of each frame image in the video stream of the traffic light area in the first state is calculated, and the first state is used to characterize the working state of the traffic lights in the traffic light area.
4. The method according to claim 2, characterized in that, The method further includes: If a change in the content of the first region is detected, the determination of the resolution value of each frame in the first video stream is stopped, and the resolution change is stopped from being displayed on the first interface.
5. The method according to claim 4, characterized in that, The first region includes a traffic light area. The step of stopping the determination of the sharpness value of each frame in the first video stream when a change in the content of the first region is detected includes: When the traffic light area is detected to change from a first state to a second state, the calculation of the sharpness value of each frame in the video stream of the traffic light area in the first state is stopped, and the sharpness value of each frame in the video stream of the traffic light area in the second state is calculated. The first interface displays the sharpness change of the video stream in the second state. The second state is used to characterize the working state of the traffic lights in the traffic light area, and the second state is different from the first state.
6. The method according to claim 5, characterized in that, The method further includes: If the traffic light area is detected to switch back to the first state, the sharpness value of each frame in the video stream of the traffic light area in the first state is calculated. Record the resolution value of each frame in the video stream of the traffic light area in the first state according to the time sequence of each conversion cycle; display the resolution change of the video stream in the first state on the first interface.
7. The method according to any one of claims 1-6, characterized in that, The acquisition of the first video stream of the first region includes: Obtain a second video stream from a second region, wherein the second region includes the first region; A second interface is displayed, which shows the second video stream and a first control for determining the first region; In response to an operation on the first control, the first region and a first video stream of the first region are determined, and the second video stream includes the first video stream.
8. The method according to any one of claims 1-7, characterized in that, After determining the sharpness value of each frame image in the first video stream, the method further includes: Based on the resolution value of each frame image in the first video stream and the maximum resolution value of the frame images in the first video stream, a relative resolution value of each frame image in the first video stream is determined. The relative resolution value is used to help determine the rotation direction of the focus ring of the camera. The relative resolution value of each frame image is also displayed on the first interface.
9. A focusing device, characterized in that, The device includes: The acquisition module is used to acquire a first video stream of a first region, the first video stream including multiple frame images, the multiple frame images being acquired during the focusing process of the first region; A determination module is used to determine the sharpness value of each frame image in the first video stream; The display module is used to display a first interface, which displays the changes in sharpness. The changes in sharpness are used to assist focusing. The changes in sharpness are determined based on the sharpness value of each frame image in the first video stream.
10. An electronic device, characterized in that, The device includes a memory and a processor; the memory stores at least one instruction, which is loaded and executed by the processor to enable the electronic device to perform the method of any one of claims 1-8.