Target detection method and device, computer equipment, storage medium and program product
By determining the candidate bounding box and screening the prospect target area in the object detection technology, the problem of low target detection accuracy in the prior art is solved, and a higher target detection accuracy is achieved.
Patent Information
- Application Number
- CN202310689983.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2024-12-13
AI Technical Summary
The existing object detection technology has low accuracy and it is difficult to accurately identify the position of the target object in the image.
By determining the candidate bounding box in the current screen image, obtain the foreground target area in the candidate internal area that is closest to the target point, filter the foreground area using the depth value and height information of the pixel point, filter out the background and plane areas, and then determine the to be detected Object detection results.
It improves the accuracy of target detection, can identify target objects more accurately, and enhances the accuracy of target detection.
Smart Images

Figure CN119131336A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of target detection, and in particular to a target detection method, apparatus, computer equipment, storage medium and program product. Background Art
[0002] With the continuous development of artificial intelligence technology, target detection technology has received more and more attention. When performing target detection on a target image displayed on a terminal interface, the target object in the target image can be determined through human-computer interaction.
[0003] In the related art, the target object area in the target image is mainly selected by the user on the terminal interface. For example, the selection method may be that the user "manually frames" the target object in the target image with a mouse to determine the target object area in the target image.
[0004] However, the related art methods have the problem of low accuracy in target detection. Summary of the invention
[0005] Based on this, it is necessary to provide a target detection method, device, computer equipment, storage medium and program product that can improve the accuracy of target detection in response to the above technical problems.
[0006] In a first aspect, the present application provides a target detection method, the method comprising:
[0007] In response to the target detection instruction of the current screen image, determining a candidate bounding box of the object to be detected in the current screen image according to the target point coordinates carried in the target detection instruction;
[0008] Obtain the foreground target area in the candidate internal area of the candidate bounding box that is closest to the target point;
[0009] The target detection result of the object to be detected is determined according to the foreground target area.
[0010] In one of the embodiments, obtaining a foreground target region closest to the target point in a candidate internal region of a candidate bounding box includes:
[0011] Determine a foreground area in the candidate internal area according to parameter information of each pixel in the candidate internal area;
[0012] Determine the foreground target area closest to the target point from the foreground area.
[0013] In one of the embodiments, the parameter information includes depth value and height information; determining the foreground area in the candidate internal area according to the parameter information of each pixel in the candidate internal area includes:
[0014] Determine the background area in the candidate internal area according to the depth value of each pixel in the candidate internal area;
[0015] Determine a plane area in the candidate internal area according to height information of each pixel in the candidate internal area;
[0016] The background area and the plane area in the candidate internal area are filtered out to obtain the foreground area in the candidate internal area.
[0017] In one embodiment, determining the background area in the candidate internal area according to the depth value of each pixel in the candidate internal area includes:
[0018] Get the depth value of each pixel in the candidate internal area;
[0019] The candidate internal area corresponding to the pixel points whose depth value is greater than the preset depth threshold is determined as the background area; the preset depth threshold is determined according to the background peak value and the foreground peak value; the background peak value and the foreground peak value are determined according to the number of pixel points corresponding to the depth value.
[0020] In one of the embodiments, determining a plane area in the candidate internal area according to height information of each pixel point in the candidate internal area includes:
[0021] Get the height information of each pixel in the candidate internal area;
[0022] The candidate internal area corresponding to the pixel point with height information satisfying the preset condition is determined as the plane area.
[0023] In one embodiment, determining the foreground target region closest to the target point from the foreground region includes:
[0024] Determine a depth mutation region in the foreground region according to a depth difference of each pixel in the foreground region; the depth difference of each pixel represents a difference between a depth value of each pixel and a depth value of an adjacent pixel;
[0025] The depth mutation area in the foreground area is filtered out, and the foreground area connected to the target point is determined as the foreground target area closest to the target point.
[0026] In one of the embodiments, determining a depth mutation region in the foreground region according to the depth difference of each pixel in the foreground region includes:
[0027] Determine the depth mutation value according to the depth difference of each pixel in the foreground area;
[0028] An area corresponding to a depth mutation value greater than a preset depth mutation threshold is determined as a depth mutation area in the foreground area.
[0029] In one embodiment, determining the depth mutation value according to the depth difference of each pixel in the foreground area includes:
[0030] Based on the depth difference of each pixel in the foreground area, determine the average depth difference, the maximum depth difference and the minimum depth difference;
[0031] The depth mutation value is determined based on the depth difference average value, the depth difference maximum value and the depth difference minimum value.
[0032] In one embodiment, determining the foreground area connected to the target point as the foreground target area closest to the target point includes:
[0033] Determine whether the target point coordinates are in the foreground area;
[0034] If the target point coordinates are not in the foreground area, the target point coordinates are adjusted; the adjusted target point coordinates are the position of the foreground area closest to the target point coordinates;
[0035] The coordinates of the adjusted target point are determined as the foreground target area that is closest to the adjusted target point.
[0036] In one embodiment, determining a candidate internal area of the object to be detected in the current screen image according to the target point coordinates carried in the target detection instruction includes:
[0037] Taking the target point coordinates as the center, the candidate internal area in the current screen image is determined according to a preset size; the preset size is determined according to the size of the current screen image.
[0038] In one embodiment, determining the target detection result of the object to be detected according to the foreground target area includes:
[0039] Perform target detection on the foreground target area to obtain the target detection result of the object to be detected.
[0040] In one embodiment, determining a candidate bounding box of an object to be detected in a current screen image includes:
[0041] Segment the current screen image to obtain multiple super-pixel regions;
[0042] Determine the target superpixel region according to each superpixel region and the target point coordinates;
[0043] Based on the target superpixel area, the candidate bounding box of the object to be detected is determined.
[0044] In one embodiment, determining a target superpixel region according to each superpixel region and the target point coordinates includes:
[0045] Filter out the superpixel region corresponding to the target point coordinates from each superpixel region;
[0046] According to the preset clustering rules, each superpixel region is clustered to obtain the superpixel region of the object to be detected;
[0047] A post-processing operation is performed on the super-pixel region of the object to be detected to obtain a target super-pixel region; the post-processing operation includes at least one of a filling operation and a filtering operation.
[0048] In a second aspect, the present application further provides a target detection device, the device comprising:
[0049] A first determination module, in response to a target detection instruction of a current screen image, is used to determine a candidate bounding box of an object to be detected in the current screen image according to the target point coordinates carried in the target detection instruction;
[0050] An acquisition module, used for acquiring a foreground target area in a candidate internal area of a candidate bounding box that is closest to the target point;
[0051] The second determination module is used to determine the target detection result of the object to be detected according to the foreground target area.
[0052] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the content of any one of the target detection methods in the first aspect is implemented.
[0053] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the content of any one of the target detection methods in the first aspect is implemented.
[0054] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the content of any one of the target detection methods in the first aspect when executed by a processor.
[0055] The above-mentioned target detection method, device, computer equipment, storage medium and program product respond to the target detection instruction of the current screen image, determine the candidate bounding box of the object to be detected in the current screen image according to the target point coordinates carried in the target detection instruction, obtain the foreground target area closest to the target point in the candidate internal area of the candidate bounding box, and determine the target detection result of the object to be detected according to the foreground target area. Based on the target point coordinates carried in the target detection instruction, this method can accurately determine the candidate internal area of the object to be detected in the current screen image, so that the foreground target area closest to the target point can be accurately obtained from the candidate area, and then the object to be detected can be accurately detected according to the foreground target area, thereby improving the accuracy of target detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 A diagram showing an application environment of a target detection method in an embodiment;
[0057] Figure 2 Schematic diagram of a target detection method in one embodiment;
[0058] Figure 3 is a schematic diagram of a current screen image in one embodiment;
[0059] Figure 4 is a schematic diagram of a foreground target area in one embodiment;
[0060] Figure 5 Schematic diagram of a target detection method in one embodiment;
[0061] Figure 6 Schematic diagram of a target detection method in one embodiment;
[0062] Figure 7 Schematic diagram of a target detection method in one embodiment;
[0063] Figure 8 Schematic diagram of a target detection method in one embodiment;
[0064] Fig. 9 Schematic diagram of a target detection method in one embodiment;
[0065] Fig.10 is a schematic diagram of a deep mutation region in one embodiment;
[0066] Fig.11 A schematic diagram of removing a deep mutation region in one embodiment;
[0067] Fig.12 Schematic diagram of a target detection method in one embodiment;
[0068] Fig.13 Schematic diagram of a target detection method in one embodiment;
[0069] Fig.14 Schematic diagram of a target detection method in one embodiment;
[0070] Fig.15 is a schematic diagram of a process of displaying a current screen image in an embodiment;
[0071] Fig.16 A schematic diagram of a process flow of a foreground target area in one embodiment;
[0072] Fig.17 A schematic diagram of a process flow of a foreground target area in one embodiment;
[0073] Fig.18 A schematic diagram of a process flow of a foreground target area in one embodiment;
[0074] Fig.19 Schematic diagram of a target detection method in one embodiment;
[0075] Fig. 20 Schematic diagram of a target detection method in one embodiment;
[0076] Fig.21 Schematic diagram of a target detection method in one embodiment;
[0077] Fig. 22 Schematic diagram of a target detection method in one embodiment;
[0078] Fig.23 FIG. 4 is a structural block diagram of a target detection device in an embodiment. DETAILED DESCRIPTION
[0079] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0080] The target detection method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The memory in the internal structure of the computer device includes a non-volatile storage medium and an internal memory, and the non-volatile storage medium stores an operating system, a computer program and a database; the internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database is used to store data in the target detection process. The network interface is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the target detection method provided in the present application is implemented.
[0081] In one embodiment, Figure 2 As shown, a target detection method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps:
[0082] S201 , in response to a target detection instruction of a current screen image, determining a candidate bounding box of an object to be detected in the current screen image according to target point coordinates carried in the target detection instruction.
[0083] The candidate bounding box is a bounding box with the target point coordinates as the center point, and the shape of the candidate bounding box can be a square, rectangle, or circle, etc.
[0084] In this embodiment, the target detection instruction of the current screen image can be input by the user or sent by other computer devices. After the computer device receives the target detection instruction of the current screen image sent by the user or other computer devices, the target detection instruction can be parsed to determine the target point coordinates carried in the target detection instruction, and based on the target point coordinates and the rules for calibrating the candidate area, a candidate bounding box is determined from the current screen image, and the candidate bounding box includes the object to be detected. Among them, the user can determine the target point coordinates in the current screen by means of a touch screen, a mouse, a remote control, etc. For example, the coordinates of the lower left corner of the current screen image are (0, 0), the right direction is the positive direction of the X axis, the upward direction is the positive direction of the Y axis, and the shape of the candidate bounding box is the positive direction, the length is 4, if the coordinates of the target point are (2, 3), the corresponding four point coordinates of the candidate bounding box are (0, 1), (0, 5), (4, 5) and (4, 1) respectively.
[0085] Figure 3 is a schematic diagram of the current screen image, and the rectangular box in the figure is a candidate bounding box of the object to be detected in the current screen image.
[0086] S202, obtaining a foreground target region in the candidate internal region of the candidate bounding box that is closest to the target point.
[0087] The candidate internal region is the internal region of the candidate bounding box, and the foreground target region is the region corresponding to the object to be detected in the candidate internal region.
[0088] In this embodiment, the computer device can obtain parameter information of each pixel in the candidate internal area. For example, the parameter information of each pixel may include depth value and height information, etc. The depth value indicates the distance of the object corresponding to the pixel, and the height information indicates the height of the object corresponding to the pixel. According to the parameter value of each pixel, the candidate internal area is divided, and the pixel points in the candidate internal area whose parameter information error with the target point is within a preset range and whose distance is within the preset range are determined as the foreground target area.
[0089] Figure 4 Schematic diagram of the foreground target area in the current screen image. The inner area of the rectangular box in the figure is the foreground target area closest to the target point in the candidate inner area.
[0090] S203: Determine the target detection result of the object to be detected according to the foreground target area.
[0091] In this embodiment, the computer device can use the foreground target area as an input signal of a preset target detection model, input the foreground target area into the target detection model, and detect the foreground target area through the target detection model to obtain the target detection result of the object to be detected. Among them, the target detection model is obtained by training based on a large number of historical foreground target area samples, and the target detection result of the object to be detected can be accurately obtained through the target detection model.
[0092] In the above target detection method, in response to the target detection instruction of the current screen image, according to the target point coordinates carried in the target detection instruction, the candidate bounding box of the object to be detected is determined in the current screen image, the foreground target area closest to the target point in the candidate internal area of the candidate bounding box is obtained, and the target detection result of the object to be detected is determined according to the foreground target area. Based on the target point coordinates carried in the target detection instruction, this method can accurately determine the candidate internal area of the object to be detected in the current screen image, so that the foreground target area closest to the target point can be accurately obtained from the candidate area, and then the object to be detected can be accurately detected according to the foreground target area, thereby improving the accuracy of target detection.
[0093] In the above Figure 2 Based on the embodiment, this embodiment is Figure 2 The relevant contents of step S202 "obtaining the foreground target area closest to the target point in the candidate internal area of the candidate bounding box" are introduced and explained. Figure 5 As shown, the above step S202 may include the following contents:
[0094] S301, determining a foreground area in a candidate internal area of a candidate bounding box according to parameter information of each pixel point in the candidate internal area.
[0095] Optionally, the computer device may input the candidate internal region into a preset deep learning network, extract parameter information of each pixel in the candidate internal region through the deep learning network, analyze the parameter information of each pixel, and output the foreground region in the candidate internal region. Optionally, since the background has a larger depth value than the foreground, the computer device may obtain the depth value of each pixel in the candidate internal region through a depth algorithm, calculate the threshold for segmenting the background peak and the foreground peak, and segment each pixel in the candidate internal region according to the threshold to obtain the foreground region in the candidate internal region. This embodiment does not limit the method for determining the foreground region in the candidate internal region based on the parameter information of each pixel in the candidate internal region.
[0096] S302, determining a foreground target area that is closest to the target point from the foreground area.
[0097] In this embodiment, the computer device can obtain the depth value and height information of each pixel in the foreground area, divide the foreground area according to the depth value and height information of each pixel, and determine the pixels in the foreground area whose parameter information error with the target point is within a preset range and whose distance is within the preset range as the foreground target area.
[0098] In the above target detection method, the foreground region in the candidate internal region is determined according to the parameter information of each pixel in the candidate internal region, and the foreground target region closest to the target point is determined from the foreground region. This method can accurately analyze each pixel in the candidate internal region through the parameter information of each pixel in the candidate internal region to accurately obtain the foreground region in the candidate internal region, and thus can accurately obtain the foreground target region closest to the target point from the foreground region.
[0099] In the above Figure 5 Based on the embodiment, when the parameter information includes depth value and height information, this embodiment is to Figure 5 The relevant contents of step S301 "determining the foreground area in the candidate internal area according to the parameter information of each pixel point in the candidate internal area" are introduced and explained. Figure 6 As shown, the above step S301 may include the following contents:
[0100] S401, determining a background area in the candidate internal area according to the depth value of each pixel point in the candidate internal area.
[0101] In this embodiment, since the distance of the background area is large, that is, the depth value corresponding to the pixel points in the background area is large, the computer can compare the depth value of each pixel point with the preset depth threshold, and determine the area corresponding to the pixel points greater than the preset depth threshold as the background area in the candidate internal area.
[0102] S402, determining a plane area in the candidate internal area according to height information of each pixel point in the candidate internal area.
[0103] Among them, the height information represents the height value of the target corresponding to the pixel point. The plane area refers to the area with the same height information. The plane area can be a part of the foreground area. For example, when the foreground area includes a water cup and the table top under the water cup, the height information of the table top is the same. Therefore, the plane area in the foreground area is the table top under the water cup. The plane area can also be a part of the background area. For example, the current picture includes a person, a flat road surface and the sky. The background area is a flat road surface and the sky. The height information of the flat road surface is the same. Therefore, the flat road surface in the background area is a plane area.
[0104] In this embodiment, since the height values of the plane areas are the same, or the height values are within a preset height range, and the height values of the horizontal areas are smaller than the height values of other targets, the computer device can compare the height value of each pixel point with a preset height threshold, and determine the area corresponding to the pixel points having a height value greater than the preset threshold as the plane area in the candidate internal area.
[0105] S403, filtering out the background area and the plane area in the candidate internal area to obtain the foreground area in the candidate internal area.
[0106] In this embodiment, the computer device can filter out the background area and the plane area in the candidate internal area through a relevant filtering algorithm, thereby avoiding the influence of the background area and the plane area on the target detection process, and determining the filtered candidate internal area as the foreground area in the candidate internal area.
[0107] In the above target detection method, the background area in the candidate internal area is determined according to the depth value of each pixel in the candidate internal area, the plane area in the candidate internal area is determined according to the height information of each pixel in the candidate internal area, the background area and the plane area in the candidate internal area are filtered out, and the foreground area in the candidate internal area is obtained. This method can accurately obtain the background area in the candidate internal area through the depth value of each pixel; and accurately obtain the plane area in the candidate internal area through the height information of each pixel, and filter out the background area and the plane area in the candidate internal area, thereby avoiding the influence of the background area and the plane area on the target detection process, and making the obtained foreground area more accurate.
[0108] In the above Figure 6 Based on the embodiment, this embodiment is Figure 6 The relevant contents of step S401 "determining the background area in the candidate internal area according to the depth value of each pixel point in the candidate internal area" are introduced and explained. Figure 7 As shown, the above step S401 may include the following contents:
[0109] S501, obtaining the depth value of each pixel in the candidate internal area.
[0110] In this embodiment, the computing device can analyze the candidate internal area through a monocular depth estimation method, generate a depth map corresponding to the candidate internal area, and obtain the depth value of each pixel based on the depth map. The larger the depth value of the pixel, the farther the distance; the smaller the depth value, the smaller the distance. The monocular depth estimation method can be a self-supervised depth estimation method.
[0111] S502, determining the candidate internal area corresponding to the pixel points whose depth values are greater than the preset depth threshold as the background area; the preset depth threshold is determined according to the background peak value and the foreground peak value; the background peak value and the foreground peak value are determined according to the number of pixel points corresponding to the depth value.
[0112] In this embodiment, the computer device can compare the depth value with a preset depth threshold. If the depth value is greater than the preset depth threshold, the pixel is classified as a background pixel. After the depth values of all pixels are compared, the area composed of all background pixels is determined as the background area in the candidate internal area. It can be understood that the computer device can filter out the first depth peak from each depth value in order from large to small. The first depth peak refers to the depth value with the largest number of pixels at this stage. For example, the range of depth values is 0-30, the number of pixels with a depth value of 30 is 2, the number of pixels with a depth value of 29 is 5, the number of pixels with a depth value of 28 is 10, and the number of pixels with a depth value of 27 is 7, then the depth value 28 is used as the background peak. The depth value with the largest number of pixels is selected from the depth values 0-28 as the foreground peak. For example, between the depth values 0-28, the depth value with the largest number of pixels is 15, and the corresponding number of pixels is 50, and the depth value 15 is used as the foreground peak. Furthermore, the depth value 21 with the least number of pixels is selected from the depth value 15 and the depth value 28, and the corresponding number of pixels is 8, and the depth value 21 is used as the preset depth threshold; alternatively, the depth value 22 is the depth value with the least number of pixels except the depth value 21, then the average value of the depth value 21 and the depth value 22 is used as the preset depth threshold.
[0113] In the above target detection method, the depth value of each pixel in the candidate internal area is obtained, and the candidate internal area corresponding to the pixel whose depth value is greater than the preset depth threshold is determined as the background area; the preset depth threshold is determined based on the background peak value and the foreground peak value; the background peak value and the foreground peak value are determined based on the number of pixels corresponding to the depth value. This method can accurately obtain the background peak value and the foreground peak value in the candidate internal area through the number of pixels corresponding to the depth value, and based on the background peak value and the foreground peak value, a more accurate preset depth threshold can be obtained, and the depth value of each pixel is compared with the preset depth threshold, so that the background area in the candidate internal area can be strictly screened, so that the obtained background area is more accurate.
[0114] In the above Figure 6 Based on the embodiment, this embodiment is Figure 6 The relevant contents of step S402 "determining the plane area in the candidate internal area according to the height information of each pixel point in the candidate internal area" are introduced and explained. Figure 8 As shown, the above step S402 may include the following contents:
[0115] S601, obtaining height information of each pixel in the candidate internal area.
[0116] In this embodiment, the computer device can convert each pixel in the candidate internal area into a preset camera coordinate system, obtain the height value of each pixel in the camera coordinate system, and determine the height value as the height information of each pixel.
[0117] S602: Determine the candidate internal area corresponding to the pixel point whose height information meets the preset condition as a plane area.
[0118] In this embodiment, the height information that meets the preset conditions represents the height information whose height value is less than the preset height threshold. The computer device can compare the height value with the preset height threshold, determine the height information whose height value is less than the preset height threshold as the height information that meets the preset conditions, and determine the candidate internal area corresponding to the pixel point of the height information as the plane area.
[0119] In the above target detection method, the height information of each pixel in the candidate internal area is obtained, and the candidate internal area corresponding to the pixel with the height information that meets the preset condition is determined as the plane area. This method determines whether the height information of each pixel satisfies the preset condition, and determines the candidate internal area corresponding to the pixel with the height information that meets the preset condition as the plane area, so that the obtained plane area is more accurate based on the height information of each pixel.
[0120] In the above Figure 5 Based on the embodiment, this embodiment is Figure 5The relevant contents of step S302 "determining the foreground target area closest to the target point from the foreground area" are introduced and explained. Fig. 9 As shown, the above step S302 may include the following contents:
[0121] S701, determining a depth mutation region in the foreground region according to a depth difference of each pixel in the foreground region; the depth difference of each pixel represents a difference between a depth value of each pixel and a depth value of an adjacent pixel.
[0122] Since mutations are likely to occur at the boundaries between different targets in the foreground area, it is necessary to find the deep mutation area between the targets in the foreground area and filter out the deep mutation area to more accurately obtain the foreground target area of the target to be detected.
[0123] In this embodiment, after the computer device obtains the depth value of each pixel in the foreground area, it can make a difference between the depth value of the pixel and the depth value of the surrounding adjacent pixels. For example, with a pixel as the center, the depth difference of the pixel in 8 directions can be calculated, and the depth difference in the 8 directions can be averaged. The depth difference of the pixel is determined by the average value, the maximum depth difference and the minimum depth difference. Further, the computer device can compare the depth difference with a preset depth mutation threshold. If the depth difference is greater than the preset depth mutation threshold, it is determined that the pixel can be classified as a depth mutation area. By comparing the depth differences of all pixels, the depth mutation area in the foreground area can be obtained. Fig.10 It is a schematic diagram of the foreground area, which includes two overlapping targets. The box area in the figure is the deep mutation area in the foreground area.
[0124] S702, filtering out the depth mutation region in the foreground region, and determining the foreground region connected to the target point as the foreground target region closest to the target point.
[0125] In this embodiment, the computer device can filter the depth mutation area in the foreground area through a relevant filtering algorithm to obtain a filtered foreground area image, and then determine the foreground area connected to the target point as the foreground target area closest to the target point. Fig.10 is a schematic diagram of the foreground area image after filtering. Fig.11 If the target point in is in target 1, the foreground area where target 1 is located is determined as the foreground target area closest to the target point.
[0126] In the above target detection method, the depth mutation area in the foreground area is determined according to the depth difference of each pixel in the foreground area; the depth difference of each pixel represents the difference between the depth value of each pixel and the depth value of the adjacent pixel, the depth mutation area in the foreground area is filtered out, and the foreground area connected to the target point is determined as the foreground target area closest to the target point. This method can accurately obtain the depth difference of each pixel through the difference between the depth value of each pixel and the depth value of the adjacent pixel, so that the depth mutation area in the foreground area can be accurately determined based on the depth difference. The depth mutation area is the overlapping part of two objects. Based on the depth mutation area, the combined area of the two objects can be accurately divided to avoid interference of other objects on the object to be detected, thereby making the foreground area after filtering out the depth mutation area more accurate.
[0127] In the above Fig. 9 Based on the embodiment, this embodiment is Fig. 9 The relevant contents of step S701 "determining the depth mutation area in the foreground area according to the depth difference of each pixel point in the foreground area" are introduced and explained. Fig.12 As shown, the above step S701 may include the following contents:
[0128] S801, determining a depth mutation value according to a depth difference of each pixel in the foreground area.
[0129] Among them, the deep mutation value is a quantitative indicator of the deep mutation area.
[0130] In this embodiment, the computer device can input the depth difference of each pixel into the mutation calculation formula according to the mutation calculation formula between the depth difference and the depth mutation value, and calculate the depth mutation value of each pixel through the mutation calculation formula.
[0131] S802: Determine a region corresponding to a depth mutation value greater than a preset depth mutation threshold as a depth mutation region in the foreground region.
[0132] In this embodiment, the computer device can compare the depth mutation value of each pixel point with a preset depth mutation threshold. If the depth mutation value of any pixel point is greater than the preset depth mutation threshold, the pixel point is classified as a depth mutation pixel point, and the area composed of all depth mutation pixels is determined as the depth mutation area in the foreground area.
[0133] In the above target detection method, the depth mutation value is determined according to the depth difference of each pixel in the foreground area, and the area corresponding to the depth mutation value greater than the preset depth mutation threshold is determined as the depth mutation area in the foreground area. According to the depth difference of each pixel, this method can accurately obtain the depth mutation value in the foreground area for the mutation of each pixel in the foreground area, and compare the depth mutation value with the depth mutation threshold to accurately determine the depth mutation area in the foreground area.
[0134] In the above Fig.12 Based on the examples, this embodiment is Fig.12 The relevant contents of step S801 "determining the depth mutation value according to the depth difference of each pixel in the foreground area" are introduced and explained. Fig.13 As shown, the above step S801 may include the following contents:
[0135] S901, determining an average depth difference, a maximum depth difference, and a minimum depth difference based on the depth difference of each pixel in the foreground area.
[0136] In this embodiment, after the computer device obtains the depth difference of each pixel in the foreground area, the pixel and the 8 pixels around the pixel form a 3*3 network. The average depth difference value can be determined based on the depth difference in the 3*3 network, and the depth difference corresponding to the maximum value in the 3*3 network is determined as the maximum depth difference, and the depth difference corresponding to the minimum value in the 3*3 network is determined as the minimum depth difference.
[0137] S902: Determine a depth mutation value based on the depth difference average value, the depth difference maximum value, and the depth difference minimum value.
[0138] In this embodiment, the computer device can calculate the difference between the average depth difference and the maximum depth difference and the minimum depth difference. The difference can be expressed as Davg-Dmax-Dmin, where Davg is the average depth difference; Dmax is the maximum depth difference; and Dmin is the minimum depth difference. Further, the computer device calculates the product between the difference and the depth difference coefficient, and uses the obtained product as the depth mutation value. The depth mutation value can be expressed as:
[0139] M=(Davg-Dmax-Dmin)*0.1666667
[0140] In the above target detection method, based on the depth difference of each pixel in the foreground area, the average depth difference, the maximum depth difference and the minimum depth difference are determined, the difference between the average depth difference and the maximum depth difference and the minimum depth difference is obtained, and the product between the difference and the depth difference coefficient is used as the depth mutation value. This method can accurately extract the average depth difference, the maximum depth difference and the minimum depth difference from the depth difference of each pixel in the foreground area, so that the depth mutation value in the foreground area can be accurately determined based on the average depth difference, the maximum depth difference and the minimum depth difference.
[0141] In the above Fig.13 Based on the embodiment, this embodiment is Fig.13 The relevant contents of step S702 "determining the foreground area connected to the target point as the foreground target area closest to the target point" are introduced and explained. Fig.14 As shown, the above step S702 may include the following contents:
[0142] S1001, determine whether the target point coordinates are in the foreground area.
[0143] In this embodiment, the computer device can obtain the depth value of the target point from the target point coordinate information in the current screen image, and compare the depth value of the target point with a preset depth threshold. If the depth value of the target point is greater than the preset depth threshold, it is determined that the target point coordinates are in the foreground area; if the depth value of the target point is less than or equal to the preset depth threshold, it is determined that the target point coordinates are not in the foreground area, that is, the target point coordinates are in the background area.
[0144] S1002: If the target point coordinates are not in the foreground area, the target point coordinates are adjusted; the adjusted target point coordinates are the position of the foreground area closest to the target point coordinates.
[0145] In this embodiment, when the target point coordinates are not in the foreground area, the target point coordinates need to be adjusted to the position of the foreground area. The computer device can search the surrounding area based on the target point coordinates. If the first pixel point of the foreground area is found, the pixel point is determined as the position of the foreground area closest to the target point coordinates, and the target point coordinates are adjusted to the position of the foreground area.
[0146] Fig.15 A schematic diagram showing the current screen image where the target point coordinates are not in the foreground area. Fig.15 The target point 1 is the target point in the background area, and the target point 2 is the adjusted target point coordinates.
[0147] S1003, determining the foreground target area with the adjusted target point coordinates as the closest distance to the adjusted target point.
[0148] In this embodiment, the computer device can obtain the depth value and height information of each pixel in the foreground area, divide the foreground area according to the depth value and height information of each pixel, and determine the area in the foreground area whose parameter information error with the adjusted target point is within a preset range and which is closest to the adjusted target point as the foreground target area. Fig.16 Indicates the foreground target area that is closest to the adjusted target point.
[0149] In the above target detection method, it is determined whether the target point coordinates are in the foreground area. If the target point coordinates are not in the foreground area, the target point coordinates are adjusted; the adjusted target point coordinates are the position of the foreground area closest to the target point coordinates, and the adjusted target point coordinates are determined as the foreground target area closest to the adjusted target point. This method can more accurately determine whether the target point coordinates need to be adjusted by determining whether the target point coordinates are in the foreground area, thereby making the obtained foreground target area more accurate.
[0150] In the above Figure 2 Based on the embodiment, this embodiment is Figure 2 The relevant contents of step S201 "determine the candidate internal area of the object to be detected in the current screen image according to the target point coordinates carried in the target detection instruction" are introduced and explained. The above step S201 may include the following contents: taking the target point coordinates as the center, determine the candidate internal area in the current screen image according to a preset size; the preset size is determined according to the size of the current screen image.
[0151] In this embodiment, the computer device can obtain the size information of the current screen image, and scale the size information according to the scaling ratio to determine the candidate internal region in the current screen image. The scaling ratio can be 0.5 times or 0.3 times the size of the current screen image. For example, the length of the current screen image is 10 cm and the width is 8 cm. After scaling the size information of the current screen in the same proportion, the length of the candidate internal region obtained is 5 cm and the width is 4 cm.
[0152] In the above target detection method, the candidate internal area in the current screen image is determined according to a preset size with the target point coordinates as the center, wherein the preset size is determined according to the size of the current screen image. This method can make the determined candidate internal area with the target point coordinates as the center more reasonable based on the size of the target image.
[0153] In the above Figure 2 Based on the embodiment, this embodiment is Figure 2The above step S203 may include the following contents: performing target detection on the foreground target area to obtain the target detection result of the object to be detected.
[0154] In this embodiment, after the computer device obtains the foreground target area in the current screen image, it can input the foreground target area into a preset target detection model, perform target detection on the foreground target area through the target detection model, and obtain a target detection result of the foreground target area.
[0155] Fig.17 for Figure 3 The foreground target area corresponding to the screen image in the figure, the target detection result of the foreground target area is a bottle; Fig.18 for Fig.14 The foreground target area corresponding to the screen image in , the target detection result of the foreground target area is a building.
[0156] In the above target detection method, target detection is performed on the foreground target area to obtain the target detection result of the object to be detected. This method performs target detection on the foreground target area in a targeted manner, and can accurately obtain the target detection result corresponding to the target point coordinates, which can improve the accuracy of the target detection result.
[0157] In the above Figure 2 Based on the embodiment, this embodiment is Figure 2 The relevant contents of step S201 "determining the candidate internal area of the object to be detected in the current screen image" are introduced and explained. Fig.19 As shown, the above step S201 may include the following contents:
[0158] S1101, segment the current screen image to obtain multiple super-pixel regions.
[0159] Among them, superpixel is to divide the pixel-level map corresponding to the current screen image into region-level maps. Superpixel region refers to a region composed of a series of adjacent pixels in the current screen image with similar characteristics such as color, brightness, and texture.
[0160] In this embodiment, the computer device can use a superpixel segmentation algorithm to segment the current screen image, divide the pixels that are adjacent in position and have similar features such as color, brightness, and texture into a superpixel area, and obtain multiple superpixel areas corresponding to the current screen image. Among them, the superpixel segmentation algorithm can be a clustering-based pixel segmentation method (Simple Linear Iterative Clustering, SLIC) and a gradient descent-based segmentation method. The SLIC algorithm is a clustering-based pixel segmentation method that can group similar pixels into superpixels.
[0161] S1102, determining a target superpixel region according to each superpixel region and the target point coordinates.
[0162] In this embodiment, the computer device can search the superpixel region where the target point coordinates are located from each superpixel region according to the target point coordinates, and determine the superpixel region where the target point coordinates are located as the target superpixel region. When the target point coordinates are at the boundary of several superpixel regions, the region composed of these superpixel regions is used as the target superpixel region. Alternatively, the computer device can use the superpixel region where the target point coordinates are located and the region composed of the surrounding adjacent superpixel regions as the target superpixel region.
[0163] S1103: Determine a candidate bounding box of the object to be detected based on the target superpixel region.
[0164] In this embodiment, the target superpixel region is a region generated according to a user instruction, and therefore, the target superpixel region corresponding to the target point coordinates is used as a candidate bounding box of the object to be detected.
[0165] In the above-mentioned method for determining the bounding box, the current screen image is segmented to obtain multiple superpixel regions, and the target superpixel region is determined based on each superpixel region and the target point coordinates, and the candidate bounding box of the object to be detected is determined based on the target superpixel region. This method divides the pixel points with the same characteristics into a superpixel region by segmenting the current screen image, and based on the target point coordinates, quickly screens the target superpixel region corresponding to the object to be detected from each superpixel region, so that the determination efficiency of the candidate bounding box of the object to be detected is higher.
[0166] Based on the above embodiment, this embodiment is a Fig.19 The relevant contents of "determining the target superpixel region according to each superpixel region and the target point coordinates" in step S1102 are introduced and explained. Fig. 20 As shown, the above step S1102 may include the following contents:
[0167] S1201, filtering out the superpixel region corresponding to the target point coordinates from each superpixel region.
[0168] In this embodiment, the computer device can obtain the centroid position coordinates of each superpixel region, calculate the distance between each centroid position coordinate and the target point coordinate, and use the superpixel region corresponding to the minimum distance among all distances as the superpixel region corresponding to the target point coordinate. For example, if the straight-line distance between the centroid position coordinates of superpixel region A and the target point coordinate is 10, and the straight-line distance between the centroid position coordinates of superpixel region B and the target point coordinate is 15, then superpixel region A is determined as the superpixel region corresponding to the target point coordinate.
[0169] S1202: Cluster each superpixel region according to a preset clustering rule to obtain a superpixel region of the object to be detected.
[0170] The preset clustering rule may be to classify the color, texture and shape features whose similarity is greater than a preset similarity threshold into one category.
[0171] In this embodiment, due to the process of superpixel region segmentation, an object to be detected may be divided into multiple superpixel regions. Therefore, in order to obtain a more accurate superpixel region corresponding to the object to be detected, after obtaining the superpixel region corresponding to the target point coordinates, the computer device can use a related clustering algorithm to obtain the feature similarity between the superpixel region corresponding to the target point coordinates and other superpixel regions, and compare the feature similarity with a preset similarity threshold, and fuse other superpixel regions greater than the preset similarity threshold with the superpixel region corresponding to the target point coordinates, and the superpixel region obtained by fusion is the superpixel region of the object to be detected. Among them, the related technical algorithm can be a K-means clustering algorithm (k-means Clustering Algorithm, K-means), a density-based clustering algorithm (Density-BasedSpatial Clustering of Applications with Noise, DBSCAN) or a mean shift algorithm (MeanShift), etc.
[0172] S1203, performing a post-processing operation on the super-pixel region of the object to be detected to obtain a target super-pixel region; the post-processing operation includes at least one of a filling operation and a filtering operation.
[0173] In this embodiment, since there may be small hole areas or small edge areas between the fused superpixel areas, the fused superpixel areas need to be post-processed, that is, filling operations are performed on the small hole areas, and filtering operations are performed on the small edge areas, so as to optimize the shape of the superpixel area of the object to be detected, make the superpixel area smoother, and obtain the target superpixel area of the object to be detected.
[0174] In the above-mentioned method for determining the bounding box, the superpixel region corresponding to the target point coordinates is screened out from each superpixel region, and each superpixel region is clustered according to a preset clustering rule to obtain the superpixel region of the object to be detected, and the superpixel region of the object to be detected is post-processed to obtain the target superpixel region; the post-processing operation includes at least one of a filling operation and a filtering operation. Based on the target point coordinates, this method can accurately screen the superpixel region corresponding to the target point coordinates from each superpixel region, and based on the clustering rules, determine the superpixel region corresponding to the object to be detected, and then post-process the superpixel region, which can optimize the shape of the superpixel region of the object to be detected, so that the target superpixel region of the object to be detected is more accurate.
[0175] In one embodiment, the target detection method is described in detail below. Fig.21 As shown, the method may include:
[0176] S1301, in response to a target detection instruction of a current screen image, determining a candidate bounding box in the current screen image with the target point coordinates as the center and according to a preset size;
[0177] S1302, obtaining a depth value of each pixel in a candidate internal area of a candidate bounding box;
[0178] S1303, determining the candidate internal area corresponding to the pixel points whose depth values are greater than a preset depth threshold as the background area;
[0179] S1304, obtaining height information of each pixel in the candidate internal area;
[0180] S1305, determining the candidate internal area corresponding to the pixel point with height information satisfying a preset condition as a plane area;
[0181] S1306, filtering out the background area and the plane area in the candidate internal area to obtain the foreground area in the candidate internal area;
[0182] S1307, determining an average depth difference, a maximum depth difference, and a minimum depth difference based on the depth difference of each pixel in the foreground area;
[0183] S1308, determining a depth mutation value based on the depth difference average value, the depth difference maximum value, and the depth difference minimum value;
[0184] S1309, determining an area corresponding to a depth mutation value greater than a preset depth mutation threshold as a depth mutation area in the foreground area, and filtering out the depth mutation area in the foreground area;
[0185] S1310, determining whether the target point coordinates are in the foreground area;
[0186] S1311, if the target point coordinates are not in the foreground area, the target point coordinates are adjusted;
[0187] S1312, determining the foreground target area with the adjusted target point coordinates as the closest distance to the adjusted target point;
[0188] S1313, performing target detection on the foreground target area to obtain a target detection result of the object to be detected.
[0189] Fig. 22 The present invention is a flow chart of a target detection method, which may include: S1401: determining a candidate internal area in a current screen image according to input target point coordinates; S1402: extracting a depth value of each pixel in the candidate internal area; S1403: determining a foreground area of the candidate internal area according to the depth value; S1404: filtering out a plane area from the foreground area to obtain a foreground target area; S1405: performing target detection of an object to be detected in the foreground target area.
[0190] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0191] Based on the same inventive concept, the embodiment of the present application also provides a target detection device for implementing the target detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more target detection device embodiments provided below can refer to the limitations on the target detection method above, and will not be repeated here.
[0192] In one embodiment, Fig.23 As shown, a target detection device is provided, comprising: a first determination module 11, an acquisition module 12, and a second determination module 13, wherein:
[0193] A first determination module 11, in response to a target detection instruction of a current screen image, is used to determine a candidate internal area of a to-be-detected object in the current screen image according to the target point coordinates carried in the target detection instruction;
[0194] An acquisition module 12 is used to acquire a foreground target area in the candidate internal area that is closest to the target point;
[0195] The second determination module 13 is used to determine the target detection result of the object to be detected according to the foreground target area.
[0196] In one embodiment, the acquisition module 12 includes: a first determination unit and a second determination unit, wherein:
[0197] A first determining unit, configured to determine a foreground area in the candidate internal area according to parameter information of each pixel point in the candidate internal area;
[0198] The second determining unit is used to determine the foreground target area which is closest to the target point from the foreground area.
[0199] In one embodiment, the above-mentioned first determination unit is also used to determine the background area in the candidate internal area according to the depth value of each pixel point in the candidate internal area; determine the plane area in the candidate internal area according to the height information of each pixel point in the candidate internal area; filter out the background area and the plane area in the candidate internal area to obtain the foreground area in the candidate internal area.
[0200] In one embodiment, the above-mentioned first determination unit is also used to obtain the depth value of each pixel in the candidate internal area; the candidate internal area corresponding to the pixel whose depth value is greater than the preset depth threshold is determined as the background area; the preset depth threshold is determined based on the background peak value and the foreground peak value; the background peak value and the foreground peak value are determined based on the number of pixel points corresponding to the depth value.
[0201] In one embodiment, the first determining unit is further used to obtain height information of each pixel in the candidate internal area;
[0202] The candidate internal area corresponding to the pixel point with height information satisfying the preset condition is determined as the plane area.
[0203] In one embodiment, the second determination unit is also used to determine the depth mutation area in the foreground area according to the depth difference of each pixel in the foreground area; the depth difference of each pixel represents the difference between the depth value of each pixel and the depth value of the adjacent pixel; the depth mutation area in the foreground area is filtered out, and the foreground area connected to the target point is determined as the foreground target area closest to the target point.
[0204] In one embodiment, the second determination unit is further used to determine a depth mutation value according to a depth difference of each pixel in the foreground area; and determine an area corresponding to a depth mutation value greater than a preset depth mutation threshold as a depth mutation area in the foreground area.
[0205] In one embodiment, the second determination unit is further used to determine the depth difference average value, the depth difference maximum value and the depth difference minimum value based on the depth difference of each pixel in the foreground area; and determine the depth mutation value based on the depth difference average value, the depth difference maximum value and the depth difference minimum value.
[0206] In one embodiment, the above-mentioned second determination unit is also used to determine whether the target point coordinates are in the foreground area; if the target point coordinates are not in the foreground area, the target point coordinates are adjusted; the adjusted target point coordinates are the position of the foreground area closest to the target point coordinates; and the adjusted target point coordinates are determined as the foreground target area closest to the adjusted target point.
[0207] In one embodiment, the first determining module includes a third determining unit, wherein:
[0208] The third determining unit is used to determine the candidate internal area in the current screen image according to a preset size with the target point coordinates as the center; the preset size is determined according to the size of the current screen image.
[0209] In one embodiment, the second determination module includes a detection unit, wherein:
[0210] The detection unit is used to perform target detection on the foreground target area to obtain the target detection result of the object to be detected.
[0211] In one embodiment, the first determining module further includes: a segmentation unit, a fourth determining unit and a fifth determining unit, wherein:
[0212] A segmentation unit, used to segment the current screen image to obtain multiple super-pixel regions;
[0213] A fourth determining unit, configured to determine a target superpixel region according to each superpixel region and the target point coordinates;
[0214] The fifth determining unit is used to determine a candidate bounding box of the object to be detected based on the target superpixel area.
[0215] In one embodiment, the fourth determination unit is also used to filter out superpixel regions corresponding to the target point coordinates from each superpixel region; cluster each superpixel region according to a preset clustering rule to obtain a superpixel region of the object to be detected; perform post-processing operations on the superpixel region of the object to be detected to obtain a target superpixel region; the post-processing operation includes at least one of a filling operation and a filtering operation.
[0216] Each module in the above target detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0217] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the content of any one embodiment of the above-mentioned target detection method is implemented.
[0218] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the content of any one embodiment of the above-mentioned target detection method is implemented.
[0219] In one embodiment, a computer program product is provided, including a computer program, which implements the content of any one of the embodiments of the above-mentioned target detection method when executed by a processor.
[0220] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0221] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0222] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0223] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A target detection method, characterized in that: The method comprises: In response to a target detection instruction of a current screen image, determining a candidate bounding box of an object to be detected in the current screen image according to target point coordinates carried in the target detection instruction; Obtain a foreground target area in the candidate internal area of the candidate bounding box that is closest to the target point; The target detection result of the object to be detected is determined according to the foreground target area.
2. The method according to claim 1, characterized in that: The step of obtaining the foreground target region in the candidate internal region of the candidate bounding box which is closest to the target point comprises: Determine a foreground area in the candidate internal area according to parameter information of each pixel point in the candidate internal area; A foreground target area which is closest to the target point is determined from the foreground area.
3. The method according to claim 2, characterized in that The parameter information includes a depth value and height information; and determining the foreground area in the candidate internal area according to the parameter information of each pixel point in the candidate internal area includes: Determine a background area in the candidate internal area according to the depth value of each pixel in the candidate internal area; Determine a plane area in the candidate internal area according to height information of each pixel point in the candidate internal area; The background area and the plane area in the candidate internal area are filtered out to obtain the foreground area in the candidate internal area.
4. The method according to claim 3, characterized in that The determining the background area in the candidate internal area according to the depth value of each pixel point in the candidate internal area comprises: Obtaining the depth value of each pixel in the candidate internal area; The candidate internal area corresponding to the pixel points whose depth value is greater than the preset depth threshold is determined as the background area; the preset depth threshold is determined based on the background peak value and the foreground peak value; the background peak value and the foreground peak value are determined based on the number of pixel points corresponding to the depth value.
5. The method according to claim 3, characterized in that: The determining, according to the height information of each pixel point in the candidate internal area, a plane area in the candidate internal area comprises: Obtaining height information of each pixel in the candidate internal area; The candidate internal area corresponding to the pixel point whose height information meets the preset condition is determined as the plane area.
6. The method according to any one of claims 2 to 5, characterized in that: The step of determining the foreground target area closest to the target point from the foreground area comprises: Determine a depth mutation region in the foreground region according to a depth difference value of each pixel in the foreground region; the depth difference value of each pixel represents a difference between a depth value of each pixel and a depth value of an adjacent pixel; The depth mutation region in the foreground region is filtered out, and the foreground region connected to the target point is determined as the foreground target region closest to the target point.
7. The method according to claim 6, characterized in that The determining, according to the depth difference of each pixel point in the foreground area, a depth mutation area in the foreground area comprises: Determine a depth mutation value according to the depth difference of each pixel in the foreground area; An area corresponding to a depth mutation value greater than a preset depth mutation threshold is determined as a depth mutation area in the foreground area.
8. The method according to claim 7, characterized in that Determining the depth mutation value according to the depth difference of each pixel in the foreground area includes: Based on the depth difference of each pixel in the foreground area, determining an average depth difference, a maximum depth difference and a minimum depth difference; The depth mutation value is determined based on the depth difference average value, the depth difference maximum value and the depth difference minimum value.
9. The method according to claim 6, characterized in that The step of determining the foreground area connected to the target point as the foreground target area closest to the target point includes: Determine whether the target point coordinates are in the foreground area; If the target point coordinates are not in the foreground area, the target point coordinates are adjusted; the adjusted target point coordinates are the position of the foreground area closest to the target point coordinates; The coordinates of the adjusted target point are determined as the foreground target area that is closest to the adjusted target point.
10. The method according to any one of claims 1 to 5, characterized in that: The step of determining a candidate internal region of the object to be detected in the current screen image according to the target point coordinates carried in the target detection instruction includes: Taking the target point coordinates as the center, a candidate internal area in the current screen image is determined according to a preset size; the preset size is determined according to the size of the current screen image.
11. The method according to any one of claims 1 to 5, characterized in that: The step of determining the target detection result of the object to be detected according to the foreground target area includes: Performing target detection on the foreground target area to obtain a target detection result of the object to be detected.
12. The method according to any one of claims 1 to 5, characterized in that: The step of determining a candidate bounding box of an object to be detected in the current screen image includes: Segmenting the current screen image to obtain a plurality of super-pixel regions; Determine a target superpixel region according to each of the superpixel regions and the target point coordinates; Based on the target superpixel region, a candidate bounding box of the object to be detected is determined.
13. The method according to claim 12, characterized in that The step of determining the target superpixel region according to the superpixel regions and the target point coordinates includes: Filter out the superpixel region corresponding to the coordinates of the target point from each of the superpixel regions; Clustering the superpixel regions according to a preset clustering rule to obtain the superpixel region of the object to be detected; A post-processing operation is performed on the super-pixel region of the object to be detected to obtain the target super-pixel region; the post-processing operation includes at least one of a filling operation and a filtering operation.
14. A target detection device, characterized in that: The device comprises: A first determination module, in response to a target detection instruction of a current screen image, is used to determine a candidate bounding box of an object to be detected in the current screen image according to the target point coordinates carried in the target detection instruction; An acquisition module, used for acquiring a foreground target area in a candidate internal area of the candidate bounding box that is closest to the target point; The second determination module is used to determine the target detection result of the object to be detected according to the foreground target area.
15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 13 are implemented.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.
Citation Information
Cited By
Machine vision target positioning method and system based on bounding box adaptive adjustment
CN120279252A
