A target capture method and related device
By judging the displacement information and demarcation angle of candidate objects in the gun-ball linkage device, priority classification of targets is achieved, the capture probability of incomplete frontal targets is reduced, and resource utilization efficiency and capture accuracy are improved.
Patent Information
- Application Number
- CN202110605112.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-31
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-05-31
AI Technical Summary
In the prior art, gun-ball linkage devices are prone to capturing incomplete frontal targets during target capture, resulting in resource waste and low efficiency.
By determining whether the candidate object set contains the candidate object to be classified, its displacement information between the current time point and the historical time point is obtained, and it is classified into the corresponding priority category according to the displacement information and the preset front and side boundary angles, and finally the target is captured by the second image acquisition device.
It effectively reduces the probability of capturing incomplete frontal targets, improves resource utilization efficiency and target capture accuracy.
Smart Images

Figure CN113536901B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of intelligent technology, and specifically relates to a target capture method and related devices. Background Art
[0002] Gun-and-ball cameras are a popular product on the market today, primarily used for monitoring key areas, facial recognition in crowded areas, and key vehicle surveillance. Existing technologies typically prioritize targets based on motion information, for example, by movement toward the monitoring device, horizontally with the device, or away from the device. This classification method is likely to result in capturing many incomplete, frontal targets. Therefore, it is necessary to develop a target capture method to address this issue. Summary of the Invention
[0003] The main technical problem solved by this application is to provide a target capture method and related devices to effectively reduce the probability of capturing incomplete frontal targets.
[0004] In order to solve the above technical problems, a technical solution adopted in the present application is: providing a target capture method, including: judging whether a candidate object set contains a candidate object to be classified, wherein the candidate object set is obtained based on the image captured by the first image acquisition device; if so, obtaining the displacement information of the candidate object to be classified between the current time point and the historical time point, and classifying the candidate object to be classified into the corresponding priority category based on the displacement information and the preset front and side boundary angles; if not, determining the final target to be captured from the candidate objects in the priority category; and controlling the second image acquisition device to capture the target.
[0005] Among them, the step of obtaining the displacement information of the candidate object to be classified between the current time point and the historical time point includes: obtaining the first image and the second image acquired by the first image acquisition device at the current time point and the historical time point respectively, and the first image and the second image both contain the candidate object to be classified; in the same coordinate system, obtaining the first horizontal coordinate and the first vertical coordinate of the candidate object to be classified on the first image, and the second horizontal coordinate and the second vertical coordinate of the candidate object to be classified on the second image; using the difference between the first horizontal coordinate and the second horizontal coordinate as the horizontal displacement of the candidate object to be classified, and using the difference between the first vertical coordinate and the second vertical coordinate as the vertical displacement of the candidate object to be classified, wherein the horizontal displacement and the vertical displacement constitute the displacement information.
[0006] In which, the first image and the second image are rectangles, the origin of the coordinate system coincides with the upper left corner of the rectangle, the horizontal positive direction of the coordinate system coincides with the direction from the upper left corner to the upper right corner of the rectangle, and the vertical positive direction of the coordinate system coincides with the direction from the upper left corner to the lower left corner of the rectangle.
[0007] Wherein, the candidate object to be classified is a person, and the step of classifying the candidate object to be classified into the corresponding priority category according to the displacement information and the preset front-side dividing angle includes: judging whether the vertical displacement is less than 0; if so, discarding the candidate object to be classified; if not, obtaining the inverse tangent function value of the horizontal displacement and the vertical displacement; in response to the inverse tangent function value being greater than or equal to a first threshold and less than or equal to a second threshold, classifying the candidate object to be classified into the first priority category; in response to the inverse tangent function value being less than the first threshold or greater than the second threshold, classifying the candidate object to be classified into the second priority category; wherein, the first threshold and the second threshold represent the front-side dividing angle values when a person faces the first image acquisition device and moves to the left and to the right, respectively.
[0008] Wherein, the candidate object to be classified is a person, and the step of classifying the candidate object to be classified into the corresponding priority category according to the displacement information and the preset front-side dividing angle includes: judging whether the vertical displacement is less than 0; if so, classifying the candidate object to be classified into the first priority category; if not, obtaining the inverse tangent function value of the horizontal displacement and the vertical displacement; in response to the inverse tangent function value being greater than or equal to a first threshold and less than or equal to a second threshold, classifying the candidate object to be classified into the third priority category; in response to the inverse tangent function value being less than the first threshold or greater than the second threshold, classifying the candidate object to be classified into the second priority category; wherein, the first threshold and the second threshold represent the front-side dividing angle values when a person faces the first image acquisition device and moves to the left and to the right, respectively.
[0009] Wherein, the candidate object to be classified is a vehicle, and the step of classifying the candidate object to be classified into the corresponding priority category according to the displacement information and the preset front and side boundary angles includes: determining whether the vertical displacement is less than 0; if so, obtaining the inverse tangent function value of the horizontal displacement and the vertical displacement; in response to the inverse tangent function value being greater than or equal to a first threshold and less than or equal to a second threshold, classifying the candidate object to be classified into the first priority category; in response to the inverse tangent function value being less than the first threshold or greater than the second threshold, classifying the candidate object to be classified into the third priority category; wherein, the first threshold and the second threshold Respectively represent the front and side boundary angle values of the rear end of the vehicle when it moves to the left and right relative to the first image acquisition device; if not, obtain the inverse tangent function value of the horizontal displacement and the vertical displacement; in response to the inverse tangent function value being greater than or equal to the third threshold and less than or equal to the fourth threshold, classify the candidate object to be classified into the second priority category; in response to the inverse tangent function value being less than the third threshold or greater than the fourth threshold, classify the candidate object to be classified into the third priority category; wherein, the third threshold and the fourth threshold respectively represent the front and side boundary angle values of the front end of the vehicle when it moves to the left and right relative to the first image acquisition device.
[0010] Among them, the step of determining the final target to be captured from the candidate objects of the priority category includes: judging whether the candidate objects of the current priority category contain at least one object to be captured; if so, taking the object closest to the edge of the field of view of the first image acquisition device at the current time point as the final target to be captured; otherwise, in order of priority from high to low, taking the next priority category as the current priority category, and returning to the step of judging whether the candidate objects of the current priority category contain at least one object to be captured.
[0011] Among them, before the step of taking the object closest to the edge of the field of view of the first image acquisition device at the current time point as the final target to be captured, it also includes: in response to the at least one object including an object that has been captured by the second image acquisition device; removing the object.
[0012] Among them, before the step of determining whether the candidate object set contains the candidate object to be classified, it includes: determining whether the second image acquisition device is currently in an idle state; if so, entering the step of determining whether the candidate object set contains the candidate object to be classified.
[0013] To solve the above technical problems, another technical solution adopted in this application is: to provide a target capture device, comprising a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the target capture method described in any of the above embodiments.
[0014] In order to solve the above technical problems, another technical solution adopted in this application is: providing a device with a storage function, storing program data, which can be read by a computer, and the program data can be executed by a processor to implement the target capture method described in any of the above embodiments.
[0015] The beneficial effects of the present application are as follows: in the present application, it is determined whether a candidate object set contains a candidate object to be classified, wherein the candidate object set is obtained based on images captured by a first image acquisition device; if so, the displacement information of the candidate object to be classified between the current time point and the historical time point is obtained, and the candidate object to be classified is classified into a corresponding priority category based on the displacement information and the preset front and side dividing angles; if not, the final target to be captured is determined from the candidate objects in the priority category; and the second image acquisition device is controlled to capture the target. In the above design scheme, the front and side dividing angles are introduced when performing priority classification, thereby effectively reducing the probability of capturing an incomplete front target. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. Those skilled in the art can also derive other drawings based on these drawings without inventive work, among which:
[0017] Figure 1 This is a flow chart of an embodiment of the target capture method of the present application;
[0018] Figure 2 yes Figure 1 A schematic flow chart of an embodiment of step S2;
[0019] Figure 3 This is a schematic diagram of the face acquisition target selection strategy;
[0020] Figure 4 yes Figure 1 A schematic flow chart of an implementation method of step S3 in FIG.
[0021] Figure 5 yes Figure 1 A schematic flow chart of an implementation method of step S4 in FIG.
[0022] Figure 6yes Figure 5 Flow chart of an embodiment of the step before step S40;
[0023] Figure 7 yes Figure 1 A schematic flow chart of another embodiment of step S3;
[0024] Figure 8 It is a schematic diagram of the vehicle acquisition target selection strategy;
[0025] Figure 9 yes Figure 1 A schematic flow chart of another embodiment of step S3;
[0026] Figure 10 yes Figure 1 FIG. 1 is a flow chart of an embodiment of the step 1 before step S1;
[0027] Figure 11 This is a schematic diagram of a framework of an embodiment of the target capture device of the present application;
[0028] Figure 12 This is a schematic structural diagram of an embodiment of the target capture device of the present application;
[0029] Figure 13 It is a structural diagram of an embodiment of a device with storage function of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0031] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the target capture method of the present application. The target capture method includes:
[0032] S1: Determine whether the candidate object set contains the candidate object to be classified.
[0033] Specifically, in this embodiment, the candidate object set is obtained based on images captured by the first image acquisition device. All targets captured by the first image acquisition device are included in the candidate object set. In this embodiment, the first image acquisition device may be a gun-and-ball linkage device, and the targets may be people, vehicles (e.g., non-motorized vehicles), etc., without limitation.
[0034] S2: If yes, obtain the displacement information of the candidate object to be classified between the current time point and the historical time point.
[0035] Specifically, see Figure 2 , Figure 2 yes Figure 1 Schematic diagram of a flow chart of an embodiment of step S2. The above step S2 specifically includes:
[0036] S20: Obtaining a first image and a second image acquired by a first image acquisition device at a current time point and a historical time point respectively, wherein both the first image and the second image contain candidate objects to be classified.
[0037] Please refer to the following for details: Figure 3 , Figure 3 It is a schematic diagram of the face acquisition target selection strategy. Figure 3 The first image and the second image are integrated into the same preview screen for convenience of explanation. A(t0), B(t0), C(t0), and D(t0) are the positions of A, B, C, and D on the first image captured by the first image acquisition device at the historical time point t0, and A(t1), B(t1), C(t1), and D(t1) are the positions of A, B, C, and D on the second image captured by the first image acquisition device at the current time point t1, so as to obtain the displacement information of the candidate objects to be classified between the current time point t1 and the historical time point t0. The interval between the current time point t1 and the historical time point t0 can be set according to actual conditions. The smaller the interval, the higher the accuracy.
[0038] S21: In the same coordinate system, obtaining a first horizontal coordinate and a first vertical coordinate of the candidate object to be classified on the first image, and a second horizontal coordinate and a second vertical coordinate of the candidate object to be classified on the second image.
[0039] Specifically, in this embodiment, Figure 3 As shown, in the same coordinate system, the first horizontal coordinates and the first vertical coordinates of the candidate objects to be classified A, B, C, and D on the first image, as well as the second horizontal coordinates and the second vertical coordinates of the candidate objects to be classified A, B, C, and D on the second image are obtained respectively for subsequent processing.
[0040] S22: taking the difference between the first horizontal coordinate and the second horizontal coordinate as the horizontal displacement of the candidate object to be classified, and taking the difference between the first vertical coordinate and the second vertical coordinate as the vertical displacement of the candidate object to be classified, wherein the horizontal displacement and the vertical displacement constitute displacement information.
[0041] For more details, please refer to Figure 3 , since the candidate object A to be classified only moves in the vertical direction, the candidate object A to be classified has no horizontal displacement, and its vertical displacement S v is the difference between the first vertical coordinate of the candidate object A to be classified and the second vertical coordinate of A. The horizontal displacement S of the candidate object B to be classified h is the difference between the first horizontal coordinate and the second horizontal coordinate, and its vertical displacement S v is the difference between the first vertical coordinate of the candidate object to be classified B and the second vertical coordinate of the candidate object to be classified B, and the horizontal displacement and vertical displacement of the candidate object to be classified C and the candidate object to be classified D are obtained by analogy. In this embodiment, the horizontal displacement and the vertical displacement constitute the displacement information. h There are both positive and negative values, and their absolute values do not need to be used in the calculation process. Through the above method, the displacement information of the candidate object to be classified can be accurately obtained.
[0042] In one embodiment, see Figure 3 , the first image and the second image are rectangles, the origin of the coordinate system coincides with the upper left corner of the rectangle, the horizontal positive direction of the coordinate system coincides with the direction from the upper left corner to the upper right corner of the rectangle, and the vertical positive direction of the coordinate system coincides with the direction from the upper left corner to the lower left corner of the rectangle. Of course, in other embodiments, the above-mentioned coordinate system can also be set in other ways, for example, the origin of the coordinate system coincides with the upper right corner of the rectangle, the horizontal positive direction of the coordinate system coincides with the direction from the upper right corner to the upper left corner of the rectangle, and the vertical positive direction of the coordinate system coincides with the direction from the upper right corner to the lower right corner of the rectangle. This application does not limit this.
[0043] S3: Classify the candidate objects to be classified into corresponding priority categories according to the displacement information and the preset front and side boundary angles.
[0044] Specifically, in order to effectively distinguish the front and side views, this application introduces the front and side boundary angles at the lower left and right corners of the image acquisition device. The front and side boundary angles represent the critical value from the front to the side. When performing face acquisition, the candidate object to be classified is a person. Specifically, when the coordinate system is established as follows Figure 3 When shown in Figure 4 , Figure 4 yes Figure 1 Schematic diagram of a flow chart of an embodiment of step S3. The above step S3 specifically includes:
[0045] S30: Determine whether the vertical displacement is less than 0.
[0046] S31: If yes, discard the candidate object to be classified;
[0047] Specifically, if the vertical displacement of the candidate object to be classified is less than 0, it means that the candidate object to be classified is moving away from the first image acquisition device, and the candidate object to be classified is a back view, so it is discarded. Figure 3 As shown, the vertical displacement of the candidate object A to be classified is less than 0, which means that the candidate object A to be classified is moving away from the first image acquisition device and the candidate object A to be classified is a back view. The candidate object A to be classified is discarded to prevent waste of resources.
[0048] S32: If not, obtain the inverse tangent function value of the horizontal displacement and the vertical displacement.
[0049] Specifically, if the vertical displacement of the candidate object to be classified is greater than or equal to 0, the inverse tangent function of the horizontal displacement and the vertical displacement of the candidate object to be classified is obtained, wherein the formula of the inverse tangent function is: like Figure 3 As shown, the vertical displacements of the candidate objects to be classified B, C, and D are greater than or equal to 0, and the arc tangent function of the candidate object to be classified A is obtained to perform the following steps.
[0050] S33: Determine the magnitude relationship between the inverse tangent function value and the first threshold value and the second threshold value.
[0051] Specifically, the first threshold and the second threshold represent the frontal face and side face dividing angle values when the person faces the first image acquisition device and moves to the left and right, respectively, and are θ l and θ r , where θ l is a negative value, θ r is a positive value. l and θ r The positive and negative Figure 3 For example, when the origin of the coordinate system coincides with the upper right corner of the rectangle, the horizontal positive direction of the coordinate system coincides with the direction from the upper right corner to the upper left corner of the rectangle, and the vertical positive direction of the coordinate system coincides with the direction from the upper right corner to the lower right corner of the rectangle, θ l is a positive value, θ r It is a negative value and is not limited here.
[0052] S34: If the inverse tangent function value is greater than or equal to the first threshold and less than or equal to the second threshold, classify the candidate object to be classified into the first priority category.
[0053] Specifically, if θ l ≤θ≤θ r , indicating that the face of the candidate object to be classified is facing the first image acquisition device, the candidate object to be classified is classified into the first priority category. Specifically, if Figure 3 As shown, the first threshold θ land the second threshold θ r The inverse tangent function of candidate object B is greater than 45°, so candidate object B is classified into the first priority category. In this way, candidate objects facing the first image acquisition device can be accurately classified into the corresponding priority category.
[0054] S35: If the inverse tangent function value is less than the first threshold or greater than the second threshold, the candidate object to be classified is classified into the second priority category.
[0055] Specifically, if θ≤θ l Or θ>θ r , indicating that the side face of the candidate object to be classified is facing the first image acquisition device, the candidate object to be classified is classified into the first priority category. Specifically, if Figure 3 As shown, the inverse tangent functions of candidate objects C and D are both less than 45°, so candidate objects C and D are classified into the second priority category. In this way, candidate objects with their profiles facing the first image acquisition device can be accurately classified into the corresponding priority category.
[0056] S4: If not, determine the final target to be captured from the candidate objects of the priority category.
[0057] Specifically, if the candidate object set does not contain the candidate object to be classified, the final target to be captured is determined from the candidate objects of the priority category.
[0058] Specifically, in this embodiment, see Figure 5 , Figure 5 yes Figure 1 Schematic diagram of a flow chart of an embodiment of step S4. The above step S4 specifically includes:
[0059] S40: Determine whether the candidate objects of the current priority category include at least one object to be captured.
[0060] In one embodiment, see Figure 6 , Figure 6 yes Figure 5 Schematic diagram of a flow chart of an embodiment of the steps before step S40. The steps before step S40 specifically include:
[0061] S400: Determine whether the at least one object includes an object that has been captured by a second image acquisition device.
[0062] S401: If yes, remove the above object.
[0063] Specifically, before determining whether the candidate objects of the current priority category include at least one object to be captured, that is, after classifying the candidate objects to be classified into the corresponding priority category, it is determined whether the at least one object includes an object that has already been captured by the second image acquisition device. If so, the object is removed. Of course, in other embodiments, the above step S400 can also be performed after step S4, that is, after determining that there is a final target to be captured among the candidate objects of the current priority category. If the final target to be captured is an object that has already been captured by the second image acquisition device, the object is removed. This application does not limit this. Through the above design scheme, it is possible to avoid the waste of resources caused by repeated capture.
[0064] In addition, after a target to be captured is captured, since the target to be captured is in a real-time motion process, the above process needs to be repeated to re-screen the final target to be captured.
[0065] S402: Otherwise, go to step S5.
[0066] If the at least one object does not include an object that has been captured by the second image acquisition device, the process directly proceeds to step S5 to control the second image acquisition device to capture a target.
[0067] S41: If yes, the object closest to the edge of the field of view of the first image acquisition device at the current time point is taken as the final target to be captured.
[0068] Specifically, if the candidate objects of the current priority category include at least one object to be captured, the object closest to the edge of the field of view of the first image acquisition device at the current time point is taken as the final target to be captured. Figure 3 As shown, the above steps determine that there are candidate objects C and D to be classified in the first priority category, and the distance l4 between candidate object D to be classified and the edge of the rectangle is less than the distance l3 between candidate object C to be classified and the edge of the rectangle, indicating that candidate object D to be classified is closest to the edge of the field of view of the first image acquisition device at the current time point t1, indicating that candidate object D to be classified is about to leave the field of view of the first image acquisition device, so candidate object D to be classified is determined as the final target to be captured, and candidate object C to be classified is not captured this time, and is used as a candidate object for the next round of target selection.
[0069] S42: Otherwise, in descending order of priority, the next priority category is taken as the current priority category, and the process returns to step S40.
[0070] Specifically, if the candidate objects of the current priority category do not include at least one object to be captured, if the priority order is from high to low, the next priority category will be used as the current priority category, and the process will return to the step of determining whether the candidate objects of the current priority category include at least one object to be captured, so as to prevent wasting resources.
[0071] When gait collection is performed, the candidate object to be classified is a person. Specifically, when the coordinate system is established as Figure 3 When shown in Figure 7 , Figure 7 yes Figure 1 Schematic diagram of another embodiment of step S3. The above step S3 specifically includes:
[0072] S50: Determine whether the vertical displacement is less than 0.
[0073] S51: If yes, classify the candidate object to be classified into the first priority category.
[0074] Specifically, if the vertical displacement of the candidate object to be classified is less than 0, it means that the candidate object to be classified is moving away from the first image acquisition device, and the candidate object to be classified A is a back view, and the candidate object to be classified is classified into the first priority category. Figure 3 As shown, the vertical displacement of the candidate object A to be classified is less than 0, which means that the candidate object A to be classified is moving away from the first image acquisition device, and the candidate object A to be classified is a back view, and the candidate object A to be classified is classified into the first priority category.
[0075] S52: If not, obtain the inverse tangent function value of the horizontal displacement and the vertical displacement.
[0076] Specifically, if the vertical displacement of the candidate object to be classified is greater than or equal to 0, the inverse tangent function of the horizontal displacement and the vertical displacement of the candidate object to be classified is obtained, wherein the formula of the inverse tangent function is: like Figure 3 As shown, the vertical displacements of the candidate objects to be classified B, C, and D are greater than or equal to 0, and the arc tangent function of the candidate object to be classified A is obtained to perform the following steps.
[0077] S53: Determine the magnitude relationship between the inverse tangent function value and the first threshold value and the second threshold value.
[0078] Specifically, the first threshold and the second threshold represent the frontal face and side face dividing angle values when the person faces the first image acquisition device and moves to the left and right, respectively, and are θ l and θ r , where θ l is a negative value, θ r is a positive value.l and θ r The positive and negative Figure 3 For example, when the origin of the coordinate system coincides with the upper right corner of the rectangle, the horizontal positive direction of the coordinate system coincides with the direction from the upper right corner to the upper left corner of the rectangle, and the vertical positive direction of the coordinate system coincides with the direction from the upper right corner to the lower right corner of the rectangle, θ l is a positive value, θ r It is a negative value and is not limited here.
[0079] S54: If the inverse tangent function value is greater than or equal to the first threshold and less than or equal to the second threshold, classify the candidate object to be classified into the third priority category.
[0080] Specifically, if θ l ≤θ≤θ r , indicating that the face of the candidate object to be classified is facing the first image acquisition device, the candidate object to be classified is classified into the third priority category. Specifically, if Figure 3 As shown, the first threshold θ l and the second threshold θ r The inverse tangent functions of candidate objects C and D are both less than 45°, so candidate objects C and D are classified into the third priority category. In this way, candidate objects facing the first image acquisition device can be accurately classified into the corresponding priority category.
[0081] S55: If the inverse tangent function value is less than the first threshold or greater than the second threshold, the candidate object to be classified is classified into the second priority category.
[0082] Specifically, if θ≤θ l Or θ>θ r , indicating that the side face of the candidate object to be classified is facing the first image acquisition device, the candidate object to be classified is classified into the second priority category. Specifically, if Figure 3 As shown, the arc tangent function of the candidate object B is greater than 45°, so the candidate object B is classified into the second priority category. In this way, the candidate object with its side face facing the first image acquisition device can be accurately classified into the corresponding priority category.
[0083] Specifically, in this embodiment, after step S55 , the process proceeds to step S4 to ensure that all candidate objects in the candidate object set are classified into corresponding priority categories.
[0084] In this example, please continue to refer to Figure 3, it is determined from the above steps that there is only candidate object A in the first priority category, and the distance l1 between candidate object A and the edge of the rectangle is the smallest, indicating that it is closest to the edge of the field of view of the first image acquisition device at the current time point t1, indicating that candidate object A is about to leave the field of view of the first image acquisition device, so candidate object A is determined to be the final target to be captured.
[0085] See also Figure 8 , Figure 8 It is a schematic diagram of the vehicle collection target selection strategy. Figure 8 and Figure 3 The difference is that Figure 3 The person in the figure is replaced by a vehicle, in which the determination of displacement information and the setting of coordinate system are all the same as Figure 3 The same, no longer repeated here.
[0086] When collecting vehicles, the candidate objects to be classified are vehicles. Specifically, when the coordinate system is established as follows Figure 8 When shown in Figure 9 , Figure 9 yes Figure 1 Schematic diagram of another embodiment of step S3. The above step S3 specifically includes:
[0087] S60: Determine whether the vertical displacement is less than 0.
[0088] S61: If yes, obtain the inverse tangent function value of the horizontal displacement and the vertical displacement.
[0089] Specifically, if the vertical displacement of the candidate object to be classified is less than 0, it indicates that the candidate object to be classified is moving away from the first image acquisition device and the candidate object to be classified is a back view. The inverse tangent function of the horizontal displacement and the vertical displacement of the candidate object to be classified is obtained, wherein the formula of the inverse tangent function is:
[0090] Please refer to the following for details: Figure 8 , the vertical displacement of the candidate object A to be classified is less than 0, indicating that the candidate object A to be classified is far away from the first image acquisition device and is a back view of the candidate object A to be classified. The inverse tangent function of the candidate object A to be classified is obtained to perform the following steps.
[0091] S62: Determine the magnitude relationship between the inverse tangent function value and the first threshold value and the second threshold value.
[0092] Specifically, the first threshold and the second threshold represent the front and side boundary angle values when the rear end of the vehicle moves to the left and right relative to the first image acquisition device, respectively, and are θ ul and θ ur , where θ ul is a negative value, θ uris a positive value. ul and θ ur The positive and negative Figure 8 For example, when the origin of the coordinate system coincides with the upper right corner of the rectangle, the horizontal positive direction of the coordinate system coincides with the direction from the upper right corner to the upper left corner of the rectangle, and the vertical positive direction of the coordinate system coincides with the direction from the upper right corner to the lower right corner of the rectangle, θ ul is a positive value, θ ur It is a negative value and is not limited here.
[0093] S63: If the inverse tangent function value is greater than or equal to the first threshold and less than or equal to the second threshold, classify the candidate object to be classified into the first priority category.
[0094] Specifically, if θ ul ≤θ≤θ ur , indicating that the front of the rear end of the candidate object to be classified faces the first image acquisition device, then the candidate object to be classified is classified into the first priority category. Specifically, if Figure 8 As shown, the first threshold θ ul and the second threshold θ ur The angles of the angles are both 45°, the arc tangent function of candidate object A is equal to 0°, and at the current time point t1, it is closest to the edge of the field of view of the first image acquisition device, indicating that candidate object A is about to leave the field of view of the first image acquisition device. Therefore, candidate object A is classified into the first priority category. This method can accurately classify the rear end of the candidate object facing the first image acquisition device into the corresponding priority category.
[0095] S64: If the inverse tangent function value is less than the first threshold or greater than the second threshold, the candidate object to be classified is classified into the third priority category.
[0096] Specifically, if θ≤θ ul Or θ>θ ur , indicating that the side of the rear end of the candidate object to be classified is facing the first image acquisition device, then the candidate object to be classified is classified into the third priority category. Figure 8 As shown, the only candidate object with a vertical displacement less than 0 is candidate A, which has already been classified into the first priority category, so no other objects are classified into the third priority category. This method accurately classifies the side of the rear of the candidate object facing the first image acquisition device into the corresponding priority category.
[0097] S65: If not, obtain the inverse tangent function value of the horizontal displacement and the vertical displacement.
[0098] Specifically, if the vertical displacement of the candidate object to be classified is greater than or equal to 0, the inverse tangent function of the horizontal displacement and the vertical displacement of the candidate object to be classified is obtained, wherein the formula of the inverse tangent function is: like Figure 8 As shown, the inverse tangent functions of candidate objects B, C, and D to be classified whose vertical displacements are greater than or equal to 0 are obtained respectively.
[0099] S66: Determine the magnitude relationship between the inverse tangent function value and the third threshold value and the fourth threshold value.
[0100] Specifically, the third threshold and the fourth threshold represent the front and side boundary angle values when the front of the vehicle moves to the left and right relative to the first image acquisition device, respectively, and are θ dl and θ dr , where θ dl is a negative value, θ dr Of course, in other embodiments, θ dl It can also be a positive value, θ dr It can also be a negative value, given by Figure 8 For example, when the origin of the coordinate system coincides with the upper right corner of the rectangle, the horizontal positive direction of the coordinate system coincides with the direction from the upper right corner to the upper left corner of the rectangle, and the vertical positive direction of the coordinate system coincides with the direction from the upper right corner to the lower right corner of the rectangle, θ dl is a positive value, θ dr It is a negative value and is not limited here.
[0101] S67: If the inverse tangent function value is greater than or equal to the third threshold and less than or equal to the fourth threshold, classify the candidate object to be classified into the second priority category.
[0102] Specifically, if θ dl ≤θ≤θ dr , indicating that the front of the candidate object to be classified faces the first image acquisition device, then the candidate object to be classified is classified into the second priority category. Specifically, if Figure 8 As shown, the inverse tangent functions of the candidate objects to be classified C and D are both less than 45°, so the candidate objects to be classified C and D are classified into the second priority category to accurately classify the front of the candidate objects to be classified facing the first image acquisition device into the corresponding priority category.
[0103] S68: If the inverse tangent function value is less than the third threshold or greater than the fourth threshold, the candidate object to be classified is classified into the third priority category.
[0104] Specifically, if θ≤θ dl Or θ>θ dr, indicating that the side of the front of the candidate object to be classified is facing the first image acquisition device, then the candidate object to be classified is classified into the third priority category. Specifically, if Figure 8 As shown, the third threshold θ dl and the fourth threshold θ dr The arc tangent function of the candidate object B is greater than 45°, so the candidate object B is classified into the third priority category, so as to accurately classify the side of the front of the candidate object facing the first image acquisition device into the corresponding priority category.
[0105] Specifically, in this embodiment, after step S68 , the process proceeds to step S4 to ensure that all candidate objects in the candidate object set are classified into corresponding priority categories.
[0106] In this example, please continue to refer to Figure 8 , it is determined from the above steps that there is only candidate object A to be classified in the first priority category, and the distance l1 between candidate object A to be classified and the edge of the rectangle is the smallest, indicating that it is closest to the edge of the field of view of the first image acquisition device at the current time point t1, so candidate object A to be classified is determined as the final target to be captured.
[0107] Specifically, in this embodiment, the priority of the rear of the vehicle is set higher than the priority of the front of the vehicle. Of course, in other embodiments, the priority of the front of the vehicle can be set higher than the priority of the rear of the vehicle, or the priority of the front and rear of the vehicle can be set to the same, and this application is not limited to this.
[0108] Specifically, the ID of the candidate object to be classified is set in the first priority category, and the final target to be captured is searched by the ID. Of course, other configurations of the candidate object to be classified in the first priority category can also be used to search for the final target to be captured. As long as a matching target can be accurately found in the first priority category for target capture, this is not limited here.
[0109] S5: Control the second image acquisition device to capture the target.
[0110] Specifically, after the final target to be captured is determined in step S4, step S5 is entered to control the second image acquisition device to capture the target. The second image acquisition device can be a gun-ball linkage device, etc., which is not limited here.
[0111] In another embodiment, see Figure 10 , Figure 10 yes Figure 1 Schematic diagram of a flow chart of an embodiment of the steps before step S1. The steps before step S1 specifically include:
[0112] S100: Determine whether the second image acquisition device is currently in an idle state.
[0113] S101: If yes, go to step S1.
[0114] Specifically, if the second image acquisition device is currently in an idle state, the step of determining whether the candidate object set contains the candidate object to be classified is entered.
[0115] S102: Otherwise, end.
[0116] Specifically, if the second image acquisition device is not currently in an idle state, that is, it is still executing the previous step, the process is terminated and no target is selected.
[0117] See also Figure 11 , Figure 11 The schematic diagram of the framework of one embodiment of the target capture device of the present application is shown. The target capture device includes a judgment module 100, an acquisition module 102, a processing module 104, and a capture module 106. The judgment module 100 is used to determine whether a candidate object to be classified is included in a candidate object set, wherein the candidate object set is obtained based on images captured by a first image acquisition device. The acquisition module 102 is used to obtain displacement information of the candidate object to be classified between a current time point and a historical time point if the candidate object to be classified is included in the candidate object set. The processing module 104 is used to classify the candidate object to be classified into a corresponding priority category based on the displacement information and a preset front-side demarcation angle. If the candidate object set does not include the candidate object to be classified, the processing module 104 is used to determine the final target to be captured from the candidate objects in the priority category. The capture module 106 is used to control the second image acquisition device to capture the target. Through the above design scheme, the front-side demarcation angle is introduced during priority classification, thereby effectively reducing the probability of capturing an incomplete front-facing target and solving the problem of one-sidedness in target priority classification.
[0118] See also Figure 12 , Figure 12 1 is a schematic diagram of a target capture device according to an embodiment of the present invention. The device comprises a memory 200 and a processor 202 coupled to each other. The memory 200 stores program instructions, and the processor 202 is configured to execute the program instructions to implement the target capture method described in any of the above embodiments.
[0119] Specifically, the processor 202 may also be referred to as a CPU (Central Processing Unit). The processor 202 may be an integrated circuit chip having signal processing capabilities. The processor 202 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. A general-purpose processor may be a microprocessor or any conventional processor. In addition, the processor 202 may be implemented by multiple integrated circuit chips.
[0120] See also Figure 13 , Figure 13 : This is a schematic diagram of a framework of an embodiment of a device with a storage function of the present application. The device 30 stores program data 300, which can be read by a computer, and the program data 300 can be executed by a processor to implement the target capture method mentioned in any of the above embodiments. Among them, the program instructions 300 can be stored in the above-mentioned device 30 with a storage function in the form of a software product, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned device with a storage function includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.
[0121] In summary, this application introduces the front-side dividing angle when performing priority classification, which can effectively reduce the probability of capturing incomplete frontal targets and solve the problem of one-sidedness in the classification of target priorities.
[0122] The above description is merely an embodiment of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A target capture method, characterized in that: include: Determining whether a candidate object set includes a candidate object to be classified, wherein the candidate object set is obtained based on an image captured by a first image capture device; If yes, obtaining the displacement information of the candidate object to be classified between the current time point and the historical time point, wherein the displacement information includes horizontal displacement and vertical displacement; calculating an inverse tangent function value of the horizontal displacement and the vertical displacement to obtain a direction angle of the candidate object to be classified relative to the first image acquisition device; Classifying the candidate object to be classified into a corresponding priority category according to the displacement information, the orientation angle, and a preset front-side dividing angle, wherein the front-side dividing angle represents a critical value from the front to the side; If not, determining the final target to be captured from the candidate objects of the priority category; controlling the second image acquisition device to capture the target; The classifying of the candidate objects to be classified into corresponding priority categories according to the displacement information, the orientation angle, and the preset front-side boundary angle includes: Determine whether the vertical displacement is less than 0; If not, obtain the inverse tangent function value of the horizontal displacement and the vertical displacement; based on whether the inverse tangent function value is within the target value range, classify the candidate object to be classified into different priority categories; wherein, when the candidate object to be classified is a person, the target value range is greater than or equal to a first threshold and less than or equal to a second threshold, and the first threshold and the second threshold represent the front face and side face dividing angle values when the person faces the first image acquisition device and moves to the left and to the right, respectively; and / or, when the candidate object to be classified is a vehicle, the target value range is greater than or equal to a third threshold and less than or equal to a fourth threshold, and the third threshold and the fourth threshold represent the front face and side face dividing angle values when the front of the vehicle moves to the left and to the right relative to the first image acquisition device, respectively.
2. The target capture method according to claim 1, characterized in that: The step of obtaining the displacement information of the candidate object to be classified between the current time point and the historical time point includes: Obtaining a first image and a second image acquired by the first image acquisition device at the current time point and the historical time point, respectively, and both the first image and the second image contain the candidate object to be classified; In the same coordinate system, obtaining a first horizontal coordinate and a first vertical coordinate of the candidate object to be classified on the first image, and a second horizontal coordinate and a second vertical coordinate of the candidate object to be classified on the second image; The difference between the first horizontal coordinate and the second horizontal coordinate is used as the horizontal displacement of the candidate object to be classified, and the difference between the first vertical coordinate and the second vertical coordinate is used as the vertical displacement of the candidate object to be classified.
3. The target capture method according to claim 2, characterized in that: The first image and the second image are rectangles, the origin of the coordinate system coincides with the upper left corner of the rectangle, the horizontal positive direction of the coordinate system coincides with the direction from the upper left corner to the upper right corner of the rectangle, and the vertical positive direction of the coordinate system coincides with the direction from the upper left corner to the lower left corner of the rectangle.
4. The target capture method according to claim 3, characterized in that: The candidate object to be classified is a person, and after determining whether the vertical displacement is less than 0, the method further includes: If so, the candidate object to be classified is discarded; The classifying the candidate objects to be classified into different priority categories based on whether the inverse tangent function value is within a target value range includes: In response to the inverse tangent function value being greater than or equal to a first threshold and less than or equal to a second threshold, the candidate object to be classified is classified into a first priority category; in response to the inverse tangent function value being less than the first threshold or greater than the second threshold, the candidate object to be classified is classified into a second priority category.
5. The target capture method according to claim 3, characterized in that: The candidate object to be classified is a person, and after determining whether the vertical displacement is less than 0, the method further includes: If so, classify the candidate object to be classified into the first priority category; The classifying the candidate objects to be classified into different priority categories based on whether the inverse tangent function value is within a target value range includes: In response to the inverse tangent function value being greater than or equal to the first threshold and less than or equal to the second threshold, the candidate object to be classified is classified into the third priority category; in response to the inverse tangent function value being less than the first threshold or greater than the second threshold, the candidate object to be classified is classified into the second priority category.
6. The target capture method according to claim 3, characterized in that: The candidate object to be classified is a vehicle, and after determining whether the vertical displacement is less than 0, the method further includes: If so, obtaining an inverse tangent function value of the horizontal displacement and the vertical displacement; in response to the inverse tangent function value being greater than or equal to a first threshold and less than or equal to a second threshold, classifying the candidate object to be classified into a first priority category; in response to the inverse tangent function value being less than the first threshold or greater than the second threshold, classifying the candidate object to be classified into a third priority category; wherein the first threshold and the second threshold represent front-side boundary angle values when the rear end of the vehicle moves to the left and right relative to the first image acquisition device, respectively; The classifying the candidate objects to be classified into different priority categories based on whether the inverse tangent function value is within a target value range includes: In response to the inverse tangent function value being greater than or equal to the third threshold and less than or equal to the fourth threshold, the candidate object to be classified is classified into the second priority category; in response to the inverse tangent function value being less than the third threshold or greater than the fourth threshold, the candidate object to be classified is classified into the third priority category.
7. The target capture method according to claim 1, characterized in that: The step of determining the final target to be captured from the candidate objects of the priority category includes: Determining whether the candidate objects of the current priority category include at least one object to be captured; If so, the object closest to the edge of the field of view of the first image acquisition device at the current time point will be used as the final target to be captured; otherwise, in order of priority from high to low, the next priority category will be used as the current priority category, and the process will return to the step of determining whether the candidate objects of the current priority category contain at least one object to be captured.
8. The target capture method according to claim 7, characterized in that: Before the step of selecting the object closest to the edge of the field of view of the first image acquisition device at the current time as the final target to be captured, the method further includes: In response to the at least one object including an object that has been captured by the second image acquisition device; Remove the object.
9. The target capture method according to claim 1, characterized in that: Before the step of determining whether the candidate object set contains the candidate object to be classified, the following steps are included: Determining whether the second image acquisition device is currently in an idle state; If so, the step proceeds to determine whether the candidate object set contains the candidate object to be classified.
10. A target capture device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the target capture method according to any one of claims 1 to 9.
11. A device with a storage function, characterized in that: Program data is stored and can be read by a computer, and the program data can be executed by a processor to implement the target capture method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Image acquisition method and device, storage medium and electronic device
CN111263118A