Preset point correction method of image acquisition equipment and related device
By adjusting the image distance of the image acquisition device and comparing candidate images that meet the clarity requirements, the problem of image inaccuracy caused by preset point offset is solved, achieving efficient preset point correction and ensuring accurate image acquisition by the image acquisition device in different environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG DAHUA TECH CO LTD
- Filing Date
- 2025-12-05
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, the preset points of image acquisition devices are prone to image inaccuracies due to offset, hardware wear and tear and environmental changes, and existing correction methods are inefficient or ineffective.
By repeatedly adjusting the image distance of the image acquisition device, candidate images that meet the clarity requirements are obtained and compared with template images to obtain the actual position offset in order to correct the preset point and avoid the negative impact of changes in clarity and field of view on the comparison.
It improves the accuracy of image comparison, enhances the effect of preset point correction, and ensures the accuracy of image acquisition equipment in different environments.
Smart Images

Figure CN121908008A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a preset point correction method and related apparatus for an image acquisition device. Background Technology
[0002] Point-to-point navigation of image acquisition equipment refers to a pre-set navigation path that includes multiple preset points. During image acquisition, the equipment rotates to each preset point to capture images of the objects corresponding to those points. Point-to-point navigation of image acquisition equipment can be applied in industries such as power, water conservancy, retail, and transportation. For example, in the power industry, point-to-point navigation can be used to manage the operating status of electricity meters and monitor meter readings.
[0003] Factors such as preset point offset, wear and tear of image acquisition equipment hardware, and environmental changes may cause the preset point to be inaccurate, resulting in inaccurate images acquired after the image acquisition equipment rotates to the preset point. Therefore, it is necessary to correct the preset point.
[0004] Some related technologies require manual intervention to correct preset points, which is inefficient and slow to respond. Other related technologies correct preset points without manual intervention, but the correction effect is not good. Summary of the Invention
[0005] This application provides a preset point correction method and related apparatus for an image acquisition device, which can solve the problem of poor preset point correction effect in related technologies.
[0006] This application provides a preset point correction method for an image acquisition device, comprising: controlling the image acquisition device to rotate to a current preset point; adjusting the image distance of the image acquisition device multiple times, and acquiring candidate images of the current object corresponding to the current preset point at each adjusted image distance, and selecting the current image whose sharpness meets the preset sharpness condition from multiple candidate images; acquiring the actual positional offset of the current object between the current image and the template image corresponding to the current preset point; and correcting the current preset point based on the actual positional offset.
[0007] This application provides a correction device, including: a rotation module, an adjustment module, an acquisition module, and a correction module. The rotation module controls the image acquisition device to rotate to a current preset point; the adjustment module adjusts the image distance of the image acquisition device multiple times, and acquires candidate images of the current object corresponding to the current preset point at each adjusted image distance, and selects the current image whose sharpness meets a preset sharpness condition from multiple candidate images; the acquisition module acquires the actual positional offset of the current object between the current image and the template image corresponding to the current preset point; the correction module corrects the current preset point based on the actual positional offset.
[0008] This application provides a preset point correction system, including a correction device and several image acquisition devices, wherein the correction device is used to perform the above method.
[0009] This application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-described method.
[0010] This application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the above-described method.
[0011] This application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0012] The above scheme, in order to correct the current preset point, firstly, changes the sharpness of the candidate images acquired by the image acquisition device for the current object corresponding to the current preset point by repeatedly adjusting the image distance of the image acquisition device. Then, it selects the current image whose sharpness meets the sharpness requirement from the candidate images acquired under the multiple image distance adjustments and compares it with the template image corresponding to the current preset point. This avoids the negative impact of the current image's sharpness on image comparison, improves image comparison accuracy, and thus enhances the correction effect. Secondly, since adjusting the image distance does not change the image's field of view while altering the sharpness, the field of view of the candidate images corresponding to each adjusted image distance is the same, avoiding the negative impact of changes in the field of view on image comparison.
[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description
[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.
[0015] Figure 1This is a flowchart illustrating an embodiment of the preset point correction method for the image acquisition device provided in this application; Figure 2 This is a flowchart illustrating another embodiment of the preset point correction method for the image acquisition device provided in this application; Figure 3 This is a flowchart illustrating yet another embodiment of the preset point correction method for the image acquisition device provided in this application; Figure 4 This is a schematic diagram of the structure of an embodiment of the preset point correction system provided in this application; Figure 5 This is a flowchart illustrating the process of setting up the template image in this application; Figure 6 This is a flowchart illustrating the pre-set point correction process in this application; Figure 7 This is a schematic diagram of a scenario where preset points are corrected in a power application scenario; Figure 8 This is a schematic diagram of the structure of an embodiment of the correction device provided in this application; Figure 9 This is a schematic diagram of the structure of an embodiment of the electronic device of this application; Figure 10 This is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of this application. Detailed Implementation
[0016] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0017] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0018] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. The term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. Finally, the term "several" in this document means any integer greater than 0, such as 1, 2, 3, 4, 5, ...
[0019] Point-to-point navigation of image acquisition equipment refers to a pre-set navigation path that includes multiple preset points. During image acquisition, the equipment rotates to each preset point to capture images of the objects corresponding to those points. Point-to-point navigation of image acquisition equipment can be applied in industries such as power, water conservancy, retail, and transportation. For example, in the power industry, point-to-point navigation can be used to manage the operating status of electricity meters and monitor meter readings.
[0020] Factors such as preset point offset, wear and tear of image acquisition equipment hardware, and environmental changes may cause the preset point to be inaccurate, resulting in inaccurate images acquired after the image acquisition equipment rotates to the preset point. Therefore, it is necessary to correct the preset point.
[0021] Some related technologies require manual intervention to correct preset points, which is inefficient and slow to respond. Other related technologies correct preset points without manual intervention, but the correction effect is not good.
[0022] Through long-term research, the inventors of this application have discovered that the reason why the correction effect of related technologies is not good is that the image quality used for comparison is poor. One reason for the poor image quality is that the image sharpness does not meet the sharpness condition. The reason why the sharpness condition is not met is that the distance (object distance) from the object corresponding to different preset points to the image acquisition device may be different. Different object distances may cause defocusing, thereby causing changes in image sharpness.
[0023] Therefore, this application provides a new preset point correction method, the embodiments of which are described below: Figure 1 This is a schematic flowchart of an embodiment of the preset point correction method for the image acquisition device provided in this application. Figure 1 As shown, in this embodiment, the preset point correction method of the image acquisition device may include the following steps: S110: Control the image acquisition device to rotate to the current preset point.
[0024] In this embodiment, the execution entity is a correction device, which can be any electronic device with correction capabilities. The correction device can be an external device independent of the image acquisition device.
[0025] Image acquisition devices can be cameras, video cameras, etc. In some embodiments, the image acquisition device is a pan-tilt camera. A pan-tilt camera includes a pan-tilt module and an image acquisition module. The pan-tilt module can rotate to rotate the image acquisition module it carries.
[0026] S120: Adjust the image distance of the image acquisition device multiple times, and acquire candidate images of the current object corresponding to the current preset point at each adjusted image distance, and select the current image whose clarity meets the preset clarity condition from multiple candidate images.
[0027] Each preset point corresponds to a specific object. The image acquisition device has a maximum image distance and a minimum image distance, and the image distance is adjusted between the maximum and minimum image distances each time.
[0028] Understandably, the thin lens equation defines the relationship between the focal length, object distance, and image distance of an image acquisition device: 1 / f = 1 / u + 1 / v; where f represents the focal length, which is fixed and determined by the lens optical design of the image acquisition device. u represents the object distance, the distance from the object to the lens of the image acquisition device. v represents the image distance, the distance from the lens of the image acquisition device to the imaging plane.
[0029] With a fixed focal length and image distance, the object distance must also be fixed to ensure the thin lens equation holds true, guaranteeing focus and preventing image sharpness loss. However, the distance from the object to the lens of the image acquisition device may differ at different preset points, resulting in an unstable object distance and consequently, inability to focus (out-of-focus), thus sacrificing image sharpness. In S120, by adjusting the image distance, the thin lens equation can be made true to achieve focus, or the difference between 1 / f and (1 / u + 1 / v) can be reduced to decrease the degree of out-of-focus, thereby changing the sharpness of the image acquired by the image acquisition device without altering the field of view of the acquired image.
[0030] The sharpness of candidate images can be obtained, but is not limited to, through the Brenner gradient algorithm. The sharpness calculation formula based on Brenner, combining horizontal, vertical, or diagonal directions, is as follows: ∑[I(x+2,y) I(x,y)]^2+[I(x,y+2) I(x,y)]^2; Where I(x,y) represents the grayscale value of the pixel with horizontal coordinate x and vertical coordinate y.
[0031] In some embodiments, the sharpness condition includes the highest sharpness.
[0032] In some embodiments, the sharpness condition includes a sharpness greater than a sharpness threshold.
[0033] In some embodiments, the sharpness condition includes a minimum difference between the sharpness of the candidate image and the sharpness of the template image corresponding to the current preset point.
[0034] S130: Obtain the actual position offset of the current object between the current image and the template image corresponding to the current preset point.
[0035] Each preset point has a corresponding template image.
[0036] S140: Correct the current preset point based on the actual position offset.
[0037] The above scheme, in order to correct the current preset point, firstly, changes the sharpness of the candidate images acquired by the image acquisition device for the current object corresponding to the current preset point by repeatedly adjusting the image distance of the image acquisition device. Then, it selects the current image whose sharpness meets the sharpness requirement from the candidate images acquired under the multiple image distance adjustments and compares it with the template image corresponding to the current preset point. This avoids the negative impact of the current image's sharpness on image comparison, improves image comparison accuracy, and thus enhances the correction effect. Secondly, since adjusting the image distance does not change the image's field of view while altering the sharpness, the field of view of the candidate images corresponding to each adjusted image distance is the same, avoiding the negative impact of changes in the field of view on image comparison.
[0038] Furthermore, in some embodiments, adjusting the image distance in S120 can be done using a single wheel or multiple wheels.
[0039] Single-round adjustment refers to sequentially adjusting the image acquisition device to each desired image distance and acquiring corresponding candidate images. Once the sharpness of the candidate image corresponding to the latest adjusted image distance meets the sharpness requirement, the image distance adjustment stops, and the candidate image corresponding to the latest adjusted image distance is used as the current image. Alternatively, single-round adjustment refers to sequentially adjusting the image acquisition device to each pre-set image distance and acquiring corresponding candidate images; then selecting the current image from the candidate images corresponding to each adjusted image distance that meets the sharpness requirement.
[0040] Multi-round refers to a process where the execution steps are the same in each round. The difference between different rounds lies in the pixel range of the image distance supported by the image acquisition device, which is used as the pixel range of the image distance to be adjusted in the first round. Each round reduces the image distance range based on the previous round, thus obtaining the current image through a round-by-round optimization method. Specifically: Figure 2 This is a schematic flowchart of another embodiment of the preset point correction method for the image acquisition device provided in this application. This embodiment is a further extension of S120. Figure 2 As shown, in this embodiment, S120 may include: S121: Determine multiple image distances to be adjusted from the current image distance range.
[0041] The initial minimum and maximum boundaries of the current image distance range are the minimum and maximum image distances supported by the image acquisition device, respectively.
[0042] The image distances to be adjusted are grouped into two adjacent pairs, and the interval between the two image distances to be adjusted is the same in each group. Alternatively, the interval between the two image distances to be adjusted is different in at least some groups.
[0043] In some embodiments, S121 includes: dividing the current image distance range into multiple adjacent sub-image distance ranges; and determining an image distance to be adjusted from each sub-image distance range. For example, the current image distance range [M, N] is divided into 5 adjacent sub-image distance ranges [M, V1], (V1, V2], (V2, V3], (V3, V4], (V4, N], and the image distances to be adjusted v1, v2, v3, v4, and v5 are determined from [M, V1], (V1, V2], (V2, V3], (V3, V4], and (V4, N], respectively.
[0044] In some embodiments, S121 includes: determining a plurality of image distances to be adjusted from the current image distance range according to a preset image distance interval. For example, M and N are respectively designated as the minimum image distance to be adjusted v1 and the maximum image distance to be adjusted vj. Using a=(NM) / i as the preset image distance interval, N, a*(i-1)+N, and M are sequentially designated as image distances to be adjusted, where i is an integer greater than 1 and less than j.
[0045] S122: Sequentially adjust the image distance of the image acquisition device to each image distance to be adjusted, and acquire the candidate images obtained by the image acquisition device of the current object under each image distance to be adjusted.
[0046] S123: Determine whether there is a candidate image among the candidate images whose sharpness meets the first sharpness condition.
[0047] The first sharpness condition may include sharpness greater than a first sharpness threshold, and the difference between the sharpness of the candidate image and the sharpness of the template image being less than a preset sharpness difference.
[0048] If a candidate image exists that satisfies the first sharpness condition, execute S124; if no candidate image exists that satisfies the first sharpness condition, execute S125.
[0049] S124: Select the candidate image whose sharpness meets the first sharpness condition as the current image.
[0050] S125: Narrow down the current image distance range and update the current image distance range using the narrowed range. After executing S125, return to S121.
[0051] The above scheme uses the image distance range supported by the image acquisition device as the initial current image distance range. If a candidate image whose sharpness meets the first sharpness condition is obtained in the current round, the iteration stops. If no candidate image whose sharpness meets the first sharpness condition is obtained, the current image distance range of the current round is narrowed to obtain the current image distance range of the next round, and the iteration continues until a candidate image whose sharpness meets the first sharpness condition is obtained. Thus, it is possible to find a candidate image whose sharpness meets the first sharpness condition through multiple rounds of iteration.
[0052] Furthermore, in some embodiments, S125 includes: reducing the maximum boundary of the current image distance range, or increasing the minimum boundary of the current image distance range.
[0053] To reduce the number of iterations and improve iteration effectiveness, the current image distance range can be narrowed by combining the sharpness distribution of each candidate image corresponding to the current image distance range. Specifically: Figure 3 This is a schematic flowchart of another embodiment of the preset point correction method for the image acquisition device provided in this application. This embodiment is a further extension of S125. Figure 3 As shown, in this embodiment, S125 may include: S1251: Use the image distance to be adjusted corresponding to the candidate image whose sharpness meets the second sharpness condition as the reference image distance.
[0054] The second sharpness condition can be that the sharpness is greater than a second sharpness threshold, or that the sharpness is the maximum, etc., where the second sharpness threshold is less than the first sharpness threshold. For example, the image distance to be adjusted corresponding to the candidate image with the highest sharpness among all candidate images corresponding to the current image distance range can be used as the reference image distance.
[0055] S1252: The intersection of the neighboring image distance range of the reference image distance and the current image distance range is used as the reduced current image distance range.
[0056] The minimum and maximum boundaries of the neighborhood image distance range are the difference between the reference image distance and the image distance interval, and the sum of the reference image distance and the image distance interval, respectively. The image distance interval is the interval between adjacent image distances to be adjusted. For example, if the reference image distance is vx and the image distance interval is a, the neighborhood image distance range is [vx-a, vx+a].
[0057] When the reference image distance is the maximum boundary of the current image distance range, the maximum and minimum boundaries of the reduced current image distance range are the reference image distance and the difference between the reference image distance and the image distance interval, respectively. For example, if vx is N in [M, N], then the intersection of [vx-a, vx+a] and [M, N] is [vx-a, N].
[0058] When the reference image distance is the maximum boundary of the current image distance range, the maximum and minimum boundaries of the reduced current image distance range are the sum of the reference image distance and the image distance interval, and the reference image distance, respectively. For example, if vx is M in [M, N], then the intersection of [vx-a, vx+a] and [M, N] is [M, vx+a].
[0059] When the reference image distance is the middle image distance of the current image distance range, the maximum and minimum boundaries of the reduced current image distance range are the sum of the reference image distance and the image distance interval, respectively, and the minimum boundary image distance of the current image distance range is the difference between the reference image distance and the image distance interval. For example, if vx is the image distance between M and N, then the intersection of [vx-a, vx+a] and [M, N] is [vx-a, vx+a].
[0060] The above scheme can combine the sharpness distribution of each candidate image corresponding to the current image distance range to specifically narrow the current image distance range, thereby reducing the number of iterations and improving the effectiveness of iteration.
[0061] In some embodiments, before S130, the method further includes: dividing the current image into multiple image units; obtaining the representative brightness value of each image unit; reducing the brightness value of each pixel in the image unit whose representative brightness value is greater than a first exposure threshold, and increasing the brightness value of each pixel in the image unit whose representative brightness value is less than a second exposure threshold, so as to update the current image, wherein the first exposure threshold is greater than the second exposure threshold.
[0062] In this context, an image unit can be a single pixel, an image block composed of multiple pixels, or the current image itself. The representative brightness value of an image unit can be the mean, mode, median, etc., of the brightness values of all pixels within that unit. The first exposure threshold is the overexposure threshold, and the second exposure threshold is the underexposure threshold. If the representative brightness value of an image unit is greater than the first exposure threshold, it means that the image unit is overexposed; therefore, the brightness values of each pixel within it are reduced to eliminate the overexposure. If the representative brightness value of an image unit is less than the first exposure threshold, it means that the image unit is underexposed; therefore, the brightness values of each pixel within it are increased to eliminate the underexposure.
[0063] The brightness value can be increased or decreased, but is not limited to, through the Gamma algorithm.
[0064] It is understandable that changes in light intensity due to natural environmental factors (such as day and night, external light sources) can cause instability in the brightness of the current image, potentially resulting in overexposure or underexposure. This can affect the accuracy of image comparison and, consequently, the correction effect. For example, if the current image is too dark or overexposed, the actual positional offset of the object between the current image and the template image may be too large, affecting the correction effect.
[0065] The above solution can eliminate overexposure or underexposure by adjusting brightness, thereby improving the accuracy of image comparison results and enhancing the correction effect.
[0066] In some embodiments, the representative brightness values of each image unit can be normalized before being compared with the first exposure threshold and the second exposure threshold to improve the brightness adjustment effect.
[0067] In some embodiments, prior to S130, the process includes: obtaining a template image.
[0068] In some embodiments, the template image is set manually.
[0069] In some embodiments, the template image is acquired in the same way as the current image, but the template image is acquired before the current image. This allows for automatic acquisition of the template image. Furthermore, it can narrow down the sharpness and exposure of the template image and the current image, avoiding the negative impact of differences in sharpness and exposure between the two images on image comparison.
[0070] In some embodiments, after automatically acquiring the template image, a manual verification step can be set up. In the manual verification step, the template image can be displayed to the user so that the user can confirm whether the quality of the template image meets the quality requirements.
[0071] In some embodiments, the current preset point corresponds to multiple template images with different exposures and / or different sharpnesses. S130 includes: acquiring candidate position offsets of the current object between the current image and each template image; and using the smallest candidate position offset as the actual position offset. This avoids the negative impact of differences in exposure and sharpness between the current image and the template images on image comparison. For example, if the template image is acquired during the day and the current image is acquired at night, the different light intensities during the day and night result in different exposures, leading to a larger actual position offset. Storing template images acquired during the day and at night avoids this problem.
[0072] In some embodiments, S130 includes: extracting features from the current image and the template image respectively to obtain the current feature and the template feature; obtaining the feature point pair that matches the current object between the current feature and the template feature; and obtaining the actual position offset based on the matched feature point pair.
[0073] In some embodiments, the offset between two feature points in a matched feature point pair can be obtained as the actual position offset.
[0074] In some embodiments, the offset between two feature points in all matching feature point pairs can be obtained, and the actual position offset can be obtained by statistically analyzing the offsets of all matching feature point pairs. The statistical method can be to calculate the mode, mean, median, etc.
[0075] In some embodiments, before obtaining the actual position offset based on the matched feature point pairs, the method further includes: determining whether the number of matched feature point pairs is greater than a number threshold; and in response to the number being greater than the number threshold, performing the step of obtaining the actual position offset based on the matched feature point pairs. This avoids the impact of an insufficient number of matched feature point pairs on the accuracy of the actual position offset.
[0076] In some embodiments, S140 includes: mapping the actual position offset to obtain the adjustment amount of the current preset point; and using the current preset point plus the adjustment amount to obtain the corrected current preset point.
[0077] Among them, the mapping relationship between the actual position offset and the adjustment amount can be preset, and the adjustment amount can be obtained by mapping the actual position offset according to the mapping relationship.
[0078] Here, the current preset point is represented by coordinates, and the adjustment amount is the coordinate compensation for the current preset point. In some embodiments, the adjustment amount includes the adjustment amount for the horizontal coordinate and the adjustment amount for the vertical coordinate.
[0079] In some embodiments, after S140, the process includes: controlling the image acquisition device to rotate back to the current preset point for correction; reacquiring the current image acquired by the image acquisition device of the current object; reacquiring the actual position offset of the current object between the reacquiring current image and the template image; in response to the reacquiring actual position offset satisfying the correction condition, using the corrected current preset point as the correction result; in response to the reacquiring actual position offset not satisfying the correction condition, continuing to correct the current preset point using the reacquiring actual position offset, and repeating the aforementioned steps.
[0080] The correction conditions may include the number of corrections reaching a correction threshold, or the actual position offset being reacquired being less than an offset threshold.
[0081] Understandably, if the number of corrections reaches the threshold and the correction effect still does not meet expectations, the user can be notified to provide a solution, such as resetting the template image or resetting the preset point. If the actual position offset obtained after correction is less than the offset threshold, it means that the accuracy of the current preset point is high enough; otherwise, it means that the accuracy of the current preset point is not high enough.
[0082] Understandably, factors such as an insufficient number of matched feature point pairs can lead to low accuracy in correcting the current preset point. Therefore, it is necessary to verify the correction effect to ensure the accuracy of the corrected current preset point.
[0083] The above scheme re-acquires the actual position offset by correcting the current preset point. If the re-acquired actual position offset meets the correction conditions, it means that the accuracy of the corrected current preset point is high enough. The corrected current preset point is then used as the correction result and the correction stops. If the correction conditions are not met, it means that the accuracy of the corrected current preset point is not high enough. The correction continues based on the corrected current preset point to obtain a corrected current preset point with sufficient accuracy.
[0084] In some embodiments, to avoid conflicts between image acquisition tasks and correction effect verification, before controlling the image acquisition device to rotate again from the previous preset point to the next preset point according to the current preset point of correction, or before rotating the adjustment amount between the original current preset point and the current preset point of correction, it is determined whether the image acquisition device is currently performing an image acquisition task. If it is performing an image acquisition task, the rotation is delayed. The delayed rotation can also be recorded and the user notified. For example, after rotating to the original current preset point, the position L1 of the image acquisition device is obtained, and before continuing to rotate the adjustment amount, the position L2 of the image acquisition device is obtained. If the difference between L1 and L2 is less than 5%, it is considered that the image acquisition device is not performing an image acquisition task, and the adjustment amount continues to be rotated for correction effect verification. If the difference is not less than 5%, it is considered that the image acquisition device is performing an image acquisition task, the adjustment amount is not continued, and the correction effect verification is delayed.
[0085] Furthermore, in some embodiments, prior to S140, the process includes: in response to the actual position offset being greater than a first offset threshold, not performing the step of correcting the current preset point, and notifying the user. For example, the first offset threshold is 98%.
[0086] It is understandable that a value greater than the first offset threshold means that the actual position is too far off. Such a large offset may be due to external force majeure factors, such as obstruction, collision, or strong wind, rather than the current preset point being inaccurate. Therefore, the current preset point will not be corrected. Instead, the user will be notified to handle the situation in a timely manner to avoid haphazard correction and reduce the probability of incorrect correction.
[0087] In some embodiments, if the actual position offsets corresponding to a predetermined number of consecutive preset points along the cruise path are all greater than a first offset threshold, then the step of correcting the current preset point is not performed, and the user is notified. The predetermined number can be 4, 5, etc.
[0088] It is understandable that if a consecutive preset number of actual position offsets are greater than the first offset threshold, it means that there is a collision or other situation in the image acquisition device. The actual position offset may be caused by the collision rather than by the inaccuracy of the current preset point. Therefore, the current preset point is not corrected, but the user is notified to avoid random correction and reduce the probability of miscorrection.
[0089] In some embodiments, prior to S140, the step of correcting the current preset point is not performed in response to the actual position offset being less than a second offset threshold. The second offset threshold is less than a first offset threshold.
[0090] Understandably, if the actual position offset is less than the second offset threshold, it means that the accuracy of the current preset point is high enough, so no correction is needed.
[0091] In some embodiments, S120 includes: controlling the image acquisition device to acquire corresponding candidate images by means of an image acquisition command at each adjusted image distance of the image acquisition device.
[0092] In some embodiments, S120 includes: sending a pull stream command to the image acquisition device before adjusting the image distance to obtain the real-time stream continuously acquired by the image acquisition device during the image distance adjustment; and obtaining the candidate image corresponding to each adjusted image distance from the real-time stream.
[0093] Specifically, the I-frames corresponding to each adjusted pixel distance in the real-time stream can be converted into candidate images.
[0094] It is understandable that different image acquisition devices (such as those from different manufacturers, models, and versions) may use different communication protocols, such as the ONVIF protocol, the national standard protocol, and other proprietary protocols. Some communication protocols do not support image acquisition command responses, meaning that image acquisition devices cannot be controlled to acquire candidate images via image acquisition commands.
[0095] The above solution, which obtains a real-time stream through a pull command and then acquires candidate images from the real-time stream, is compatible with the communication protocol differences of different image acquisition devices, ensuring the normal acquisition of candidate images.
[0096] In some embodiments, the actual position offset corresponding to each preset point can be determined sequentially first, and then the current preset point of each preset point can be corrected sequentially based on the actual position offset. That is, the actual position offset and the current preset point are performed in two stages.
[0097] In some embodiments, the actual position offset of one preset point can be obtained and the preset point can be corrected first; then the actual position offset of the next preset point can be obtained and the preset point can be corrected. That is, the correction of the next preset point will only begin after the correction of one preset point is completed.
[0098] In some embodiments, a communication connection between the correction device and the image acquisition device is only required when the current image is acquired and the image acquisition device is rotated during the entire correction process, which can reduce network pressure.
[0099] In some embodiments, since the correction device is an external device independent of the image acquisition device, there is no need to update the hardware and software of the image acquisition device, and the cost of preset point correction is low.
[0100] Correction equipment and imaging equipment can form a preset point correction system. Figure 4 This is a schematic diagram of the structure of an embodiment of the preset point correction system provided in this application. Figure 4 As shown, the preset point correction system includes a correction device and several image acquisition devices. These "several" devices can be one, 100, 1000, etc. The correction device is used to execute the preset point correction method.
[0101] In some embodiments, when the preset point correction system includes multiple image acquisition devices, the correction devices can perform corrections on some of the image acquisition devices concurrently.
[0102] In some embodiments, the concurrency strategy involves obtaining the number of computing units (e.g., CPUs) of the correction device, and then performing concurrent thread operations at once, which is twice the number of computing units. Multiple image acquisition devices are divided into several image acquisition device groups, with each group containing twice the number of computing units. This allows for concurrent correction of a single image acquisition device group.
[0103] In some embodiments, the correction strategy of the correction device for multiple image acquisition devices can be periodic correction, spot check correction, full correction, etc. The correction device and the image acquisition devices can disconnect the communication connection or stop streaming during periods when there is no need for correction, thus saving network bandwidth.
[0104] In some embodiments, the real-time stream acquired by the image acquisition device is divided into a main stream and a secondary stream. To save network bandwidth, only the main stream can be acquired.
[0105] In some embodiments, considering that the deviation of the current preset point accumulates over a long period, the time interval between two adjacent corrections in the case of periodic correction can be set according to the accumulation of deviation. For example, the time interval can be set to be longer, such as one month.
[0106] In some embodiments, all information before, during, and after correction (original current preset point, current preset point for each correction, delayed correction items, number of corrections, etc.) can be recorded on the information aggregation platform.
[0107] To facilitate understanding, the preset point correction method provided in this application will be explained below with a specific example.
[0108] 1. Set the corresponding template image for each preset point.
[0109] Figure 5 This is a flowchart illustrating the process of setting up the template image in this application. For example... Figure 5 As shown, setting the template image includes the following steps: (a) Obtain the cruise path of the gimbal camera. The cruise path includes multiple preset points in sequence.
[0110] (ii) Control the gimbal camera to cruise along the cruise path. When it reaches a preset point, take the preset point as the current preset point and obtain the template image corresponding to the current preset point.
[0111] 1. Defocus compensation.
[0112] (1) Obtain the minimum image distance M and the maximum image distance N supported by the image acquisition device.
[0113] (2) Take [M, N] as the initial current image distance range.
[0114] (3) Take the minimum boundary and the maximum boundary of the current image distance range as the minimum image distance to be adjusted v1 and the maximum image distance to be adjusted v5 respectively. According to the image distance interval a=(v5–v1) / 4, determine the image distances to be adjusted v2, v3, and v4 between v1 and v5. vi=a*(i-1)+v1, where vi represents the i-th image distance to be adjusted, and i is 2, 3, or 4.
[0115] (4) The image distance of the image acquisition device is adjusted to v1, v2, v3, v4 and v5 in sequence, and the candidate images Image1, Image2, Image3, Image4 and Image5 obtained by the image acquisition device for the current object corresponding to the current preset point under v1, v2, v3, v4 and v5 respectively.
[0116] (5) Use the Brenner gradient algorithm to obtain the sharpness of Image1, Image2, Image3, Image4 and Image5, and determine whether there are candidate images among Image1, Image2, Image3, Image4 and Image5 whose sharpness meets the first sharpness condition (greater than the first sharpness threshold).
[0117] If there is a candidate image whose sharpness meets the first sharpness condition, execute (6); if there is no candidate image whose sharpness meets the first sharpness condition, execute (7)-(9).
[0118] (6) Use the candidate image whose sharpness meets the first sharpness condition as the template image. After executing (6), proceed to (10).
[0119] (7) The image distance to be adjusted corresponding to the candidate image that meets the second sharpness condition (highest sharpness) is used as the reference image distance.
[0120] (8) Obtain the intersection of the neighborhood image distance range [vx-a, vx+a] of the reference image distance and the current image distance range [M, N].
[0121] (9) Update the image distance range using the intersection and return (3).
[0122] 2. Brightness compensation.
[0123] (10) Divide the template image into multiple image units according to m×n, where m and n represent the number of pixels in the width direction and the number of pixels in the height direction of the image unit, respectively.
[0124] (11) Obtain the representative brightness value of each image unit and normalize it.
[0125] (12) Decrease the brightness value of each pixel in the image unit representing a brightness value greater than the first exposure threshold, and increase the brightness value of each pixel in the image unit representing a brightness value less than the second exposure threshold, so as to update the template image and store it. The first exposure threshold is greater than the second exposure threshold.
[0126] II. Preset point correction.
[0127] Figure 6 This is a flowchart illustrating the pre-set point correction process in this application. For example... Figure 6 As shown, preset point correction includes the following steps: (a) Obtain the cruise path of the gimbal camera. The cruise path includes multiple preset points in sequence.
[0128] (ii) Control the gimbal camera to cruise along the cruise path. Each time it reaches a preset point, the preset point reached is used as the current preset point and the current preset point is corrected.
[0129] 1. Defocus compensation.
[0130] (1) Obtain the minimum image distance M and the maximum image distance N supported by the image acquisition device.
[0131] (2) Take [M, N] as the initial current image distance range.
[0132] (3) Take the minimum boundary and the maximum boundary of the current image distance range as the minimum image distance to be adjusted v1 and the maximum image distance to be adjusted v5 respectively. According to the image distance interval a=(v5–v1) / 4, determine the image distances to be adjusted v2, v3, and v4 between v1 and v5. vi=a*(i-1)+v1, where vi represents the i-th image distance to be adjusted, and i is 2, 3, or 4.
[0133] (4) The image distance of the image acquisition device is adjusted to v1, v2, v3, v4 and v5 in sequence, and the candidate images Image1, Image2, Image3, Image4 and Image5 obtained by the image acquisition device for the current object corresponding to the current preset point under v1, v2, v3, v4 and v5 respectively.
[0134] (5) Use the Brenner gradient algorithm to obtain the sharpness of Image1, Image2, Image3, Image4 and Image5, and determine whether there are candidate images among Image1, Image2, Image3, Image4 and Image5 whose sharpness meets the first sharpness condition (greater than the first sharpness threshold).
[0135] If there is a candidate image whose sharpness meets the first sharpness condition, execute (6); if there is no candidate image whose sharpness meets the first sharpness condition, execute (7)-(9).
[0136] (6) Select the candidate image whose sharpness meets the first sharpness condition as the current image. After executing (6), proceed to (10).
[0137] (7) The image distance to be adjusted corresponding to the candidate image that meets the second sharpness condition (highest sharpness) is used as the reference image distance.
[0138] (8) Obtain the intersection of the neighborhood image distance range [vx-a, vx+a] of the reference image distance and the current image distance range [M, N].
[0139] (9) Update the image distance range using the intersection and return (3).
[0140] 2. Brightness compensation.
[0141] (10) Divide the current image into multiple image units according to m×n, where m and n represent the number of pixels in the width direction and the number of pixels in the height direction of the image unit, respectively.
[0142] (11) Obtain the representative brightness value of each image unit and normalize it.
[0143] (12) Decrease the brightness value of each pixel in the image unit representing a brightness value greater than the first exposure threshold, and increase the brightness value of each pixel in the image unit representing a brightness value less than the second exposure threshold, so as to update the current image, where the first exposure threshold is greater than the second exposure threshold.
[0144] 3. Current preset point correction.
[0145] (13) Obtain the actual position offset of the current object between the current image and the template image corresponding to the current preset point.
[0146] (14) Determine whether the actual position offset is greater than the first offset threshold or less than the second offset threshold. If it is greater than the first offset threshold, do not perform correction and notify the user; if it is less than the second offset threshold, do not perform correction; if it is not greater than the first offset threshold and not less than the second offset threshold, proceed to (15).
[0147] (15) The adjustment amount of the current preset point is obtained by mapping the actual position offset.
[0148] (16) Use the current preset point plus the adjustment amount to obtain the current preset point for correction.
[0149] 4. Verification of correction results.
[0150] (17) Control the image acquisition device to rotate back to the current preset point of correction, return to (1) to repeat (1)-(13) to obtain the actual position offset of the reacquired position.
[0151] (18) Determine whether the reacquired actual position offset meets the correction conditions. If the correction conditions are met, the current preset point is used as the correction result; if it is not less than the offset threshold, return (14) to continue to correct the current preset point using the reacquired actual position offset.
[0152] To facilitate understanding, the preset point correction method provided in this application will be explained in the context of a power industry scenario: Figure 7 This is a schematic diagram illustrating a scenario where preset points are corrected in a power-related context. For example... Figure 7 As shown, the current object corresponding to the current preset point is the electricity meter.
[0153] 1. Set the template image corresponding to the current preset point.
[0154] 2. Control the image acquisition device to rotate to the current preset point and acquire the current image 1 collected by the image acquisition device from the electricity meter.
[0155] 3. Perform defocus compensation and brightness compensation on the current image 1 to obtain the current image 2.
[0156] 4. Using the actual positional offset of the current object between the current image 2 and the template image, perform the first correction on the original current preset point to obtain the first corrected current preset point.
[0157] 5. Control the image acquisition device to rotate to the current preset point for correction, and acquire the current image 3 of the meter acquired by the image acquisition device and after defocus compensation and brightness compensation.
[0158] 6. Using the actual positional offset of the current object between the current image 3 and the template image, perform a second correction on the current preset point obtained from the first correction to obtain the current preset point after the second correction.
[0159] 7. Control the image acquisition device to rotate to the current preset point of the second correction, and acquire the current image 4 of the meter acquired by the image acquisition device and after defocus compensation and brightness compensation.
[0160] 8. Using the actual positional offset of the current object between the current image 4 and the template image, perform a third correction on the current preset point of the second correction to obtain the current preset point of the third correction.
[0161] 9. Control the image acquisition device to rotate to the current preset point of the third correction, and acquire the current image 5 of the meter acquired by the image acquisition device, after defocus compensation and brightness compensation. The actual positional offset between the current image 5 and the template image meets the correction conditions, and the current preset point of the third correction is taken as the correction result.
[0162] Figure 8 This is a schematic diagram of an embodiment of the correction device provided in this application. Figure 8 As shown, the correction device includes a rotation module, an adjustment module, an acquisition module, and a correction module. Among them: The rotation module is used to control the image acquisition device to rotate to the current preset point.
[0163] The adjustment module is used to adjust the image distance of the image acquisition device multiple times, and to acquire candidate images of the current object corresponding to the current preset point at each adjusted image distance, and to select the current image whose sharpness meets the preset sharpness condition from multiple candidate images.
[0164] The acquisition module is used to obtain the actual position offset of the current object between the current image and the template image corresponding to the current preset point.
[0165] The correction module is used to correct the current preset point based on the actual position offset.
[0166] For further detailed descriptions of this embodiment, please refer to the preceding embodiments, which will not be repeated here.
[0167] Figure 9 This is a schematic diagram of the structure of an embodiment of the electronic device of this application. Figure 9 As shown, the electronic device 50 includes a memory 51 and a processor 52. The processor 52 is used to execute program instructions stored in the memory 51 to implement the steps in any of the above method embodiments. In a specific implementation scenario, the electronic device 50 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 50 may also include a laptop computer, a tablet computer, or other carrier device, which is not limited here.
[0168] Specifically, processor 52 controls itself and memory 51 to implement the steps in any of the above method embodiments. Processor 52 may also be referred to as a CPU (Central Processing Unit). Processor 52 may be an integrated circuit chip with signal processing capabilities. Processor 52 may also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 52 may be implemented using integrated circuit chips.
[0169] Please see Figure 10 , Figure 10 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application. The computer-readable storage medium 60 stores program instructions 601 thereon, which, when executed by a processor, implement the steps in any of the above method embodiments.
[0170] This application also provides a computer program product comprising a computer program that, when executed by a processor, can implement the steps of the methods described in any of the foregoing embodiments. Specifically, the computer program product can be a software or program product containing a computer program, capable of running on a computing device or stored on any available medium.
[0171] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0172] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0173] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. In another image location, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0174] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of 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 network device, etc.) or processor 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.
Claims
1. A method for correcting preset points in an image acquisition device, characterized in that, include: Control the image acquisition device to rotate to the current preset point; The image distance of the image acquisition device is adjusted multiple times, and candidate images of the current object corresponding to the current preset point are acquired by the image acquisition device at each adjusted image distance. The current image whose sharpness meets the preset sharpness condition is selected from the multiple candidate images. Obtain the actual position offset of the current object between the current image and the template image corresponding to the current preset point; The current preset point is corrected based on the actual position offset.
2. The method according to claim 1, characterized in that, The process of repeatedly adjusting the image distance of the image acquisition device, acquiring candidate images of the current object corresponding to the current preset point under each adjusted image distance, and selecting the current image whose sharpness meets the preset sharpness condition from the multiple candidate images includes: Multiple image distances to be adjusted are determined from the current image distance range, and the initial minimum boundary and maximum boundary of the current image distance range are the minimum image distance and maximum image distance supported by the image acquisition device, respectively. The image distance of the image acquisition device is sequentially adjusted to each of the image distances to be adjusted, and candidate images of the current object are obtained by the image acquisition device at each of the image distances to be adjusted. Determine whether there exists a candidate image among the candidate images whose sharpness meets the first sharpness condition; In response to the existence of a candidate image whose sharpness satisfies the first sharpness condition, the candidate image whose sharpness satisfies the first sharpness condition is taken as the current image; In response to the absence of a candidate image whose sharpness satisfies the first sharpness condition, the current image distance range is reduced, the current image distance range is updated using the reduced current image distance range, and the aforementioned steps are repeated.
3. The method according to claim 2, characterized in that, The step of narrowing the current image distance range includes: The image distance to be adjusted corresponding to the candidate image whose sharpness meets the second sharpness condition is used as the reference image distance; The intersection of the neighborhood image distance range of the reference image distance and the current image distance range is taken as the reduced current image distance range. The minimum boundary and the maximum boundary of the neighborhood image distance range are the difference between the reference image distance and the image distance interval, and the sum of the reference image distance and the image distance interval, respectively. The image distance interval is the interval between adjacent image distances to be adjusted.
4. The method according to claim 1, characterized in that, Before obtaining the actual position offset of the current object between the current image and the template image corresponding to the current preset point, the method further includes: The current image is divided into multiple image units; Obtain the representative brightness value of each of the image units respectively; The brightness values of each pixel in the image unit representing a brightness value greater than the first exposure threshold are reduced, and the brightness values of each pixel in the image unit representing a brightness value less than the second exposure threshold are increased, in order to update the current image, wherein the first exposure threshold is greater than the second exposure threshold.
5. The method according to claim 1, characterized in that, Before obtaining the actual position offset of the current object between the current image and the template image corresponding to the current preset point, the process includes: The template image is obtained in the same way as the current image, and the template image is obtained before the current image is obtained. And / or, obtaining the actual position offset of the current object between the current image and the template image corresponding to the current preset point includes: Feature extraction is performed on the current image and the template image respectively to obtain the current features and template features; Obtain the feature point pair that matches the current object between the current feature and the template feature; The actual position offset is obtained based on the matched feature point pairs.
6. The method according to claim 1, characterized in that, The current preset point corresponds to multiple template images with different exposures and / or different resolutions; The step of obtaining the actual position offset of the current object between the current image and the template image corresponding to the current preset point includes: The candidate position offsets of the current object between the current image and each of the template images are obtained respectively; The smallest candidate position offset among all the candidate position offsets is taken as the actual position offset.
7. The method according to claim 1, characterized in that, The step of correcting the current preset point based on the actual position offset includes: The adjustment amount of the current preset point is obtained by mapping the actual position offset; The current preset point is obtained by adding the adjustment amount to the current preset point; And / or, after correcting the current preset point based on the actual position offset, the following is included: Control the image acquisition device to rotate back to the current preset point of the correction; Reacquire the current image of the current object obtained by the image acquisition device; Reacquire the actual position offset of the current object between the reacquired current image and the template image; In response to the actual position offset being reacquired satisfying the correction condition, the current preset point of the correction is taken as the correction result; If the reacquired actual position offset does not meet the correction condition, the current preset point is corrected using the reacquired actual position offset, and the aforementioned steps are repeated.
8. The method according to claim 1, wherein before correcting the current preset point based on the actual position offset, the method comprises: If the actual position offset is greater than a first offset threshold, the step of correcting the current preset point is not performed, and the user is notified. And / or, in response to the actual position offset being less than the second offset threshold, the step of correcting the current preset point is not performed; And / or, acquiring the candidate image of the current object corresponding to the current preset point by the image acquisition device at each adjusted image distance includes: Before adjusting the image distance, a pull stream command is sent to the image acquisition device to obtain the real-time stream continuously acquired by the image acquisition device during the image distance adjustment. The candidate image corresponding to the adjusted image distance is obtained from the real-time stream for each adjustment.
9. A preset point correction system, comprising a correction device and a plurality of image acquisition devices, wherein the correction device is used to perform the method of any one of claims 1-8.
10. An electronic device, characterized in that, It includes a memory and a processor, the processor being configured to execute program instructions stored in the memory to implement the method of any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, It stores program instructions that, when executed by a processor, implement the method of any one of claims 1-8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-8.