Image processing method and device, electronic equipment and storage medium

By determining the horizontal dimensions of the target object in the security system and adjusting the magnification twice, the problem of the target being too small in the captured image was solved, and the effectiveness of target detection was improved.

CN119815172BActive Publication Date: 2025-11-21ZHEJIANG UNIVIEW TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311310558.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-11
Publication Date
2025-11-21
Estimated Expiration
2043-10-11

AI Technical Summary

Technical Problem

In the field of security, small targets in the captured images may not meet the requirements, affecting the effectiveness of target detection.

Method used

By determining the horizontal size of the target object in the first captured image, the initial magnification is determined based on this size. If necessary, two zoom shots are taken until the target object occupies a suitable proportion in the image, meeting the requirements for subsequent analysis.

Benefits of technology

It improves the effectiveness of target detection, ensures that the target occupies an appropriate proportion in the image, and solves the problem that the capture does not meet the requirements due to the target being too small.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119815172B_ABST
    Figure CN119815172B_ABST
Patent Text Reader

Abstract

An image processing method and device, electronic equipment and storage medium are disclosed. The method comprises: determining a first horizontal size of a target object in a first shooting picture; determining a first magnification used for shooting the target object according to the first horizontal size; determining a second horizontal size of the target object in a second shooting picture; determining a second magnification used for shooting the target object based on the second horizontal size and the first magnification, and shooting the target object according to the second magnification. After the target object is shot based on the first magnification to obtain the second shooting picture, the target in the second shooting picture may still not meet the requirements. Then, the target object is shot according to the second magnification, and the problem that the target in the shooting picture is too small to meet the requirements is solved through two times of zoom shooting, thereby improving the effectiveness of target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an image processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the continuous development of the security field, radar can be used to detect designated areas. If a moving target is detected by radar, a camera can be activated to capture the target. However, in actual use, it has been found that the targets entering the camera's field of view are often too small, resulting in captured targets that do not meet the requirements. This leads to ineffective target analysis in subsequent processes, affecting the effectiveness of target detection. Summary of the Invention

[0003] This invention provides an image processing method, apparatus, electronic device, and storage medium to solve the problem that small targets in the captured image cause the captured targets to fail to meet requirements, thereby improving the effectiveness of target detection.

[0004] According to one aspect of the present invention, an image processing method is provided, the method comprising:

[0005] Determine the first horizontal dimension of the target object in the first captured image, wherein the first captured image is the image captured by the target capturing device when the target object is detected in the target detection area, and the horizontal dimension is the dimension along the horizontal axis in the captured image;

[0006] The first magnification factor used to photograph the target object is determined based on the first lateral dimension.

[0007] Determine the second horizontal dimension of the target object in the second shooting frame, where the second shooting frame is the image captured by the target shooting device at the first magnification.

[0008] Based on the second lateral dimension and the first magnification, a second magnification is determined for photographing the target object, and the target object is photographed according to the second magnification.

[0009] According to another aspect of the present invention, an image processing apparatus is provided, the apparatus comprising:

[0010] The first size determination module is used to determine the first horizontal size of the target object in the first shooting frame. The first shooting frame is the frame when the target object is detected in the target detection area and the target shooting device is linked to shoot the target object. The horizontal size is the size along the horizontal axis in the shooting frame.

[0011] The magnification determination module is used to determine the first magnification used to photograph the target object based on the first lateral dimension.

[0012] The second size determination module is used to determine the second horizontal size of the target object in the second shooting frame, wherein the second shooting frame is the image of the target object being shot by the target shooting device at the first magnification.

[0013] The shooting module is used to determine the second magnification ratio to be used for shooting the target object based on the second horizontal dimension and the first magnification ratio, and to shoot the target object according to the second magnification ratio.

[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the image processing method according to any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the image processing method according to any embodiment of the present invention.

[0019] The technical solution of this invention addresses the issue that the target object initially captured by the target device cannot meet the requirements of subsequent analysis. Therefore, after determining the first horizontal dimension of the target object in the first captured image, a first magnification factor is further determined based on this first horizontal dimension. The target object is then captured using this first magnification factor to obtain a second captured image, thus achieving a more satisfactory result. If the proportion of the target object's size to the image size in the second captured image is still not satisfactory, a second horizontal dimension of the target object in the second captured image is determined based on the second horizontal dimension and the first magnification factor. The target object is then captured using this second magnification factor. This two-stage zooming process resolves the issues of excessive magnification causing the target to exceed the frame or excessive magnification causing the target to be too small. By ensuring the magnification factor is at an appropriate value, the target's proportion in the image is maintained, effectively solving the problem of a small target in the captured image causing the captured target to be unsatisfactory, thereby improving the effectiveness of target detection.

[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1a This is a flowchart of an image processing method provided according to an embodiment of the present invention;

[0023] Figure 1b This is a top view of a radar-scanned target object applicable to embodiments of the present invention;

[0024] Figure 2a This is a flowchart of an image processing method provided according to an embodiment of the present invention;

[0025] Figure 2b This is a top view of the target object captured by a shooting device applicable to an embodiment of the present invention;

[0026] Figure 3 This is a flowchart of an image processing method provided according to an embodiment of the present invention;

[0027] Figure 4a This is a flowchart of an image processing method provided according to an embodiment of the present invention;

[0028] Figure 4b This is a top view of a radar scanning object applicable to an embodiment of the present invention;

[0029] Figure 5 This is a schematic diagram of the structure of an image processing apparatus according to an embodiment of the present invention;

[0030] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the image processing method of the present invention. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first," "second," "reference," and "target," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0033] Example 1

[0034] Figure 1a This is a flowchart illustrating an image processing method provided in an embodiment of the present invention. This embodiment is applicable to situations where, when radar tracks a vessel on the water surface and detects a moving target, the moving target is uploaded to an imaging device (laser PTZ camera). The imaging device captures an image of the target, and after image processing, a suitable capture magnification is obtained. This method can be executed by an image processing device, which can be implemented in hardware and / or software. This image processing device can be configured in any electronic device with network communication capabilities. Figure 1a As shown, the method includes:

[0035] S110. Determine the first horizontal dimension of the target object in the first shooting frame.

[0036] The first captured image is the image captured by the target capturing device when a target object is detected in the target detection area. The horizontal dimension is the dimension along the horizontal axis in the captured image, and the first horizontal dimension is the dimension of the target object along the horizontal axis in the captured image. Figure 1b As shown. The target object can be boats of different sizes traveling on the water.

[0037] Specifically, the control radar performs a scan operation towards the target detection area at preset intervals. Based on the results of each scan, it determines whether a target object exists in the target detection area. Once the existence of a target object is confirmed, the radar reports the information to the target imaging device. The target imaging device then takes a picture of the target object. When the radar scans the target object, it can obtain the first distance from the target object. Based on the size information of the target object and the first distance, the first lateral dimension can be obtained, but it is not limited to this method of obtaining the first lateral dimension.

[0038] S120. Determine the first magnification factor to be used for photographing the target object based on the first horizontal dimension.

[0039] Specifically, images of the target object captured by ordinary shooting equipment cannot meet the requirements of subsequent analysis. Therefore, it is necessary to adjust the focus of the shooting equipment to ensure that the image of the target object captured by the shooting equipment meets the requirements of subsequent analysis. Thus, it is necessary to accurately determine the first magnification that the shooting equipment needs to meet when focusing.

[0040] Optionally, determining the first magnification factor for photographing the target object based on the first horizontal dimension includes: determining the expected horizontal dimension ratio of the target object in the first captured image, and determining the horizontal dimension of the first captured image, and further determining the first magnification factor for photographing the target object based on the expected horizontal dimension ratio, the horizontal dimension of the first captured image, and the first horizontal dimension.

[0041] Wherein, the expected horizontal size ratio R0 is the minimum percentage of the target object's first horizontal size that it occupies in the first captured frame. The horizontal size of the first captured frame is determined by the resolution of the target capturing device. For example, if the resolution of the target capturing device is width CW * height CH, then the horizontal size of the first captured frame is width CW.

[0042] Specifically, the first horizontal dimension ratio can be represented by the horizontal dimension CW of the first captured image, the first horizontal dimension S1, and the first magnification Z1, as shown in the following formula:

[0043]

[0044] Where K2 is a constant, in order to satisfy the proportion of the first horizontal dimension in the first captured image, the proportion of the first horizontal dimension must be greater than or equal to the expected proportion of the horizontal dimension, that is, R≥R0. If R=R0 is taken, the first magnification Z1 can be calculated, as follows:

[0045]

[0046] S130. Determine the second horizontal dimension of the target object in the second shooting frame. The second shooting frame is the image of the target object being shot by the target shooting device at the first magnification.

[0047] Specifically, after determining the first magnification, the position of the target object in the target detection area is determined so that the target object can be captured again to obtain an image that meets the requirements for subsequent analysis. Specifically, the target shooting device is controlled to face the target object, and when adjusting the target object position, the target shooting device is adjusted to the first magnification to take a picture to obtain a second picture. If it is found that the target object in the second picture is still too small to meet the requirements for subsequent analysis, then the target shooting device needs to be refocused to obtain an image that meets the requirements.

[0048] Before taking a second shot of the target object, it is necessary to determine the second horizontal dimension of the target object in the second shot frame in order to determine the required magnification for focusing. The specific process is as follows: Separate the target object in the second shot frame from the background (the background in the second shot frame is the scenery that sets off the target object, such as waves at sea). For example, on the sea surface, the target shooting device (laser PTZ camera) tracks the target object (ship). Because the waves at sea will also cause reflections and interference, but the background generated by the waves is different from that of the ship, the ship can be easily separated; further determine the horizontal dimension of the target object separated from the second shot frame, and determine it as the second horizontal dimension of the target object in the second shot frame.

[0049] S140. Based on the second horizontal dimension and the first magnification, determine the second magnification to be used for photographing the target object, and photograph the target object according to the second magnification.

[0050] Specifically, the desired horizontal size ratio of the target object in the second shooting frame is determined, as well as the horizontal size of the second shooting frame is determined. Furthermore, if the current horizontal size ratio between the second horizontal size and the horizontal size of the second shooting frame does not meet the desired horizontal size ratio, the second magnification ratio used to shoot the target object is adjusted based on the current horizontal size ratio and the desired horizontal size ratio.

[0051] Wherein, the desired horizontal dimension ratio R0 is the minimum percentage that the second horizontal dimension S2 of the target object occupies in the first captured image. The horizontal dimension of the second captured image is determined by the resolution of the target capturing device. For example, if the resolution of the target capturing device is width CW * height CH, then the horizontal dimension of the second captured image is width CW.

[0052] Specifically, the current horizontal proportion R1 can be expressed as: R1 = S2 / CW. If R1 is less than R0, it means that the target object in the second captured image is still relatively small and cannot meet the requirements of subsequent analysis. Therefore, the second magnification Z2 is determined based on the current horizontal proportion R1 and the expected horizontal proportion R0, as shown below:

[0053]

[0054] After determining the second magnification, the position of the target object in the target detection area is determined so that the target shooting device can be controlled to face the target object. When adjusting the target object position, the first magnification of the target shooting device is adjusted to the second magnification for shooting, so as to obtain a picture that meets the requirements.

[0055] The technical solution of this invention addresses the issue that the target object initially captured by the target device cannot meet the requirements of subsequent analysis. Therefore, after determining the first horizontal dimension of the target object in the first captured image, a first magnification factor is further determined based on this first horizontal dimension. The target object is then captured using this first magnification factor to obtain a second captured image, thus achieving a more satisfactory result. If the proportion of the target object's size to the image size in the second captured image is still not satisfactory, a second horizontal dimension of the target object in the second captured image is determined based on the second horizontal dimension and the first magnification factor. The target object is then captured using this second magnification factor. This two-stage zooming process resolves the issues of excessive magnification causing the target to exceed the frame or excessive magnification causing the target to be too small. By ensuring the magnification factor is at an appropriate value, the target's proportion in the image is maintained, effectively solving the problem of a small target in the captured image causing the captured target to be unsatisfactory, thereby improving the effectiveness of target detection.

[0056] Example 2

[0057] Figure 2a This is a flowchart of an image processing method provided by an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of S110 in the above embodiments based on the above embodiments. This embodiment can be combined with various optional solutions in one or more of the above embodiments, and this solution can be used to determine the first horizontal dimension of the target object in the first shooting frame under any circumstances.

[0058] like Figure 2a As shown, the method includes:

[0059] S210. Determine the size of the reference object of the target object in the target detection region. The reference object and the target object satisfy the preset similarity conditions in at least some object attribute dimensions.

[0060] The reference object is a typical object that may appear in a scene similar to the current scene of the target object. The typical objects that appear in different scenes may be different. Taking a ship as an example, the typical ship can be the largest ship, a ship that appears frequently, or a ship that appears frequently at this time and location.

[0061] In this embodiment, the first lateral dimension needs to be determined by the size information of the target object. However, when the radar scans the target object, it feeds back the object attribute information of the target object, and cannot obtain the size information of the target object. Therefore, it is necessary to compare the object attribute information of the target object with the object attribute information of the reference object to find the reference object that meets the preset similarity condition with the target object in at least some object attribute dimensions, so as to use the size information of the reference object as the reference object size of the target object.

[0062] Specifically, the target object attribute information of the target object in the target detection area is determined. The target object attribute information includes the target object position, the target object detection time, the target object movement trajectory, and the target object movement speed. Then, the reference object size of the target object is determined from the preset object set based on the target object attribute information. The preset object set pre-stores the reference objects associated with different object attributes and the size of the reference objects.

[0063] S220. Determine the target object's movement trajectory, target object distance, and reference shooting direction.

[0064] The reference shooting direction is determined based on the shooting direction of the target object, and the distance to the target object is determined based on the distance from the target shooting device to the target object along the reference shooting direction.

[0065] like Figure 2b The target object is target 1, the shooting device is PTZ camera C1, the target object's movement trajectory is movement trajectory T1 in the figure, the target object's distance is distance L1 in the figure, and the reference shooting direction is along the center line.

[0066] S230. Based on the size of the reference object, the movement trajectory of the target object, the distance of the target object and the reference shooting direction, determine the first horizontal dimension of the target object in the first shooting frame.

[0067] The dimensions of the reference object can be the length (BL) and width (BW) of the target object.

[0068] Specifically, the dimensions of the reference object, the trajectory of the target object, the distance to the target object, and the reference shooting direction are obtained. Generally, the target object (large ship) moves slowly and has a stable trajectory. In the short term (e.g., within 1 minute), it basically moves in a straight line. The angle α between the target object and the object being photographed can be determined based on the trajectory of the target object, the distance to the target object, and the reference shooting direction. Then, based on the angle α and the dimensions of the reference object, the reference horizontal dimension S1 in the first captured image is determined when the target shooting device is used to capture the reference object along the reference shooting direction. Specifically, it is expressed as: S1=BL*Sinα+BW*Cosα, and the reference horizontal dimension S1 is determined as the first horizontal dimension of the target object in the first captured image.

[0069] S240. Determine the first magnification factor to be used for photographing the target object based on the first horizontal dimension.

[0070] Specifically, the first horizontal dimension S1 and the desired horizontal dimension ratio R0 are obtained. The first horizontal dimension of the target object occupies a dimension R in the first captured image that is greater than or equal to the desired horizontal dimension ratio, so R = R0 is taken. The first magnification Z1 is expressed as follows:

[0071]

[0072] S250. Determine the second horizontal dimension of the target object in the second shooting frame. Based on the second horizontal dimension and the first magnification, determine the second magnification to be used to shoot the target object, and shoot the target object according to the second magnification.

[0073] The technical solution of this invention, based on the size of a reference object, the movement trajectory of the target object, the distance of the target object, and the reference shooting direction, accurately determines the first horizontal dimension of the target object in the first shooting frame. This allows for the accurate determination of the first magnification factor used for subsequent shooting of the target object based on the first horizontal dimension. The target object is then photographed using the first magnification factor to obtain a second shooting frame, resulting in a more satisfactory image. If the proportion of the target object's size to the frame size in the second shooting frame is still not satisfactory, a second horizontal dimension of the target object in the second shooting frame is determined, and a second magnification factor is used to photograph the target object based on the second horizontal dimension and the first magnification factor. The target object is then photographed according to the second magnification factor. This two-stage zooming and shooting process solves the problems of the target exceeding the frame size due to excessive magnification or the target being too small due to excessive magnification. The magnification factor is kept at an appropriate value to ensure the target occupies a suitable proportion in the frame, effectively solving the problem of the target being too small in the shooting frame and thus failing to meet the capture requirements, thereby improving the effectiveness of target detection.

[0074] Example 3

[0075] Figure 3 This is a flowchart of an image processing method provided by an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of S110 in the above embodiments based on the above embodiments. This embodiment can be combined with various optional solutions in one or more of the above embodiments. In this embodiment, when the signal strength fed back by the target object meets the requirements of the preset signal strength, this embodiment triggers the method of determining the first horizontal dimension of the target object in the first shooting frame.

[0076] like Figure 3 As shown, the method includes:

[0077] S310. Determine the target signal intensity corresponding to the target object in the target detection area, and determine the target object distance.

[0078] In this embodiment, to determine whether the signal strength fed back by the target object meets the preset signal strength requirement, one approach is to set a preset signal strength. If the signal strength fed back by the target object is greater than or equal to the preset signal strength, then it is determined that the signal strength fed back by the target object meets the preset signal strength requirement. Another approach is to set a preset distance (the preset distance is the maximum distance from the target shooting device to the target object along the reference shooting direction). When the distance to the target object is less than or equal to the preset distance, it is determined that the signal strength fed back by the target object meets the preset signal strength requirement. This means that the method described in this embodiment for determining the first horizontal dimension of the target object in the first captured frame can be used. In this case, determining the first horizontal dimension of the target object in the first captured frame based on the target signal strength and the distance to the target object is simpler and more convenient, greatly reducing the calculation process.

[0079] The target signal strength refers to the signal strength returned by the target object when it is detected by radar. The target object distance is determined based on the distance from the target imaging device to the target object along a reference imaging direction, where the reference imaging direction is determined based on the imaging direction of the target object. Figure 2b The direction along the center line is used as a reference shooting direction.

[0080] S320. Based on the target signal strength and the distance to the target object, determine the first horizontal dimension of the target object in the first captured frame.

[0081] Specifically, the preset lateral dimension calculation function describes the relationship between signal strength ss, object distance L, and lateral dimension S. Signal strength is directly proportional to the lateral dimension and inversely proportional to the square of the distance. The preset lateral dimension calculation function also includes a preset constant value k1, which is determined by the signal attenuation and scattering. The preset lateral dimension calculation function can be expressed as:

[0082]

[0083] Obtain the preset horizontal dimension calculation function, the target signal strength SS, and the target object distance L1. Input the target signal strength and the target object distance into the preset horizontal dimension calculation function, and output the first horizontal dimension S1 of the target object in the first captured frame. The first horizontal dimension S1 can be expressed as: S1=f(SS,L1)=(ss*L1) 2 ) / k1.

[0084] S330. Determine the first magnification factor to be used for photographing the target object based on the first horizontal dimension.

[0085] Specifically, the first horizontal dimension S1 and the desired horizontal dimension ratio R0 are obtained. The first horizontal dimension of the target object occupies a dimension R in the first captured image that is greater than or equal to the desired horizontal dimension ratio, so R = R0 is taken. The first magnification Z1 is expressed as follows:

[0086]

[0087] S340. Determine the second horizontal dimension of the target object in the second shooting frame. Based on the second horizontal dimension and the first magnification, determine the second magnification to be used to shoot the target object, and shoot the target object according to the second magnification.

[0088] The technical solution of this invention addresses the issue that the target object initially captured by the target device cannot meet the requirements of subsequent analysis. Therefore, after determining the first horizontal dimension of the target object in the first captured image based on the target signal strength and the distance to the target object, the first magnification factor for capturing the target object is further accurately determined based on the first horizontal dimension. The target object is then captured using the first magnification factor to obtain a second captured image, thus achieving a more satisfactory result. If the proportion of the target object's size to the image size in the second captured image is still not satisfactory, a second horizontal dimension of the target object in the second captured image is determined based on the second horizontal dimension and the first magnification factor. The target object is then captured using the second magnification factor. This two-stage zooming process solves the problems of the target exceeding the frame due to excessive magnification or the target being too small due to excessive magnification. By ensuring the magnification factor is at an appropriate value, the target's proportion in the image is maintained, effectively solving the problem of the captured target being too small and thus failing to meet requirements, thereby improving the effectiveness of target detection.

[0089] Example 4

[0090] Figure 4aThis is a flowchart of an image processing method provided by an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of S110 in the above embodiments based on the above embodiments. This embodiment can be combined with various optional solutions in one or more of the above embodiments. Moreover, this embodiment is applicable to the case where the number of dots of the target object fed back by the radar meets the preset dot number condition, thereby determining the first horizontal dimension according to the method of determining the first horizontal dimension of the target object in the first captured image in this embodiment.

[0091] like Figure 4a As shown, the method includes:

[0092] S410. Determine the target detection angle corresponding to the target object in the target detection area, and determine the target object distance corresponding to the target object.

[0093] In this embodiment, the first lateral dimension is determined based on the number of dots on the target object detected by the radar. To determine whether the number of dots on the target object detected by the radar meets a preset dot-matrix number condition, one approach is to set a preset dot-matrix number. If the number of dots detected by the target object is greater than or equal to the preset dot-matrix number, then the number of dots detected by the radar on the target object meets the preset dot-matrix number condition. Another approach is to set a preset distance (the maximum distance from the target imaging device to the target object along the reference shooting direction). If the distance to the target object is less than or equal to the preset distance, then the number of dots detected by the radar on the target object meets the preset dot-matrix number condition. This is because for target objects of the same size, the number of dots detected and detected by the radar at the same angle is inversely proportional to the distance. Figure 4b As shown, if the above two aspects are satisfied, the method of determining the first horizontal dimension of the target object in the first shooting frame in this embodiment can be adopted.

[0094] The target detection angle range is determined by the scanning angle range when the radar detects the target object; the target object distance is determined based on the distance from the target imaging device to the target object along the reference imaging direction, and the reference imaging direction is determined based on the imaging direction of the target object.

[0095] Optionally, determine the target detection angle corresponding to the target object in the target detection region, including:

[0096] First, determine the target horizontal angular resolution β corresponding to the target object, and then determine the number of target dots N corresponding to the target object. Finally, based on the target horizontal angular resolution and the number of target dots, determine the target detection angle corresponding to the target object in the target detection area. That is, determine the minimum scanning angle range that can scan the target object based on the target horizontal angular resolution β. The minimum scanning angle range θ can be expressed as Nβ≤θ<(N+1)β. The minimum scanning angle range θ can be used as the target detection angle range γ, that is, Nβ≤γ<(N+1)β, thus obtaining the target detection angle.

[0097] Wherein, the target horizontal angular resolution is the horizontal angular resolution of the radar used to detect whether there is a target object in the target detection area, and the number of target dot arrays is the number of dot arrays corresponding to the point cloud used to describe the target object detected by the radar in the horizontal direction when detecting the target object.

[0098] S420. Based on the target detection angle and the distance to the target object, determine the first horizontal dimension of the target object in the first captured image.

[0099] Specifically, the target detection angle γ range is obtained. Based on the target detection angle γ range and the distance to the target object, the range of the first lateral dimension S1 can be determined, which can be expressed as:

[0100]

[0101] S430. Determine the first magnification factor to be used for photographing the target object based on the first horizontal dimension.

[0102] Specifically, obtain the range of the first horizontal dimension S1 and the expected horizontal dimension ratio R0, and take the upper limit of the first horizontal dimension S1. To prevent the target object from occupying too much space in the image, and to ensure that the first horizontal dimension of the target object occupies a size R greater than or equal to the desired horizontal dimension proportion in the first captured frame, let R = R0 and K2 = 1. Then the first magnification Z1 is expressed as follows:

[0103]

[0104] S440. Determine the second horizontal dimension of the target object in the second shooting frame. Based on the second horizontal dimension and the first magnification, determine the second magnification to be used to shoot the target object, and shoot the target object according to the second magnification.

[0105] The technical solution of this invention addresses the issue that the target object initially captured by the target device cannot meet the requirements of subsequent analysis. Therefore, after determining the first horizontal dimension of the target object in the first captured image based on the target detection angle and the distance to the target object, a first magnification factor is further determined based on the first horizontal dimension. The target object is then captured using this first magnification factor to obtain a second captured image, thus achieving a more satisfactory result. If the proportion of the target object's size to the image size in the second captured image is still not satisfactory, a second horizontal dimension of the target object in the second captured image is determined based on the second horizontal dimension and the first magnification factor. The target object is then captured using this second magnification factor. This two-stage zooming process solves the problem of the target exceeding the frame due to excessive magnification or the target being too small due to excessive magnification. By ensuring the magnification factor is at an appropriate value, the target's proportion in the image is maintained, effectively solving the problem of the captured target being too small and thus improving the effectiveness of target detection.

[0106] Example 5

[0107] Figure 5 This is a schematic diagram of an image processing device provided in an embodiment of the present invention. It is applicable when a moving target is detected by radar tracking a ship on the water surface. The moving target is uploaded to an imaging device (laser PTZ camera), which captures the target image. After image processing, a suitable capture magnification is obtained. This image processing device can be implemented in hardware and / or software and can be configured in any electronic device with network communication capabilities. Figure 5 As shown, the device includes:

[0108] The first size determination module 510 is used to determine the first horizontal size of the target object in the first shooting frame. The first shooting frame is the frame when the target object is detected in the target detection area and the target shooting device is linked to shoot the target object. The horizontal size is the size along the horizontal axis in the shooting frame.

[0109] The magnification determination module 520 is used to determine the first magnification used to photograph the target object based on the first lateral dimension.

[0110] The second size determination module 530 is used to determine the second horizontal size of the target object in the second shooting frame, wherein the second shooting frame is the image of the target object being shot by the target shooting device according to the first magnification.

[0111] The shooting module 540 is used to determine a second magnification for shooting the target object based on the second horizontal dimension and the first magnification, and to shoot the target object according to the second magnification.

[0112] Optionally, the first dimension determining module includes a first dimension determining unit, comprising:

[0113] A reference object size determination unit is used to determine the size of a reference object of a target object in a target detection region, wherein the reference object and the target object satisfy a preset similarity condition in at least some object attribute dimensions;

[0114] An information determination unit is used to determine the target object's movement trajectory, the target object's distance, and a reference shooting direction. The reference shooting direction is determined based on the shooting direction used to capture the target object, and the target object's distance is determined based on the distance from the target shooting device to the target object along the reference shooting direction.

[0115] The first reference size determination unit is used to determine the first horizontal size of the target object in the first shooting frame based on the size of the reference object, the movement trajectory of the target object, the distance of the target object and the reference shooting direction.

[0116] Optionally, a reference object size determination unit is used for:

[0117] Determine the target object attribute information of the target object in the target detection area. The target object attribute information includes the target object position, the target object detection time, the target object movement trajectory, and the target object movement speed.

[0118] The size of a reference object for the target object is determined from a preset object set based on the target object attribute information. The preset object set stores reference objects associated with different object attributes and the sizes of the reference objects in advance.

[0119] Optionally, the first reference dimension determining unit is used for:

[0120] Based on the size of the reference object, the movement trajectory of the target object, the distance of the target object and the reference shooting direction, determine the reference horizontal size in the first shooting frame when the target shooting device captures the reference object along the reference shooting direction;

[0121] The reference horizontal dimension is determined as the first horizontal dimension of the target object in the first captured image.

[0122] Optionally, the first dimension determining module includes a second dimension determining unit, used for:

[0123] Determine the target signal strength corresponding to the target object in the target detection area, wherein the target signal strength is the signal strength fed back by the target object when the target object is detected by radar;

[0124] The target object distance is determined based on the distance from the target shooting device to the target object along a reference shooting direction, which is based on the shooting direction in which the target object is photographed.

[0125] Based on the target signal strength and the distance to the target object, the first horizontal dimension of the target object in the first captured image is determined.

[0126] Optionally, the second dimension determining unit includes a second reference dimension determining unit, used for:

[0127] The target signal strength and the distance to the target object are input into a preset horizontal dimension calculation function, and the first horizontal dimension of the target object in the first captured image is output through the preset horizontal dimension function.

[0128] The preset lateral dimension calculation function is used to describe the relationship between signal strength, object distance and lateral dimension. Signal strength is directly proportional to lateral dimension and inversely proportional to the square of distance. The preset lateral dimension calculation function also includes a preset constant value, which is determined by the signal attenuation and scattering.

[0129] Optionally, the first dimension determining module includes a third dimension determining unit, used for:

[0130] The target detection angle corresponding to the target object in the target detection area is determined, and the target detection angle range is determined by the size of the scanning angle range when the target object is detected by radar;

[0131] Determine the target object distance corresponding to the target object. The target object distance is determined based on the distance from the target shooting device to the target object along the reference shooting direction, and the reference shooting direction is determined based on the shooting direction of shooting the target object.

[0132] Based on the target detection angle and the distance to the target object, the first horizontal dimension of the target object in the first captured image is determined.

[0133] Optionally, the third dimension determining unit includes an angle determining unit, used for:

[0134] Determine the target horizontal angular resolution corresponding to the target object, wherein the target horizontal angular resolution is the horizontal angular resolution of the radar used to detect whether a target object exists in the target detection area;

[0135] Determine the number of target points corresponding to the target object, wherein the number of target points is the number of points in the point cloud used to describe the target object detected by the radar in the horizontal direction when detecting the target object;

[0136] Based on the target horizontal angular resolution and the number of target dots, the target detection angle corresponding to the target object in the target detection area is determined.

[0137] Optional, a magnification determination module, used for:

[0138] Determine the desired horizontal size proportion of the target object in the first captured frame, and determine the horizontal size of the first captured frame;

[0139] Based on the desired horizontal size ratio, the horizontal size of the first captured image, and the first horizontal size, a first magnification factor is determined for capturing the target object.

[0140] Optional, a second dimension determining module, used for:

[0141] The target object in the second captured image is separated from the background in the second captured image, where the background in the second captured image is scenery that complements the target object;

[0142] Determine the horizontal dimension of the target object separated from the second captured image, and define it as the second horizontal dimension of the target object in the second captured image.

[0143] Optionally, the shooting module includes a magnification determination unit for:

[0144] Determine the desired horizontal size proportion of the target object in the second captured frame, and determine the horizontal size of the second captured frame;

[0145] If the current horizontal dimension ratio between the second horizontal dimension and the horizontal dimension of the second captured image does not meet the desired horizontal dimension ratio, then the second magnification ratio used to capture the target object is adjusted based on the current horizontal dimension ratio and the desired horizontal dimension ratio.

[0146] Optionally, the shooting module includes a zoom shooting unit for:

[0147] Determine the location of the target object within the target detection area;

[0148] Control the target shooting device to face the target object, and adjust the first magnification of the target shooting device to the second magnification when adjusting the target object position.

[0149] The image processing apparatus provided in the embodiments of the present invention can execute the image processing method provided in any of the above embodiments of the present invention, and has the corresponding functions and beneficial effects of executing the image processing method. For details, please refer to the relevant operations of the image processing method in the foregoing embodiments.

[0150] Example 6

[0151] Figure 6 A schematic diagram of an electronic device that can be used to implement the image processing method of embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0152] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0153] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0154] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as image processing methods.

[0155] In some embodiments, the image processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the image processing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the image processing method by any other suitable means (e.g., by means of firmware).

[0156] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0157] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0158] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on 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 fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0159] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0160] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0161] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0162] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0163] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. An image processing method, characterized in that, The method includes: Determine the first horizontal dimension of the target object in the first captured image, wherein the first captured image is the image captured by the target capturing device when the target object is detected in the target detection area, and the horizontal dimension is the dimension along the horizontal axis in the captured image; The first magnification factor used to photograph the target object is determined based on the first lateral dimension. Determine the second horizontal dimension of the target object in the second shooting frame, where the second shooting frame is the image captured by the target shooting device at the first magnification. Based on the second lateral dimension and the first magnification, determine the second magnification to be used for photographing the target object, and photograph the target object according to the second magnification. Determining the first horizontal dimension of the target object in the first captured frame includes: Determine the size of a reference object for the target object in the target detection region, wherein the reference object and the target object satisfy a preset similarity condition in at least some object attribute dimensions; The target object's movement trajectory, target object distance, and reference shooting direction are determined, wherein the reference shooting direction is determined based on the shooting direction of the target object, and the target object distance is determined based on the distance from the target shooting device to the target object along the reference shooting direction; Based on the reference object size, the target object's movement trajectory, the target object's distance, and the reference shooting direction, the first horizontal dimension of the target object in the first shooting frame is determined.

2. The method according to claim 1, characterized in that, Determine the first horizontal dimension of the target object in the first captured frame, including: Determine the target signal strength corresponding to the target object in the target detection area, wherein the target signal strength is the signal strength fed back by the target object when the target object is detected by radar; The target object distance is determined based on the distance from the target shooting device to the target object along a reference shooting direction, which is based on the shooting direction in which the target object is photographed. Based on the target signal strength and the distance to the target object, the first horizontal dimension of the target object in the first captured image is determined.

3. The method according to claim 2, characterized in that, Based on the target signal strength and the distance to the target object, the first lateral dimension of the target object in the first captured frame is determined, including: The target signal strength and the distance to the target object are input into a preset horizontal dimension calculation function, and the first horizontal dimension of the target object in the first captured image is output through the preset horizontal dimension calculation function. The preset lateral dimension calculation function is used to describe the relationship between signal strength, object distance and lateral dimension. Signal strength is directly proportional to lateral dimension and inversely proportional to the square of distance. The preset lateral dimension calculation function also includes a preset constant value, which is determined by the signal attenuation and scattering.

4. The method according to claim 1, characterized in that, Determining the first magnification for photographing the target object based on the first lateral dimension includes: Determine the desired horizontal size proportion of the target object in the first captured frame, and determine the horizontal size of the first captured frame; Based on the desired horizontal size ratio, the horizontal size of the first captured image, and the first horizontal size, a first magnification factor is determined for capturing the target object.

5. The method according to claim 1, characterized in that, Based on the second lateral dimension and the first magnification, the second magnification used for photographing the target object is determined, including: Determine the desired horizontal size proportion of the target object in the second captured frame, and determine the horizontal size of the second captured frame; If the current horizontal size ratio between the second horizontal size and the horizontal size of the second captured image does not meet the desired horizontal size ratio, then the second magnification ratio used to capture the target object is adjusted based on the current horizontal size ratio and the desired horizontal size ratio.

6. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the image processing method according to any one of claims 1-5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the image processing method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Monocular computer vision technology-based target object distance measurement method and system

    CN107305632A

  • Automatic zooming method and device, storage medium and electronic device

    CN116347221A