Image processing methods, computer-readable storage media, and electronic devices
By combining density estimation and depth-first search algorithms with density clustering, the problem of inaccurate target object localization in monitoring images in existing technologies is solved, and more refined object information output is achieved, which is suitable for 3D modeling and trend prediction.
Patent Information
- Application Number
- CN202211182408.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-09-27
AI Technical Summary
Existing algorithms can only estimate the total number of objects in monitored images and cannot output more detailed information, making it difficult to meet the needs of urban governance for accurate perception of changes in quantity.
By using density estimation and depth-first search algorithms, target pixels are determined from the density map. Combined with density clustering algorithms, the accuracy of target coordinates is improved, enabling precise localization of objects in the monitored image.
It improves the accuracy of target object positioning in monitoring images and increases the precision of output information, making it suitable for 3D modeling and trend prediction.
Smart Images

Figure CN115527166B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more specifically, to an image processing method, a computer-readable storage medium, and an electronic device. Background Technology
[0002] Traditional group situational awareness often only needs to estimate the total number of objects in a video frame in real time, and then grasp the possible trend of changes in the total number of objects. However, with the rapid development of urban governance, there is a greater demand for more precise perception of the trend of changes in the number of objects. For some monitoring images containing a large number of objects, current algorithms can only estimate the total number of objects in the image, and the output information is limited and not fine enough.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides an image processing method, a computer-readable storage medium, and an electronic device to at least solve the technical problem that algorithms in related technologies struggle to output more information about target objects in monitored images.
[0005] According to one aspect of the embodiments of this application, an image processing method is provided, comprising: acquiring a monitoring image of a region to be monitored, wherein the monitoring image contains a target object; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result includes multiple density values used to characterize the probability that a target object exists in multiple pixels in the monitoring image; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains a target object; and obtaining a target location result of the target object in the region to be monitored based on the position of the target pixel in the monitoring image.
[0006] According to one aspect of the embodiments of this application, an image processing method is provided, comprising: obtaining a monitoring image by monitoring an activity area through a monitoring device, wherein the monitoring image contains a target crowd; performing density estimation on the monitoring image to obtain a density estimation result of the target crowd, wherein the density estimation result includes multiple density values used to characterize the probability that multiple pixels in the monitoring image contain the target crowd; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains the target crowd; and obtaining a target location result of the target crowd in the activity area based on the position of the target pixel in the monitoring image.
[0007] According to one aspect of the embodiments of this application, an image processing method is provided, comprising: responding to an input command applied to an operation interface, displaying a monitoring image of a region to be monitored on the operation interface, wherein the monitoring image includes a target object; and responding to a positioning command applied to the operation interface, displaying a target positioning result of the target object in the region to be monitored on the operation interface, wherein the target positioning result is determined by the position of a target pixel in the monitoring image determined from multiple pixels in the monitoring image, the target pixel is determined based on a density estimation result of the target object, the density estimation result is obtained by performing density estimation on the monitoring image, and the multiple density values included in the density estimation result are used to characterize the probability that the multiple pixels contain a target object.
[0008] According to one aspect of the embodiments of this application, an image processing method is provided, comprising: monitoring a monitoring image of a region to be monitored by a monitoring device, wherein the monitoring image contains a target object; displaying the monitoring image on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result includes multiple density values used to characterize the probability that a target object exists in multiple pixels in the monitoring image; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains a target object; obtaining a target location result of the target object in the region to be monitored based on the position of the target pixel in the monitoring image; and driving the VR device or AR device to render and display the target location result.
[0009] According to one aspect of the embodiments of this application, an image processing method is provided, comprising: acquiring a monitoring image of a region to be monitored by calling a first interface, wherein the first interface includes a first parameter, the parameter value of the first parameter being the monitoring image, and the monitoring image containing a target object; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result includes multiple density values used to characterize the probability that a target object exists in multiple pixels in the monitoring image; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains a target object; obtaining a target location result of the target object in the region to be monitored based on the position of the target pixel in the monitoring image; and outputting the target location result by calling a second interface, wherein the second interface includes a second parameter, the parameter value of the second parameter being the target location result.
[0010] In this embodiment, firstly, a monitoring image of the area to be monitored is obtained, wherein the monitoring image contains a target object; density estimation is performed on the monitoring image to obtain a density estimation result of the target object, wherein multiple density values included in the density estimation result are used to characterize the probability that multiple pixels in the monitoring image contain the target object; based on the density estimation result, a target pixel is determined from the multiple pixels, wherein the target pixel contains the target object; based on the position of the target pixel in the monitoring image, the target location result of the target object in the area to be monitored is obtained, thus realizing the location of the object in the monitoring image. It is readily apparent that density estimation can be performed on the monitoring image to obtain a density estimation result of the target object, and the pixels containing the target object can be determined from the multiple pixels based on the density estimation result, avoiding the location of pixels that do not contain the target object, thereby improving the accuracy of the target object location result. By obtaining the target object location result, the output information of the target object can be increased, thus solving the technical problem that related technologies' algorithms struggle to output more information about the target object in the monitoring image. Attached Figure Description
[0011] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0012] Figure 1 This is a schematic diagram of the hardware environment of a virtual reality device according to an embodiment of the image processing method of this application;
[0013] Figure 2 This is a structural block diagram of a computing environment for an image processing method according to an embodiment of this application;
[0014] Figure 3 This is a flowchart of an image processing method according to Embodiment 1 of this application;
[0015] Figure 4 This is a flowchart of an image processing procedure according to an embodiment of this application;
[0016] Figure 5 This is a flowchart of another image processing method according to an embodiment of this application;
[0017] Figure 6 This is a flowchart of an image processing method according to Embodiment 2 of this application;
[0018] Figure 7 This is a flowchart of an image processing method according to Embodiment 3 of this application;
[0019] Figure 8This is a flowchart of an image processing method according to Embodiment 4 of this application;
[0020] Figure 9 This is a flowchart of an image processing method according to Embodiment 5 of this application;
[0021] Figure 10 This is a schematic diagram of an image processing apparatus according to Embodiment 6 of this application;
[0022] Figure 11 This is a schematic diagram of an image processing apparatus according to Embodiment 7 of this application;
[0023] Figure 12 This is a schematic diagram of an image processing apparatus according to Embodiment 8 of this application;
[0024] Figure 13 This is a schematic diagram of an image processing apparatus according to Embodiment 9 of this application;
[0025] Figure 14 This is a schematic diagram of an image processing apparatus according to Embodiment 10 of this application;
[0026] Figure 15 This is a structural block diagram of a computer terminal according to an embodiment of this application. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:
[0030] Crowd situation analysis: Crowd situation analysis refers to using automated algorithms to obtain quantitative indicators such as the number, density, and flow direction of the crowd, and then using these indicators to derive a crowd management and control model for the monitored area.
[0031] Group situation: This includes the situation of human groups, animal communities, and robot groups. The content of this application is not limited to the above-mentioned group situations, and can include the calculation of group situations formed by any similar objects.
[0032] Crowd counting: The purpose is to count the number of people in a scene. Crowd counting has a wide range of applications in video surveillance, traffic monitoring, public safety, and urban planning, such as monitoring the number of people in areas where crowds tend to gather to prevent stampedes and other incidents.
[0033] Density map: Based on the known location of each target, the size of the target at that location can be estimated to obtain the coverage area of the target. Then, through some methods (geometric adaptive Gaussian kernel), the area is transformed into the probability that the target may be in the area. The probability of the area is 1 (or represents how many people may be in each pixel). Thus, the target distribution density in the image can be obtained.
[0034] Hill Climbing: This can be a local search algorithm that moves continuously in the direction of increasing height / value to find local peaks.
[0035] N-ary tree: In a tree data structure, if each parent node is allowed to have more than two child nodes, then the tree is called an N-ary tree.
[0036] Depth-First Search (DFS) is an algorithm used to traverse a search tree or graph, searching the branches of the tree as deeply as possible. When all edges containing node v have been explored, the search backtracks to the starting node of the edge that led to node v. This process continues until all nodes reachable from the source node have been found.
[0037] Currently, since the total estimated number of people in dense scenes may reach thousands of objects, if the algorithm only outputs the total number of objects, it is difficult for the crowd situation monitoring personnel to perceive the quality of the algorithm's recognition effect in the first place. Therefore, the algorithm needs to be able to provide the specific pixel position of each object in the image. At the same time, when combined with the 3D modeling of the event venue, the density distribution map of the crowd is difficult to fit precisely with the 3D model, so the algorithm's perception capability needs to be mapped into the 3D model.
[0038] The above problems are solved in related technologies in the following ways:
[0039] (1) The Crowd Counting and Localization Network (SCALNet) realizes the transformation from density map to scatter coordinates. This scheme only uses a 3×3 max pooling filter to scan the density map and uses a threshold selected based on the validation set to select peak points. However, the disadvantage of this scheme is that it is difficult to guarantee that the number of target coordinates obtained matches the number of people estimated by the density map, resulting in the error of the number correspondence. This method is more sensitive to the threshold.
[0040] (2) Crowd density estimation (FIDTM) realizes the transformation from density map to scatter coordinates. This scheme is largely the same as SCALNet. The difference is that the threshold is fixed to the maximum value in the density map scaled by 100 / 255, which avoids the problem of threshold selection. However, this scheme is also difficult to guarantee that the number of target coordinates obtained matches the number of people estimated by the density map.
[0041] The drawback of the two schemes mentioned above is that they use the assumption that there is at most one peak point in a 3×3 area. In extremely dense situations, this may lead to the omission of target coordinates.
[0042] This application provides an image processing method that combines density clustering and depth-first search algorithms to produce more accurate target coordinate positions from density maps, thereby improving the accuracy of the output target coordinate positions.
[0043] Example 1
[0044] According to an embodiment of this application, an image processing method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0045] Figure 1 This is a schematic diagram of the hardware environment of a virtual reality device according to an embodiment of the image processing method of this application. Figure 1 As shown, the virtual reality device 104 is connected to the terminal 106, and the terminal 106 is connected to the server 102 via a network. The virtual reality device 104 is not limited to: virtual reality helmets, virtual reality glasses, virtual reality all-in-one machines, etc. The terminal 104 is not limited to PCs, mobile phones, tablets, etc. The server 102 can be a server corresponding to a media file operator. The network includes, but is not limited to: wide area network, metropolitan area network, or local area network.
[0046] Optionally, the virtual reality device 104 in this embodiment includes a memory, a processor, and a transmission device. The memory stores an application program that can be used to perform: acquiring a monitoring image of a region to be monitored, wherein the monitoring image contains a target object; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result includes multiple density values used to characterize the probability that multiple pixels in the monitoring image contain the target object; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains the target object; and obtaining a target location result of the target object in the region to be monitored based on the position of the target pixel in the monitoring image, thereby solving the technical problem that algorithms in related technologies struggle to output more information about target objects in monitoring images.
[0047] Optionally, the eye-tracking HMD (Head-Mounted Display) and eye-tracking module in the virtual reality device 104 of this embodiment function the same as in the embodiments described above. That is, the screen in the HMD is used to display real-time images, and the eye-tracking module in the HMD is used to acquire the real-time movement trajectory of the user's eyes. The terminal in this embodiment acquires the user's position and movement information in real three-dimensional space through the tracking system, and calculates the three-dimensional coordinates of the user's head in virtual three-dimensional space, as well as the user's field of vision orientation in virtual three-dimensional space.
[0048] Figure 1 The hardware structure block diagram shown can serve not only as an exemplary block diagram of the aforementioned AR / VR device (or mobile device), but also as an exemplary block diagram of the aforementioned server. In one optional embodiment, Figure 2 The use of the above is illustrated in a block diagram. Figure 1 The AR / VR device (or mobile device) shown is an example of a computing node in computing environment 201. Figure 2 This is a structural block diagram of a computing environment for an image processing method according to an embodiment of this application, such as... Figure 2 As shown, computing environment 201 includes multiple computing nodes (such as servers) running on a distributed network (shown as 210-1, 210-2, ..., in the diagram). Each computing node contains local processing and memory resources, and end user 202 can remotely run applications or store data within computing environment 201. Applications can be provided as multiple services 220-1, 220-2, 220-3, and 220-4 within computing environment 201, representing services "A", "D", "E", and "H", respectively.
[0049] End user 202 can provide and access services through a web browser or other software application on a client. In some embodiments, the provisioning and / or requests of end user 202 can be provided to ingress gateway 230. Ingress gateway 230 may include a corresponding agent to handle provisioning and / or requests for service 220 (one or more services provided in computing environment 201).
[0050] Service 220 is provided or deployed based on various virtualization technologies supported by computing environment 201. In some embodiments, service 220 may be provided based on virtual machine (VM)-based virtualization, container-based virtualization, and / or similar methods. Virtual machine-based virtualization may involve simulating a real computer by initializing a virtual machine, executing programs and applications without directly accessing any actual hardware resources. While the machine is virtualized by a virtual machine, container-based virtualization may launch containers to virtualize an entire operating system (OS), allowing multiple workloads to run on a single OS instance.
[0051] In one embodiment based on container virtualization, several containers of service 220 can be assembled into a POD (e.g., a Kubernetes POD). For example, such as Figure 2 As shown, service 220-2 can be equipped with one or more PODs 240-1, 240-2, ..., 240-N (collectively referred to as POD 240). Each POD 240 can include a proxy 245 and one or more containers 242-1, 242-2, ..., 242-M (collectively referred to as containers 242). One or more containers 242 in POD 240 handle requests related to one or more corresponding functions of the service, and the proxy 245 typically controls service-related network functions such as routing, load balancing, etc. Other services 220 can also be equipped with PODs similar to POD 240.
[0052] During operation, executing a user request from end user 202 may require calling one or more services 220 in computing environment 201. Executing one or more functions of one service 220 requires calling one or more functions of another service 220. For example... Figure 2 As shown, service "A" 220-1 receives user requests from terminal user 202 from ingress gateway 230. Service "A" 220-1 can call service "D" 220-2, and service "D" 220-2 can request service "E" 220-3 to perform one or more functions.
[0053] The aforementioned computing environment can be a cloud computing environment, where resource allocation is managed by cloud services, allowing functionality development without needing to consider implementation, adjustment, or server scaling. This computing environment allows developers to execute event-responsive code without building or maintaining complex infrastructure. Services can be partitioned into a set of functions that can automatically and independently scale, rather than scaling a single hardware device to handle potential loads.
[0054] Under the aforementioned operating environment, this application provides the following: Figure 3 The image processing method shown is illustrated. It should be noted that the image processing method in this embodiment can be derived from... Figure 1 The mobile terminal of the illustrated embodiment is executed. Figure 3 This is a flowchart of an image processing method according to Embodiment 1 of this application. Figure 3 As shown, the method may include the following steps:
[0055] Step S302: Obtain monitoring images of the area to be monitored.
[0056] The monitored images contain the target object.
[0057] The number of target objects in the above monitoring image can be a preset number. When the preset number is greater than the preset value, it indicates that the monitoring image is an ultra-dense image. The preset number can be obtained by estimating the number of target objects in the monitoring image. The preset value can be set according to the actual situation.
[0058] The areas to be monitored can be areas with high population density, such as large event venues and large gathering places. They can also be areas with high object density, such as forests and habitats of social animals. Furthermore, any area requiring monitoring can be included; there are no limitations on this.
[0059] The aforementioned monitoring images can be images captured when the number of target objects in the monitored area exceeds a preset number. Optionally, monitoring images can be acquired using a camera; alternatively, video information of the monitored area can be acquired via a camera, and the aforementioned monitoring images can be obtained by cropping the video information. Specifically, video frames in the video information where the number of target objects exceeds a preset number can be used as monitoring images.
[0060] The monitoring images mentioned above can also be remote sensing images. They can also be population thermal distribution maps.
[0061] The target object mentioned above can be a person, animal, plant, object, etc., and is not limited here. This application uses a person as an example of the target object.
[0062] The preset number mentioned above can be set by the user. If the number of target objects in the monitoring image is greater than the preset number, it indicates that there are a large number of target objects in the area to be monitored, that is, the target objects are relatively dense. In this case, it is necessary to monitor the target objects in the area to be monitored.
[0063] In one optional embodiment, a preset quantity can be determined based on the area to be monitored. For example, the preset quantity can be determined based on the area of the area to be monitored. If the area of the area to be monitored is larger, it can accommodate more target objects. In this case, the preset quantity can be set larger. When the number of target objects exceeds the preset quantity, the area to be monitored will be considered to have a dense concentration of target objects. If the area of the area to be monitored is smaller, it can accommodate smaller target objects. In this case, the preset quantity can be set smaller. As long as the number of target objects exceeds the preset quantity, it is determined that the area to be monitored has a dense concentration of target objects.
[0064] Step S304: Perform density estimation on the monitoring image to obtain the density estimation result of the target object.
[0065] The density estimation results include multiple density values used to characterize the probability that a target object exists in multiple pixels of the monitored image.
[0066] In one optional embodiment, the density of the monitored image can be estimated using a density estimation model to obtain the density estimation result of the target object. The density estimation model can be a general density estimation model, and no limitations are imposed here.
[0067] When a monitored image contains a dense crowd, its density estimate can provide a rough estimate of the number of people in the dense crowd.
[0068] The density values mentioned above can be used to represent the probability of the presence of a target object within a region. The larger the density value, the more target objects there are, indicating a higher probability that a target object exists in the region. Conversely, the smaller the density value, the fewer target objects there are, indicating a lower probability that a target object exists in the region.
[0069] The density estimation results described above can be used to obtain the probability of the presence of target objects in multiple regions of the monitoring image, thereby determining the overall density of the monitoring image.
[0070] In another alternative embodiment, density estimation can be performed on high-density monitoring images using existing crowd density estimation models to obtain density estimation results. Optionally, for a high-resolution color image (Red, Green, Blue, or RGB image) extracted from a video stream, with a shape of (H, W, 3), a low-resolution density map can be obtained using a crowd density estimation model. This is a matrix M with a shape of (H / 4, W / 4), where the elements are floating-point numbers representing the probability of a target object appearing at each pixel location. Therefore, summing the elements in the matrix yields the total number of target objects K in the monitoring image, i.e., K = , where i and j are the rows and columns of matrix M; h and w are the length and width of the image.
[0071] Step S306: Based on the density estimation results, determine the target pixel from multiple pixels.
[0072] Among them, the target pixel contains the target object.
[0073] In one alternative embodiment, the target pixel with the larger density value can be determined based on multiple density values in the density estimation results.
[0074] In another optional embodiment, based on the density estimation result, multiple pixels can be divided into multiple first pixel sets. The first pixel sets with quality exceeding a first preset value are split to obtain multiple second pixel sets. Target pixels are determined from the second pixel sets, and multiple target tree structures are established. In each target tree structure, the sum of the density values of all nodes in the density estimation result is less than a first preset value. The target tree structure can contain multiple nodes, and each node can contain a target object.
[0075] The target tree structure mentioned above can be an N-ary tree structure.
[0076] The first preset value mentioned above can be 1.
[0077] A target tree structure can be constructed in a dense crowd based on the density estimation results. The multiple nodes in the target tree structure can correspond to multiple pixels. The target pixel can be used as the parent node in the target tree structure, and other pixels can be determined as child nodes of the parent node based on their distance from the target pixel.
[0078] In one optional embodiment, a local density hill-climbing algorithm and a depth-first quality aggregation method can be used to construct multiple target tree structures based on the density estimation results. The nodes in the target tree structure whose sum of density values in the density estimation results is less than 1 indicate that each node represents a single target object, thus avoiding a situation where one node represents multiple target objects, leading to multiple target objects sharing a single location point.
[0079] Step S308: Based on the position of the target pixel in the monitoring image, obtain the target location result of the target object in the area to be monitored.
[0080] In one alternative embodiment, the location of the target pixel in the monitored image can be used to determine the target location result of the target object in the monitored area.
[0081] In another optional embodiment, within the constructed multiple target tree structures, target pixels can be identified as corresponding to target root nodes. The target location result of the target object in the monitored area can be determined based on the radiation range of the target root node. The number of target root nodes can be approximately the same as the number of target objects, or the number of target root nodes can be the same as the number of target objects. If the sum of the density values of all nodes contained in each target tree structure in the density estimation result is less than a first preset value, it indicates that the number of target objects corresponding to that node is approximately one. Based on the pixel positions in the monitored image corresponding to the target root nodes contained in the target tree structure, the approximate target location result corresponding to each person in a dense crowd can be determined.
[0082] The target localization result mentioned above can be the coordinate information of the target object in the monitoring image.
[0083] In an optional embodiment, since the target root node represents the target object in the monitoring image, the target location result of the target object in the monitoring result can be determined according to the pixel position of the target root node contained in the multiple target tree structure in the monitoring image.
[0084] The method described in this application can utilize density hill climbing and depth optimization algorithms to sample the specific locations of pedestrians from fuzzy crowd heat map in dense scenes, providing important location information for 3D modeling and trend prediction of dense crowds.
[0085] Taking a monitoring image of a densely populated scene as an example, we can first acquire a monitoring image corresponding to the scene, such as a large concert or event. We then perform density estimation on the monitoring image to obtain the crowd density estimate, which roughly estimates the number of individuals in the densely populated scene. Based on the density estimation result, we can determine the target pixel from multiple pixels. Based on the position of this target pixel in the monitoring image, we can obtain the target location result of the object in the area to be monitored. Optionally, we can establish an initial tree structure corresponding to the crowd density cluster. We can superimpose smaller points in the crowd density cluster onto the central node of the cluster to obtain multiple aggregated tree structures. For target tree structures with a crowd density value exceeding 1 in multiple aggregated tree structures, since they contain multiple individuals, we need to perform a splitting operation to obtain multiple initial target tree structures. Based on the position of the target pixel in the monitoring image corresponding to the target root node contained in multiple target tree structures, we can obtain the target location position of each individual in the monitoring result of the densely populated scene, thus obtaining a location result consistent with the number of people in the densely populated scene. It should be noted that a crowd density cluster can be a cluster of people centered on a location with high density in a monitoring image. There can be one or more crowd density clusters.
[0086] Taking monitoring images of densely populated animal scenes as an example, we can first acquire monitoring images corresponding to these scenes, such as animal migration or group living. We then perform density estimation on these images to obtain animal density estimates, which roughly estimate the number of individuals in the densely populated scene. Based on the density estimation results, we can determine target pixels from multiple pixels. The location of these target pixels in the monitoring image allows us to obtain the target location of the animal in the monitored area. Optionally, we can establish an initial tree structure corresponding to the animal density clusters. We can superimpose smaller points from the animal density clusters onto the central nodes of the clusters, resulting in multiple aggregated tree structures. For target tree structures with animal density values exceeding 1 in these aggregated tree structures, since they contain multiple animal individuals, we need to perform a splitting operation to obtain multiple initial target tree structures. Based on the positions of the target pixels corresponding to the root nodes of these multiple target tree structures in the monitoring image, we can obtain the target location of each animal individual in the monitoring results, thus obtaining a location result consistent with the number of animals in the densely populated scene. It should be noted that an animal density cluster can be an animal density cluster centered on a location with high density in a monitoring image, and there can be one or multiple animal density clusters.
[0087] Taking a monitoring image of a scene with dense objects as an example, we can first acquire the monitoring image corresponding to the scene with dense objects, such as a scene containing multiple similar objects. We then perform density estimation on the monitoring image to obtain the object density estimation result, which roughly estimates the number of individuals in the scene. Based on the density estimation result, we can determine the target pixel from multiple pixels. Based on the position of this target pixel in the monitoring image, we can obtain the target location result of the object in the area to be monitored. Optionally, we can establish an initial tree structure corresponding to the object density clusters. We can superimpose points with lower mass in the object density clusters onto the central node of the cluster, obtaining multiple aggregated tree structures. For target tree structures with an object density value exceeding 1 in multiple aggregated tree structures, since they contain multiple objects, we need to perform a splitting operation to obtain multiple initial target tree structures. Based on the position of the target pixel in the monitoring image corresponding to the target root node contained in multiple target tree structures, we can obtain the target location position of each object in the dense scene in the monitoring result, thus obtaining a location result consistent with the number of objects in the dense scene. It should be noted that an object density cluster can be an object density cluster formed centered on a location with higher density in the monitoring image. There can be one or more object density clusters.
[0088] Through the above steps, firstly, a monitoring image of the area to be monitored is obtained, which contains the target object; then, density estimation is performed on the monitoring image to obtain the density estimation result of the target object, where multiple density values in the density estimation result represent the probability that multiple pixels in the monitoring image contain the target object; based on the density estimation result, the target pixel is determined from the multiple pixels, where the target pixel contains the target object; based on the position of the target pixel in the monitoring image, the target object's location result in the area to be monitored is obtained, thus realizing the location of the object in the monitoring image. It is noteworthy that density estimation can be performed on the monitoring image to obtain the density estimation result of the target object, and the pixels containing the target object can be determined from multiple pixels based on the density estimation result, avoiding the location of pixels that do not contain the target object, thereby improving the accuracy of the target object location result. By obtaining the target object's location result, the output information of the target object can be increased, thus solving the technical problem that related algorithms struggle to output more information about the target object in the monitoring image.
[0089] In the above embodiments of this application, determining a target pixel from multiple pixels based on density estimation results includes: dividing the multiple pixels into multiple first pixel sets based on density estimation results, wherein pixels in different first pixel sets contain different objects; aggregating the density values corresponding to pixels in each first pixel set to obtain the quality corresponding to each first pixel set; performing a splitting operation on a preset pixel set in the multiple first pixel sets based on the quality corresponding to the multiple first pixel sets to obtain multiple second pixel sets, wherein the quality corresponding to the preset pixel sets is greater than a first preset value; and determining the target pixel from the multiple second pixel sets based on the quality corresponding to the multiple second pixel sets.
[0090] The aforementioned multiple sets of first pixels can be in the form of multiple initial tree structures. The quality of each node in each initial tree structure is the density value of that node in the density estimation result. The quality of all nodes in the multiple initial tree structures is aggregated to obtain multiple aggregated tree structures, which are the quality corresponding to each set of first pixels. The target tree structure in the multiple aggregated tree structures is split to obtain multiple first tree structures, wherein the target tree structure is the aforementioned preset pixel structure, the first tree structure is the aforementioned set of first pixels, and the quality of the first root node of the first tree structure is greater than a first preset value.
[0091] The density values mentioned above can be floating-point density values. The first preset value mentioned above can be 1, but it is not limited to this and can be set according to actual needs.
[0092] In a dense crowd, multiple initial tree structures can be tree structures corresponding to density clusters in the dense crowd. Pixels with higher density values in a density cluster can correspond to parent nodes in the tree structure, and other pixels in the vicinity of that pixel can be descendant child nodes of the parent node.
[0093] In an optional embodiment, after obtaining the density estimation result, the elements in the density matrix M are scanned one by one to determine whether the element is the point with the largest floating-point density value in its own 3×3 neighborhood. If it is, it is pushed into the candidate point stack S. If not, it is pushed into the child node stack C_S of the peak point C in its neighborhood. Here, when pushing onto the stack, the pixel coordinates (i, j) of each element and its floating-point density value V in M can be stored at the same time, and the radiation range of each element can be stored as its own coordinates. Here, the radiation range refers to the coordinate range of the descendant nodes of each element as the parent node.
[0094] Furthermore, since the quality of a candidate point is only its own quality, a depth-first search algorithm can be used to add the quality of all descendant nodes (including child nodes, child nodes of child nodes, etc.) of the candidate point to itself, updating it to its own quality v'. At the same time, the radiation range value can be updated to the top left and bottom right positions of all descendant nodes that are farthest from the candidate point's own coordinates. In other words, the radiation range of the candidate point is updated to the maximum range of all its descendant nodes.
[0095] In another optional embodiment, multiple pixels can be divided into multiple first pixel sets based on the density estimation results. Pixels in different first pixel sets may contain different objects. Optionally, the density estimation results can be used to divide multiple pixels into multiple first pixel sets centered on the pixels corresponding to one or more regions with larger density values.
[0096] Furthermore, the density values corresponding to the pixels in each first pixel set can be aggregated. Optionally, all pixels in each first pixel set can be scanned, and the pixel with the highest density value can be taken as the target pixel. The density values of other pixels within the radiation range of this pixel can be superimposed onto the pixel with the highest quality, thus updating the quality of the pixel with the highest density value. The process of superimposing the density values of pixels is essentially the process of aggregating the density values of pixels, thereby aggregating the density values corresponding to the pixels in each first pixel set and obtaining the quality corresponding to each first pixel set.
[0097] Furthermore, since the quality corresponding to the preset pixel set is greater than the first preset value, it means that the number of target objects corresponding to the preset pixel set exceeds 1. At this time, it is necessary to perform a classification operation on the preset pixel set to obtain multiple second pixel sets.
[0098] In a tree structure, multiple initial tree structures can be established based on density estimation results. The mass of each node in each initial tree structure is the density value of that node in the density estimation results. All nodes in each initial tree structure can be scanned to obtain the node with the largest mass as a candidate node. The mass of the child nodes within the radiation range of the candidate node can be superimposed on the node with the largest mass, and the mass of the node with the largest mass can be updated. The process of superimposing the node mass is essentially the process of aggregating the node mass, thereby aggregating the mass of all nodes in multiple initial tree structures to obtain multiple aggregated tree structures.
[0099] In another alternative embodiment, for a target tree structure with a parent node mass greater than 1, a recursive splitting operation can be performed so that the number of coordinates corresponding to each parent node is exactly equal to the integer part of the total mass, thereby avoiding the problem of losing the number of target objects in extremely dense areas.
[0100] In the above embodiments of this application, based on the density estimation result, multiple pixels are divided into multiple first pixel sets, including: traversing each pixel in the monitoring image, determining whether the density value corresponding to the pixel in the density estimation result is the maximum density value among all the density values corresponding to pixels in a preset region, wherein the preset region is used to characterize the region in the monitoring image composed of pixels centered on the pixel and adjacent to the pixel; if the density value corresponding to the pixel is the maximum density value, establishing a new set and storing the pixel in the new set, wherein the new set is used to generate multiple first pixel sets; if the density value corresponding to the pixel is not the maximum density value, storing the pixel in the set among the multiple first pixel sets that stores the maximum density value.
[0101] In one optional embodiment, each pixel in the monitored image can be traversed to determine whether the density value corresponding to the pixel in the density estimation result is the maximum density value among all the density values corresponding to all pixels in the preset area. If the density value is greater than the maximum density value in the preset area, a new set can be established and the pixel can be stored in the new set. The new set represents the density clusters with a large number of people in the dense crowd in the monitored image.
[0102] The preset area mentioned above can be a 3×3 area, or an area of other sizes; the area of the preset area is not limited here. The preset area of a pixel does not include the density value of that pixel.
[0103] In one optional embodiment, the density value of each pixel in the monitored image can be traversed to determine whether the density value is the largest density value in a preset area. If the density value is the largest density value in the preset area, a new set can be established based on the density value.
[0104] If the density value is not the maximum density value within the preset area, the pixel can be stored in the set containing the maximum density value among multiple first pixel sets.
[0105] In another optional embodiment, the maximum density value within a preset region during traversal can be used as the initial root node, and other density values within the preset region smaller than the maximum density value can be used as child nodes of the initial root node, thereby establishing multiple initial tree structures. Optionally, the maximum density value can be pushed onto the candidate point stack S, and other density values can be pushed onto the child node stack C_S of the peak point C in its neighborhood. During the stack pushing process, the pixel value and pixel coordinates corresponding to each pixel can be stored simultaneously.
[0106] In the above embodiments of this application, each first pixel set adopts a tree structure, the pixels in each first pixel set correspond to nodes in the tree structure, and the adjacency relationship between pixels in each first pixel set corresponds to the connection relationship between nodes in the tree structure. The aggregation of density values corresponding to pixels in each first pixel set to obtain the quality of each first pixel set includes: determining the density value corresponding to the parent node and the density value corresponding to the child node in the tree structure, wherein the child node is a descendant node of the parent node in the tree structure; aggregating the density value corresponding to the parent node and the density value corresponding to the child node to obtain the quality of the parent node; and determining the quality of the root node in the tree structure to obtain the quality of each first pixel set.
[0107] The parent node mentioned above can be the node with the largest mass in the tree structure, and the child node mentioned above can be the node with a mass less than the largest mass in the initial tree structure.
[0108] In one optional embodiment, each tree structure contains a parent node and child nodes. The density value of the child node can be superimposed on the density value of the parent node to obtain the quality of the parent node. This achieves the purpose of aggregating the density values of the parent node and the child node. By aggregating the density values of the parent node and the child node, the quality of the parent node is improved, thereby increasing the probability that a target object exists in the region. The quality of the parent node in the tree structure can be determined as the quality corresponding to each first pixel set, thereby increasing the probability that a pixel corresponding to a target object exists in the first pixel set.
[0109] In another alternative embodiment, the quality of the parent node is only its own density value. The quality of the parent node can be obtained by adding the density values of all descendant child nodes of the parent node to the parent node through a depth-first search algorithm. At the same time, the radiation range value can be updated to the top left and bottom right positions of all descendant nodes that are farthest from the target parent node's own coordinates. In other words, the radiation range of the parent node can be updated to the maximum range of all its descendant nodes.
[0110] In the above embodiments of this application, a preset pixel set in a plurality of first pixel sets is split based on the quality corresponding to the plurality of first pixel sets to obtain a plurality of second pixel sets, including: Step A, obtaining the radiation range of the preset pixel set, wherein the radiation range is used to characterize the coordinate range of all pixels in the preset pixel set; Step B, determining the pixel corresponding to the maximum density value within the radiation range to obtain candidate pixels; Step C, splitting the preset pixel set based on the candidate pixels to obtain a split first set and a second set, wherein the split first set contains candidate pixels and associated pixels that are related to the candidate pixels, and the split second set contains other pixels in the preset pixel set besides the pixels in the split first set; Step D, when the quality corresponding to the split second set is greater than a second preset value, updating the radiation range to the coordinate range of all pixels in the split second set, and repeating the above steps B and C until the quality corresponding to the split second set is less than or equal to the second preset value to obtain a plurality of second pixel sets, wherein the second preset value is less than the first preset value.
[0111] The density values of the above candidate pixels can be greater than 1.
[0112] The first preset value can be 1, and the second preset value can be 0, but it is not limited to these. The specific first and second preset values can be set according to the needs.
[0113] In the aforementioned preset pixel set, the density value of the parent node is greater than 1. If the density value of the parent node is greater than 1, it indicates that the preset pixel set represents multiple target objects. Therefore, it is necessary to split the preset pixel set so that each target object can correspond to a pixel set. Mapping in the monitoring image involves aggregating the positional information of multiple target objects into a single positional information set. Therefore, it is necessary to split the preset pixel set to obtain a separate set corresponding to each target object, thereby achieving the purpose of locating dense target objects in the monitoring image.
[0114] In one optional embodiment, the radiation range of a preset pixel set can be obtained. The radiation range of the preset pixel set is the coordinate range of all pixels in the preset pixel set. The pixel corresponding to the maximum density value within the radiation range can be determined to obtain candidate pixels. The preset pixel set can be split according to the density value of the candidate pixels to obtain a first set and a second set after splitting. At this time, the first set contains candidate pixels and associated pixels that are related to the candidate pixels. If the quality of the second set after splitting is greater than a second preset value, it means that the second set represents multiple target objects. At this time, the radiation range can be updated to the coordinate range of all pixels in the second set after splitting, and the above operation can be repeated on the second set until the quality of the second set after splitting is less than or equal to the second preset value, resulting in multiple second pixel sets. If the quality of the second set is less than or equal to the second preset value, it means that the second set represents only one target object. At this time, it is not necessary to split the second set again. Using the second set can accurately represent the position of its corresponding target object.
[0115] In the above embodiments of this application, a splitting operation is performed on a preset pixel set based on candidate pixels to obtain a split first set and a second set. This includes: performing multiple diffusions centered on candidate pixels; accumulating the density value corresponding to the pixel at each diffusion position in the preset pixel set with the accumulated result of the previous diffusion position to obtain the accumulated result of the diffusion position; wherein, the accumulated result of the first diffusion position is obtained by accumulating the density value corresponding to the pixel at the first diffusion position with the density value corresponding to the candidate pixel; each diffusion position is the location of a pixel in the monitoring image that is adjacent to the pixel at the previous diffusion position and far away from the candidate pixel; the first diffusion position is the location of a pixel adjacent to the candidate pixel; if the accumulated result of the diffusion position is greater than a first preset value, a split first set is obtained based on the candidate pixel and the pixels at all diffusion positions before the current diffusion position; and the pixels in the split first set are deleted from the preset pixel set to obtain a split second set.
[0116] In one optional embodiment, multiple diffusion operations can be performed centered on the candidate pixel. The density value corresponding to the pixel at each diffusion position in the preset pixel set is accumulated with the cumulative result of the previous diffusion position to obtain the cumulative result of the diffusion position. By accumulating the diffusion positions, the pixels representing multiple target objects in the preset pixel set can be gradually split out. If the cumulative result of the diffusion position is greater than a first preset value, a split first set can be obtained based on the candidate pixel and the pixels at all diffusion positions before the current diffusion position. The pixels in the split first set can be deleted from the preset pixel set, that is, the density value of the pixels in the preset set related to the first set can be set to 0, thereby obtaining a split second set. In this way, the quality of the split second set can be reduced. The splitting operation continues on the second set until the quality of the second set is less than 0, indicating that the splitting is complete.
[0117] It should be noted that since the first set after splitting consists of candidate pixels and all pixels at the previous diffusion positions, and does not include diffusion positions exceeding the first preset value, the cumulative result of the first set after splitting should be less than the first preset value. That is, the first set after splitting represents a target object.
[0118] In another optional embodiment, after the quality aggregation step, for candidate nodes with a quality exceeding 1.0 (i.e., the preset pixel set mentioned above), it indicates that there is more than one target object within the radiation range of the candidate node. Therefore, it is necessary to perform a splitting operation on the candidate node. Optionally, the candidate node can be popped from the stack first, and then the position C' with the highest density within the radiation range of the candidate node (i.e., the position corresponding to the candidate pixel mentioned above) can be used as the starting position to gradually diffuse outwards. These diffused positions can be used as child nodes of C'. The sum of the quality of all child nodes can be added to C' (the first set) until the quality of C' exceeds 1.0. C' can then be added to the candidate node stack, and the density value of the position belonging to C' within the range of the original candidate node C (preset pixel set) is set to 0. Therefore, the total quality of node C is reduced accordingly. Repeat the previous step until the sum of the quality of the original node C is less than 0, indicating that all candidate nodes have been extracted from the original node C. This process represents rounding up.
[0119] In the above embodiments of this application, each first pixel set adopts a tree structure. After splitting the preset pixel set based on the candidate pixels to obtain the split first set and the second set, the quality of the node corresponding to the candidate pixel is set to a third preset value.
[0120] The third preset value mentioned above can be 0, but it is not limited to this and can be set according to your needs.
[0121] In an optional embodiment, after splitting the preset pixel set according to the candidate pixels to obtain the first set and the second set after splitting, the quality of the node corresponding to the candidate pixel is set to a third preset value. That is, the quality of the node corresponding to the candidate pixel within the radiation range can be set to 0, indicating that the candidate pixel node has been extracted from the preset pixel set.
[0122] In the above embodiments of this application, determining a target pixel from multiple second pixel sets based on the quality corresponding to multiple second pixel sets includes: sorting multiple second pixel sets according to the quality corresponding to multiple second pixel sets to obtain a sorting result; obtaining a preset number of second pixel sets from the sorting result to obtain a target pixel set, wherein the preset number is the number of target objects; and determining the pixel corresponding to the maximum density value from the pixels in the target pixel set as the target pixel.
[0123] In one optional embodiment, multiple second pixel sets can be sorted from smallest to largest according to the quality corresponding to the multiple second pixel sets. The higher the quality of the second pixel set, the greater the probability that it contains the target object. At this time, the target positioning result of the target object can be determined based on the second pixel set. Based on the roughly estimated number of target objects, the number of second pixel sets to be retained can be determined, that is, the number of target pixel sets mentioned above. The pixel corresponding to the maximum density value can be determined from the pixels in the target pixel set as the target pixel. Since the number of target objects is equal to the preset number, the target positioning result obtained needs to be consistent with the number of target objects. The pixel corresponding to the maximum density value in the sorting result is taken as the target pixel, and the target pixel is determined as the target positioning result of the target object.
[0124] Through the above steps, a relatively accurate location result of the target object can be extracted from the density estimation result, and the total number of location results is basically consistent with the number of target objects in the monitoring image.
[0125] Figure 4 This is a flowchart of an image processing procedure according to an embodiment of this application. For example... Figure 4As shown, firstly, a monitoring image is acquired. This image can be a dense image containing a large crowd. A crowd density estimation model can be used to estimate the crowd density in the monitoring image, obtaining the density estimation result. Then, a density hill-climbing algorithm is used to iterate through each density value in the density estimation result, determining whether the density value is the maximum density value within a preset area. If the density value is greater than the maximum density value within the preset area, a new set is established, and the pixel is stored in the new set. Multiple first pixel sets are generated based on the new set. The vortex center in the figure can be the location of the pixel with the maximum density value. If the density value corresponding to a pixel is not the maximum density value, the pixel can be stored in multiple first pixel sets. The pixel set stores the set of maximum density values. The pixel can be a node in the region outside the center of the vortex in the image. Multiple first pixel sets can be established based on the density values corresponding to the pixels. Each first pixel set can be aggregated to obtain the quality corresponding to each first pixel set. Since multiple first pixel sets may have a quality greater than 1, that is, a first pixel set may represent multiple target objects, it is necessary to split the multiple first pixel sets to obtain multiple second pixel sets. The multiple second pixel sets can be sorted by quality, and the node coordinates with the quality at which the total number of people in the monitored image is estimated are selected. These coordinates are used as the target localization results of the crowd in the monitored image.
[0126] Figure 5 This is a flowchart of another image processing method according to an embodiment of this application, such as... Figure 5 As shown, the method includes:
[0127] Step S501: Obtain the density estimation output of the general crowd density estimation model on the high-density image.
[0128] The high-density images mentioned above can be used as monitoring images.
[0129] Optionally, for a high-resolution RGB image extracted from a video stream, with shape (H, W, 3), a low-resolution density map is typically obtained using a crowd density estimation model. This map is a matrix M of shape (H / 4, W / 4), where the elements are floating-point numbers representing the probability of an object appearing at each pixel location. Therefore, summing the elements of the matrix yields the total number of people K in the image. .
[0130] Step S502: Scan each element in the density matrix M one by one and determine whether the element is the point with the largest floating-point density value in its 3x3 neighborhood. If it is, push it into the candidate point stack S. If it is not, push it into the child node stack C_S of the peak point C in its neighborhood.
[0131] The maximum floating-point density value mentioned above can be the maximum density value within a preset area.
[0132] The aforementioned candidate points can be candidate pixels.
[0133] When pushing an element onto the stack, the pixel coordinates (i, j) and its floating-point density value v in M (hereinafter referred to as mass) are stored simultaneously. The radiation range of each element is also stored as its own coordinates. Here, the radiation range refers to the coordinate range of each element as the descendant node of the parent node.
[0134] Step S503: The quality of a candidate point is only its own quality. It can be updated to its own quality v' by summing the quality of all descendant nodes of the candidate point to itself using a depth-first search algorithm.
[0135] All of the above-mentioned descendant nodes can include child nodes, child nodes of child nodes, etc.
[0136] At the same time, the radiation range value is updated to the top left and bottom right positions of the candidate node that are furthest from its own coordinates among all descendant nodes. In other words, the radiation range of the candidate point is updated to the maximum range of all its descendant nodes, providing coordinate basis for extracting candidate nodes in step S504.
[0137] Step S504: Starting from the position C' with the highest density in the radiation range of the candidate node, gradually diffuse outwards, treating these diffused positions as child nodes of C', and adding their mass to C' until the total mass of C' exceeds 1.0. Add C' to the candidate node stack, and set the density value of the positions belonging to C' within the original node C's range to 0. At this time, the total mass of node C is reduced accordingly. Repeat this step until the total mass of the original node C is lower than 0.
[0138] If the quality sum of the original node C is less than 0, it means that candidate nodes have been extracted from the original node C.
[0139] After the quality aggregation step, candidate nodes with a quality exceeding 1.0 (e.g., quality V) indicate that there are more than one target within the radiation range of that candidate node. Therefore, a split operation needs to be performed on this candidate node. Specifically, candidate node C can be popped from the stack first.
[0140] Step S505: Sort all candidate points by quality and select the coordinates of the TOPK node.
[0141] The K mentioned above represents the total number of people estimated in the high-density image.
[0142] This application employs a local density hill-climbing algorithm, establishing a rigorous node tree structure from the density map. The density map is divided into density clusters of varying quality, and a depth-first search algorithm is used to aggregate node quality. The quality of each parent node encompasses the quality of all its child nodes. For each parent node with a quality greater than 1 (representing more than 1 person), a recursive splitting operation is performed, ensuring that the number of coordinates corresponding to each parent node is exactly equal to the rounded value of its total quality. This avoids the problem of losing target numbers in extremely dense regions. After aggregation and splitting operations, all candidate nodes are sorted by quality. If the total number of people is N, the top N candidate nodes are selected as the final coordinate output, thus avoiding the problem of the number of coordinates not matching the total number of people, and also avoiding threshold sensitivity issues.
[0143] Based on a self-designed density hill-climbing algorithm and depth-first quality aggregation operation, this application produces more accurate coordinates of target objects from the density estimation results. The number of target objects in this application is consistent with the number of coordinates in the density estimation results, providing a more refined structured output for population density monitoring, and providing a more intuitive presentation and wider application scenarios for the algorithm.
[0144] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0145] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0146] Example 2
[0147] According to an embodiment of this application, an image processing method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0148] Figure 6 This is a flowchart of an image processing method according to Embodiment 2 of this application, as follows: Figure 6 As shown, the method may include the following steps:
[0149] Step S602: Obtain a monitoring image by monitoring the activity area using monitoring equipment.
[0150] The monitored images include the target population.
[0151] Step S604: Perform density estimation on the monitoring image to obtain the density estimation result of the target population.
[0152] The density estimation results include multiple density values used to characterize the probability that a target population exists in multiple pixels of the monitored image.
[0153] Step S606: Based on the density estimation results, determine the target pixel from multiple pixels.
[0154] Among them, the target pixel contains the target group.
[0155] Step S608: Based on the position of the target pixel in the monitoring image, obtain the target location result of the target crowd in the activity area.
[0156] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0157] Example 3
[0158] According to an embodiment of this application, an image processing method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0159] Figure 7 This is a flowchart of an image processing method according to Embodiment 3 of this application, as follows: Figure 7 As shown, the method may include the following steps:
[0160] Step S702: In response to the input command applied to the operation interface, display the monitoring image of the area to be monitored on the operation interface.
[0161] The monitored images contain the target object.
[0162] Step S704: In response to the positioning command applied to the operation interface, display the target positioning result of the target object in the area to be monitored on the operation interface.
[0163] The target localization result is determined by the position of the target pixel in the monitoring image, which is determined from multiple pixels in the monitoring image. The target pixel is determined based on the density estimation result of the target object. The density estimation result is obtained by performing density estimation on the monitoring image. The multiple density values contained in the density estimation result are used to characterize the probability that the target object exists in multiple pixels.
[0164] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0165] Example 4
[0166] According to the embodiments of this application, an image processing method applicable to virtual reality scenarios such as virtual reality (VR) devices and augmented reality (AR) devices is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0167] Figure 8 This is a flowchart of an image processing method according to Embodiment 4 of this application. Figure 8 As shown, the method may include the following steps:
[0168] Step S802: Monitor the monitoring image of the area to be monitored using monitoring equipment.
[0169] The monitored images contain the target object.
[0170] Step S804: Display the monitoring image on the presentation screen of the virtual reality (VR) device or augmented reality (AR) device.
[0171] Step S806: Based on the density estimation results, determine the target pixel from multiple pixels.
[0172] Among them, the target pixel contains the target object.
[0173] Step S808: Based on the position of the target pixel in the monitoring image, obtain the target location result of the target object in the area to be monitored.
[0174] Step S810: Drive the VR or AR device to render and display the target positioning result.
[0175] Optionally, in this embodiment, the image processing method described above can be applied to a hardware environment consisting of a server and a virtual reality device. The target location result is displayed on the screen of the virtual reality (VR) device or augmented reality (AR) device. The server can be a server corresponding to a media file operator. The aforementioned network includes, but is not limited to, a wide area network (WAN), a metropolitan area network (MAN), or a local area network (LAN). The aforementioned virtual reality device is not limited to, for example, a virtual reality headset, virtual reality glasses, or a standalone virtual reality device.
[0176] Optionally, the virtual reality device includes: a memory, a processor, and a transmission device. The memory is used to store an application, which can be used to execute:
[0177] The monitoring equipment monitors an area to be monitored, where the monitoring image contains the target object; the monitoring image is displayed on the screen of a virtual reality (VR) device or an augmented reality (AR) device; density estimation is performed on the monitoring image to obtain the density estimation result of the target object, where the density estimation result contains multiple density values used to characterize the probability that the target object exists in multiple pixels in the monitoring image; based on the density estimation result, the target pixel is determined from the multiple pixels, where the target pixel contains the target object; based on the position of the target pixel in the monitoring image, the target location result of the target object in the area to be monitored is obtained; the VR device or AR device is driven to render and display the target location result.
[0178] It should be noted that the image processing method described above in this embodiment, when applied to VR or AR devices, may include... Figure 8 The method of the illustrated embodiment is used to drive a VR device or AR device to display the target positioning result.
[0179] Optionally, the processor in this embodiment can invoke the application stored in the memory via the transmission device to perform the above steps. The transmission device can receive media files sent by the server via a network, and can also be used for data transmission between the processor and the memory.
[0180] Optionally, in a virtual reality device, there is a head-mounted display with eye tracking. The screen in the HMD is used to display the video footage. The eye tracking module in the HMD is used to acquire the real-time movement trajectory of the user's eyes. The tracking system is used to track the user's position and movement information in real three-dimensional space. The computing and processing unit is used to acquire the user's real-time position and movement information from the tracking system and calculate the three-dimensional coordinates of the user's head in the virtual three-dimensional space, as well as the user's field of vision orientation in the virtual three-dimensional space.
[0181] In this embodiment, the virtual reality device can be connected to a terminal, and the terminal and the server are connected via a network. The virtual reality device is not limited to virtual reality headsets, virtual reality glasses, virtual reality all-in-one machines, etc., and the terminal is not limited to PCs, mobile phones, tablets, etc. The server can be a server corresponding to a media file operator, and the network includes, but is not limited to, wide area networks, metropolitan area networks, or local area networks.
[0182] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0183] Example 5
[0184] According to an embodiment of this application, an image processing method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0185] Figure 9 This is a flowchart of an image processing method according to Embodiment 5 of this application, as follows: Figure 9 As shown, the method may include the following steps:
[0186] Step S902: Obtain the monitoring image of the area to be monitored by calling the first interface.
[0187] The first interface includes a first parameter, the value of which is a monitoring image, and the monitoring image contains the target object.
[0188] Step S904: Perform density estimation on the monitoring image to obtain the density estimation result of the target object.
[0189] The density estimation results include multiple density values used to characterize the probability that a target object exists in multiple pixels of the monitored image.
[0190] Step S906: Based on the density estimation results, determine the target pixel from multiple pixels.
[0191] Among them, the target pixel contains the target object.
[0192] Step S908: Based on the position of the target pixel in the monitoring image, obtain the target location result of the target object in the area to be monitored.
[0193] Step S910: Output the target location result by calling the second interface.
[0194] The second interface includes a second parameter, the value of which is the target location result.
[0195] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0196] Example 6
[0197] According to embodiments of this application, an image processing apparatus for implementing the above-described image processing method is also provided. Figure 10 This is a schematic diagram of an image processing apparatus according to Embodiment 6 of this application, as shown below. Figure 10 As shown, the device 1000 includes: an acquisition module 1002, an estimation module 1004, a determination module 1006, and a generation module 1008.
[0198] The system comprises the following modules: an acquisition module for acquiring a monitoring image of the area to be monitored, wherein the monitoring image contains the target object; an estimation module for performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result contains multiple density values used to characterize the probability that multiple pixels in the monitoring image contain the target object; a determination module for determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains the target object; and a generation module for obtaining the target location result of the target object in the area to be monitored based on the position of the target pixel in the monitoring image.
[0199] It should be noted that the acquisition module 1002, estimation module 1004, determination module 1006, and generation module 1008 mentioned above correspond to steps S302 to S308 in Embodiment 1. The four modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the above modules, as part of the device, can run on the computer terminal provided in Embodiment 1.
[0200] In the above embodiments of this application, the determining module includes: a partitioning unit, an aggregation unit, a splitting unit, and a first determining unit.
[0201] The system includes a partitioning unit for dividing multiple pixels into multiple first pixel sets based on density estimation results, wherein pixels in different first pixel sets contain different objects; an aggregation unit for aggregating the density values of pixels in each first pixel set to obtain the quality of each first pixel set; a splitting unit for splitting a preset pixel set in the multiple first pixel sets based on the quality of the multiple first pixel sets to obtain multiple second pixel sets, wherein the quality of the preset pixel sets is greater than a first preset value; and a first determining unit for determining a target pixel from the multiple second pixel sets based on the quality of the multiple second pixel sets.
[0202] In the above embodiments of this application, the partitioning unit is further configured to traverse each pixel in the monitoring image and determine whether the density value corresponding to the pixel in the density estimation result is the maximum density value among all the density values corresponding to all pixels in the preset region, wherein the preset region is used to characterize the region composed of pixels centered on the pixel and adjacent to the pixel in the monitoring image; the partitioning unit is further configured to establish a new set and store the pixel in the new set when the density value corresponding to the pixel is the maximum density value, wherein the new set is used to generate multiple first pixel sets; the partitioning unit is further configured to store the pixel in the set containing the maximum density value among the multiple first pixel sets when the density value corresponding to the pixel is not the maximum density value.
[0203] In the above embodiments of this application, the aggregation unit is further configured to determine the density value corresponding to the parent node and the density value corresponding to the child node in the tree structure, wherein the child node is a descendant node of the parent node in the tree structure; the aggregation unit is further configured to aggregate the density value corresponding to the parent node and the density value corresponding to the child node to obtain the quality of the parent node; the aggregation unit is further configured to determine the quality of the parent node in the tree structure as the quality corresponding to each first pixel set.
[0204] In the above embodiments of this application, the splitting unit is further configured to perform step A, obtaining the radiation range of a preset pixel set, wherein the radiation range is used to characterize the coordinate range of all pixels in the preset pixel set; step B, determining the pixel corresponding to the maximum density value within the radiation range to obtain candidate pixels; step C, performing a splitting operation on the preset pixel set based on the candidate pixels to obtain a first set and a second set after splitting, wherein the first set after splitting contains candidate pixels and associated pixels that are related to the candidate pixels, and the second set after splitting contains other pixels in the preset pixel set besides the pixels in the first set after splitting; step D, when the mass corresponding to the second set after splitting is greater than a second preset value, updating the radiation range to the coordinate range of all pixels in the second set after splitting, and repeating steps B and C until the mass corresponding to the second set after splitting is less than or equal to the second preset value, to obtain multiple second pixel sets, wherein the second preset value is less than the first preset value.
[0205] In the above embodiments of this application, the splitting unit is further configured to perform multiple diffusions centered on the candidate pixel, and to accumulate the density value corresponding to the pixel at each diffusion position in the preset pixel set with the accumulation result of the previous diffusion position to obtain the accumulation result of the diffusion position. The accumulation result of the first diffusion position is obtained by accumulating the density value corresponding to the pixel at the first diffusion position with the density value corresponding to the candidate pixel. Each diffusion position is the position of the pixel in the monitoring image that is adjacent to the pixel at the previous diffusion position and far away from the candidate pixel. The first diffusion position is the position of the pixel adjacent to the candidate pixel. The splitting unit is further configured to obtain a split first set based on the candidate pixel and the pixels at all diffusion positions before the current diffusion position if the accumulation result at the current diffusion position is greater than a first preset value. The splitting unit is further configured to delete the pixels in the split first set from the preset pixel set to obtain a split second set.
[0206] In the above embodiments of this application, each first pixel set adopts a tree structure. After splitting the preset pixel set based on the candidate pixels to obtain the split first set and the second set, the quality of the node corresponding to the candidate pixel is set to a third preset value.
[0207] In the above embodiments of this application, the determining module includes: a sorting unit, an acquisition unit, and a second determining unit.
[0208] The sorting unit is used to sort multiple second pixel sets according to the quality corresponding to multiple second pixel sets to obtain a sorting result; the acquisition unit is used to acquire a preset number of second pixel sets in the sorting result to obtain a target pixel set, wherein the preset number is the number of target objects; the second determination unit is used to determine the pixel point corresponding to the maximum density value from the pixels in the target pixel set as the target pixel point.
[0209] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0210] Example 7
[0211] According to embodiments of this application, an image processing apparatus for implementing the above-described image processing method is also provided. Figure 11 This is a schematic diagram of an image processing apparatus according to Embodiment 7 of this application, as shown below. Figure 11 As shown, the device 1100 includes: a monitoring module 1102, an estimation module 1104, a determination module 1106, a generation module 1108, and an output module 1110.
[0212] The monitoring module obtains a monitoring image of the activity area by monitoring equipment, and the monitoring image contains the target crowd; the estimation module is used to perform density estimation on the monitoring image to obtain the density estimation result of the target crowd, and the density estimation result contains multiple density values to characterize the probability that multiple pixels in the monitoring image contain the target crowd; the determination module is used to determine the target pixel from multiple pixels based on the density estimation result, and the target pixel contains the target crowd; the generation module is used to obtain the target location result of the target crowd in the activity area based on the position of the target pixel in the monitoring image.
[0213] It should be noted that the monitoring module 1102, estimation module 1104, determination module 1106, generation module 1108, and output module 1110 mentioned above correspond to steps S602 to S608 in Embodiment 2. The four modules and their corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules, as part of the device, can run on the computer terminal provided in Embodiment 1.
[0214] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0215] Example 8
[0216] According to embodiments of this application, an image processing apparatus for implementing the above-described image processing method is also provided. Figure 12 This is a schematic diagram of an image processing apparatus according to Embodiment 8 of this application, as shown below. Figure 12 As shown, the device 1200 includes: a first display module 1202 and a second display module 1204.
[0217] The first display module is used to respond to input commands applied to the operation interface and display a monitoring image of the area to be monitored on the operation interface, wherein the monitoring image includes the target object; the second display module is used for
[0218] In response to the positioning command applied to the operation interface, the target positioning result of the target object in the area to be monitored is displayed on the operation interface. The target positioning result is determined by the position of the target pixel in the monitoring image determined from multiple pixels in the monitoring image. The target pixel is determined based on the density estimation result of the target object. The density estimation result is obtained by performing density estimation on the monitoring image. The multiple density values contained in the density estimation result are used to characterize the probability that the target object exists in multiple pixels.
[0219] It should be noted that the first display module 1202 and the second display module 1204 mentioned above correspond to steps S702 to S704 in Embodiment 3. The two modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules, as part of the device, can run in the computer terminal provided in Embodiment 1.
[0220] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0221] Example 9
[0222] According to embodiments of this application, an image processing apparatus for implementing the above-described image processing method is also provided. Figure 13 This is a schematic diagram of an image processing apparatus according to Embodiment 9 of this application, as shown below. Figure 13 As shown, the device 1300 includes: a monitoring module 1302, a display module 1304, an estimation module 1306, a determination module 1308, a generation module 1310, and a driving module 1312.
[0223] The system comprises the following modules: a monitoring module for monitoring images of the area to be monitored using monitoring equipment, wherein the monitoring images contain the target object; a display module for displaying the monitoring images on the presentation screen of a virtual reality (VR) device or an augmented reality (AR) device; an estimation module for performing density estimation on the monitoring images to obtain density estimation results for the target object, wherein the density estimation results contain multiple density values used to characterize the probability that multiple pixels in the monitoring image contain the target object; a determination module for determining the target pixel from multiple pixels based on the density estimation results, wherein the target pixel contains the target object; a generation module for obtaining the target location result of the target object in the area to be monitored based on the position of the target pixel in the monitoring image; and a driving module for driving the VR or AR device to render and display the target location result.
[0224] It should be noted that the monitoring module 1302, display module 1304, estimation module 1306, determination module 1308, generation module 1310, and driving module 1312 mentioned above correspond to steps S802 to S812 in Embodiment 4. The five modules and their corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the above modules, as part of the device, can run on the computer terminal provided in Embodiment 1.
[0225] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0226] Example 10
[0227] According to embodiments of this application, an image processing apparatus for implementing the above-described image processing method is also provided. Figure 14 This is a schematic diagram of an image processing apparatus according to Embodiment 10 of this application, as shown below. Figure 14 As shown, the device 1400 includes: a calling module 1402, an estimation module 1404, a determination module 1406, a generation module 1408, and an output module 1410.
[0228] The system comprises the following modules: a calling module for acquiring a monitoring image of the area to be monitored by calling a first interface, wherein the first interface includes a first parameter whose value is the monitoring image containing the target object; an estimation module for performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result includes multiple density values used to characterize the probability that multiple pixels in the monitoring image contain the target object; a determination module for determining a target pixel from multiple pixels based on the density estimation result, wherein the target pixel contains the target object; a generation module for obtaining a target location result of the target object in the area to be monitored based on the position of the target pixel in the monitoring image; and an output module for outputting the target location result by calling a second interface, wherein the second interface includes a second parameter whose value is the target location result.
[0229] It should be noted that the aforementioned calling module 1402, estimation module 1404, determination module 1406, generation module 1408, and output module 1410 correspond to steps S902 to S910 in Embodiment 5. The five modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the aforementioned modules, as part of the device, can run on the computer terminal provided in Embodiment 1.
[0230] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0231] Example 11
[0232] Embodiments of this application may provide an electronic device, which may be any one of a group of electronic devices. Optionally, in this embodiment, the aforementioned electronic device may also be replaced by a terminal device such as a mobile terminal.
[0233] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0234] In this embodiment, the above-mentioned electronic device can execute the program code of the following steps in the image processing method: acquiring a monitoring image of the area to be monitored, wherein the monitoring image contains a target object; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result contains multiple density values used to characterize the probability that multiple pixels in the monitoring image contain a target object; determining a target pixel from multiple pixels based on the density estimation result, wherein the target pixel contains a target object; and obtaining a target location result of the target object in the area to be monitored based on the position of the target pixel in the monitoring image.
[0235] Optionally, Figure 15 This is a structural block diagram of a computer terminal according to an embodiment of this application. Figure 15 As shown, the computer terminal A may include: one or more (only one is shown in the figure) processors and memory.
[0236] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the image processing method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned image processing method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0237] The processor can access information and application programs stored in the memory via a transmission device to perform the following steps: acquiring a monitoring image of the area to be monitored, wherein the monitoring image contains a target object; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result contains multiple density values used to characterize the probability that a target object exists in multiple pixels in the monitoring image; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains a target object; and obtaining the target location result of the target object in the area to be monitored based on the position of the target pixel in the monitoring image.
[0238] Optionally, the processor may also execute program code for the following steps: based on the density estimation results, dividing multiple pixels into multiple first pixel sets, wherein pixels in different first pixel sets contain different objects; aggregating the density values corresponding to pixels in each first pixel set to obtain the quality corresponding to each first pixel set; performing a splitting operation on a preset pixel set in the multiple first pixel sets based on the quality corresponding to the multiple first pixel sets to obtain multiple second pixel sets, wherein the quality corresponding to the preset pixel set is greater than a first preset value; and determining the target pixel from the multiple second pixel sets based on the quality corresponding to the multiple second pixel sets.
[0239] Optionally, the processor may also execute program code for the following steps: traversing each pixel in the monitored image, determining whether the density value corresponding to the pixel in the density estimation result is the maximum density value among all pixel values in a preset region, wherein the preset region is used to characterize the region in the monitored image composed of pixels centered on the pixel and adjacent to the pixel; if the density value corresponding to the pixel is the maximum density value, establishing a new set and storing the pixel in the new set, wherein the new set is used to generate multiple first pixel sets; if the density value corresponding to the pixel is not the maximum density value, storing the pixel in the set containing the maximum density value among the multiple first pixel sets.
[0240] Optionally, the processor may also execute program code that performs the following steps: determining the density value corresponding to the parent node and the density value corresponding to the child node in the tree structure, wherein the child node is a descendant node of the parent node in the tree structure; aggregating the density value corresponding to the parent node and the density value corresponding to the child node to obtain the quality of the parent node; and determining the quality of the parent node in the tree structure to be the quality corresponding to each first pixel set.
[0241] Optionally, the processor may also execute program code with the following steps: Step A, obtaining the radiation range of a preset pixel set, wherein the radiation range is used to characterize the coordinate range of all pixels in the preset pixel set; Step B, determining the pixel corresponding to the maximum density value within the radiation range to obtain candidate pixels; Step C, performing a splitting operation on the preset pixel set based on the candidate pixels to obtain a first set and a second set after splitting, wherein the first set after splitting contains candidate pixels and associated pixels that are related to the candidate pixels, and the second set after splitting contains other pixels in the preset pixel set except for the pixels in the first set after splitting; Step D, when the quality corresponding to the second set after splitting is greater than a second preset value, updating the radiation range to the coordinate range of all pixels in the second set after splitting, and repeating Step B and Step C until the quality corresponding to the second set after splitting is less than or equal to the second preset value, to obtain multiple second pixel sets, wherein the second preset value is less than the first preset value.
[0242] Optionally, the processor may also execute program code with the following steps: performing multiple diffusions centered on a candidate pixel; accumulating the density value of the pixel at each diffusion position in the preset pixel set with the accumulated result of the previous diffusion position to obtain the accumulated result of that diffusion position; wherein the accumulated result of the first diffusion position is obtained by accumulating the density value of the pixel at the first diffusion position with the density value of the candidate pixel; each diffusion position is the location of a pixel in the monitored image that is adjacent to the pixel at the previous diffusion position and far from the candidate pixel; the first diffusion position is the location of a pixel adjacent to the candidate pixel; if the accumulated result at that diffusion position is greater than a first preset value, obtaining a split first set based on the candidate pixel and the pixels at all diffusion positions before that diffusion position; deleting the pixels in the split first set from the preset pixel set to obtain a split second set.
[0243] Optionally, the processor may also execute program code with the following steps: each first pixel set adopts a tree structure, and after splitting the preset pixel set based on the candidate pixels to obtain the split first set and second set, the quality of the node corresponding to the candidate pixel is set to a third preset value.
[0244] Optionally, the processor may also execute program code that performs the following steps: sorting multiple second pixel sets according to the quality corresponding to multiple second pixel sets to obtain a sorting result; obtaining a preset number of second pixel sets in the sorting result to obtain a target pixel set, wherein the preset number is the number of target objects; and determining the pixel point corresponding to the maximum density value from the pixels in the target pixel set as the target pixel point.
[0245] The processor can access information and applications stored in memory via a transmission device to perform the following steps: monitoring an active area using a monitoring device to obtain a monitoring image, wherein the monitoring image contains a target crowd; performing density estimation on the monitoring image to obtain a density estimation result of the target crowd, wherein the density estimation result contains multiple density values used to characterize the probability that multiple pixels in the monitoring image contain the target crowd; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains the target crowd; and obtaining the target location result of the target crowd in the active area based on the position of the target pixel in the monitoring image.
[0246] The processor can invoke information and application programs stored in memory via a transmission device to perform the following steps: responding to an input command applied to the operation interface, displaying a monitoring image of the area to be monitored on the operation interface, wherein the monitoring image contains a target object; responding to a positioning command applied to the operation interface, displaying the target positioning result of the target object in the area to be monitored on the operation interface, wherein the target positioning result is determined by the position of a target pixel in the monitoring image determined from multiple pixels in the monitoring image, the target pixel being determined based on the density estimation result of the target object, the density estimation result being obtained by performing density estimation on the monitoring image, and the multiple density values included in the density estimation result being used to characterize the probability that the target object exists in the multiple pixels.
[0247] The processor can access information and applications stored in memory via a transmission device to perform the following steps: monitoring a monitoring image of a region to be monitored using a monitoring device, wherein the monitoring image contains a target object; displaying the monitoring image on the display screen of a virtual reality (VR) device or an augmented reality (AR) device; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result contains multiple density values used to characterize the probability that a target object exists in multiple pixels in the monitoring image; determining a target pixel from multiple pixels based on the density estimation result, wherein the target pixel contains a target object; obtaining a target location result of the target object in the region to be monitored based on the position of the target pixel in the monitoring image; and driving the VR or AR device to render and display the target location result.
[0248] The processor can invoke information and application programs stored in the memory via a transmission device to perform the following steps: acquiring a monitoring image of the area to be monitored by calling a first interface, wherein the first interface includes a first parameter, the parameter value of which is the monitoring image, and the monitoring image contains a target object; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result includes multiple density values used to characterize the probability that multiple pixels in the monitoring image contain a target object; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains a target object; obtaining a target location result of the target object in the area to be monitored based on the position of the target pixel in the monitoring image; and outputting the target location result by calling a second interface, wherein the second interface includes a second parameter, the parameter value of which is the target location result.
[0249] In this embodiment, a monitoring image of the area to be monitored is first obtained, which contains a target object. Density estimation is performed on the monitoring image to obtain a density estimation result for the target object. The density estimation result includes multiple density values used to characterize the probability that a target object exists among multiple pixels in the monitoring image. Based on the density estimation result, a target pixel is determined from among the multiple pixels, indicating that the target object exists within the target pixel. Based on the position of the target pixel in the monitoring image, the target location result of the target object in the area to be monitored is obtained, thus achieving the location of the object in the monitoring image. It is noteworthy that density estimation can be performed on the monitoring image to obtain a density estimation result for the target object. Based on this density estimation result, pixels containing the target object can be determined from among multiple pixels, avoiding the location of pixels that do not contain the target object. This improves the accuracy of the target object location result. By obtaining the target object location result, the output information of the target object can be increased, thereby solving the technical problem that related algorithms struggle to output more information about the target object in the monitoring image.
[0250] Those skilled in the art will understand that Figure 15 The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a mobile internet device (MID), a PAD, and other terminal devices. Figure 15 This does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include components that are more advanced than those described above. Figure 15 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 15 The different configurations shown.
[0251] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0252] Example 12
[0253] Embodiments of this application also provide a computer-readable storage medium. Optionally, in this embodiment, the computer-readable storage medium can be used to store the program code executed by the image processing method provided in Embodiment 1.
[0254] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in the AR / VR device terminal group in the AR / VR device network, or in any mobile terminal in the mobile terminal group.
[0255] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: acquiring a monitoring image of the area to be monitored, wherein the monitoring image contains a target object; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result contains multiple density values used to characterize the probability that multiple pixels in the monitoring image contain a target object; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains a target object; and obtaining a target location result of the target object in the area to be monitored based on the position of the target pixel in the monitoring image.
[0256] Optionally, the storage medium is further configured to store program code for performing the following steps: based on the density estimation results, dividing multiple pixels into multiple first pixel sets, wherein pixels in different first pixel sets contain different objects; aggregating the density values corresponding to pixels in each first pixel set to obtain the quality corresponding to each first pixel set; performing a splitting operation on a preset pixel set in the multiple first pixel sets based on the quality corresponding to the multiple first pixel sets to obtain multiple second pixel sets, wherein the quality corresponding to the preset pixel sets is greater than a first preset value; and determining the target pixel from the multiple second pixel sets based on the quality corresponding to the multiple second pixel sets.
[0257] Optionally, the storage medium is further configured to store program code for performing the following steps: traversing each pixel in the monitored image, determining whether the density value corresponding to the pixel in the density estimation result is the maximum density value among all the density values corresponding to pixels in a preset region, wherein the preset region is used to characterize the region in the monitored image composed of pixels centered on the pixel and adjacent to the pixel; if the density value corresponding to the pixel is the maximum density value, establishing a new set and storing the pixel in the new set, wherein the new set is used to generate multiple first pixel sets; if the density value corresponding to the pixel is not the maximum density value, storing the pixel in the set among the multiple first pixel sets that stores the maximum density value.
[0258] Optionally, the storage medium is further configured to store program code for performing the following steps: determining the density value corresponding to the parent node and the density value corresponding to the child node in the tree structure, wherein the child node is a descendant node of the parent node in the tree structure; aggregating the density value corresponding to the parent node and the density value corresponding to the child node to obtain the quality of the parent node; and determining the quality of the parent node in the tree structure to be the quality corresponding to each first pixel set.
[0259] Optionally, the storage medium is further configured to store program code for performing the following steps: Step A, obtaining the radiation range of a preset pixel set, wherein the radiation range is used to characterize the coordinate range of all pixels in the preset pixel set; Step B, determining the pixel corresponding to the maximum density value within the radiation range to obtain candidate pixels; Step C, performing a splitting operation on the preset pixel set based on the candidate pixels to obtain a first set and a second set after splitting, wherein the first set after splitting contains candidate pixels and associated pixels that are related to the candidate pixels, and the second set after splitting contains other pixels in the preset pixel set besides the pixels in the first set after splitting; Step D, when the quality corresponding to the second set after splitting is greater than a second preset value, updating the radiation range to the coordinate range of all pixels in the second set after splitting, and repeating Step B and Step C until the quality corresponding to the second set after splitting is less than or equal to the second preset value, to obtain multiple second pixel sets, wherein the second preset value is less than the first preset value.
[0260] Optionally, the storage medium is further configured to store program code for performing the following steps: performing multiple diffusions centered on a candidate pixel, accumulating the density value corresponding to the pixel at each diffusion position in the preset pixel set with the accumulated result of the previous diffusion position to obtain the accumulated result of the diffusion position, wherein the accumulated result of the first diffusion position is obtained by accumulating the density value corresponding to the pixel at the first diffusion position with the density value corresponding to the candidate pixel, each diffusion position is the position of the pixel in the monitoring image that is adjacent to the pixel at the previous diffusion position and far away from the candidate pixel, and the first diffusion position is the position of the pixel adjacent to the candidate pixel; if the accumulated result of the diffusion position is greater than a first preset value, obtaining a split first set based on the candidate pixel and the pixels at all diffusion positions before the current diffusion position; deleting the pixels in the split first set from the preset pixel set to obtain a split second set.
[0261] Optionally, the storage medium is further configured to store program code for performing the following steps: each first pixel set adopts a tree structure, and after splitting the preset pixel set based on candidate pixels to obtain the split first set and second set, the quality of the node corresponding to the candidate pixel is set to a third preset value.
[0262] Optionally, the storage medium is further configured to store program code for performing the following steps: sorting multiple second pixel sets according to the quality corresponding to multiple second pixel sets to obtain a sorting result; obtaining a preset number of second pixel sets in the sorting result to obtain a target pixel set, wherein the preset number is the number of target objects; and determining the pixel point corresponding to the maximum density value from the pixels in the target pixel set as the target pixel point.
[0263] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining a monitoring image by monitoring an active area through a monitoring device, wherein the monitoring image contains a target crowd; performing density estimation on the monitoring image to obtain a density estimation result of the target crowd, wherein the density estimation result contains multiple density values used to characterize the probability that multiple pixels in the monitoring image contain the target crowd; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains the target crowd; and obtaining a target location result of the target crowd in the active area based on the position of the target pixel in the monitoring image.
[0264] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: in response to an input command applied to the operation interface, displaying a monitoring image of the area to be monitored on the operation interface, wherein the monitoring image contains a target object; in response to a positioning command applied to the operation interface, displaying a target positioning result of the target object in the area to be monitored on the operation interface, wherein the target positioning result is determined by the position of a target pixel in the monitoring image determined from multiple pixels in the monitoring image, the target pixel is determined based on the density estimation result of the target object, the density estimation result is obtained by performing density estimation on the monitoring image, and the multiple density values included in the density estimation result are used to characterize the probability that the target object exists in the multiple pixels.
[0265] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: monitoring a monitoring image of a region to be monitored using a monitoring device, wherein the monitoring image contains a target object; displaying the monitoring image on the presentation screen of a virtual reality (VR) device or an augmented reality (AR) device; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result includes multiple density values used to characterize the probability that a target object exists in multiple pixels in the monitoring image; determining a target pixel from multiple pixels based on the density estimation result, wherein the target pixel contains a target object; obtaining a target location result of the target object in the region to be monitored based on the position of the target pixel in the monitoring image; and driving the VR device or AR device to render and display the target location result.
[0266] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: acquiring a monitoring image of the area to be monitored by calling a first interface, wherein the first interface includes a first parameter, the parameter value of the first parameter being the monitoring image, and the monitoring image containing a target object; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result includes multiple density values used to characterize the probability that multiple pixels in the monitoring image contain a target object; determining a target pixel from the multiple pixels based on the density estimation result, wherein the target pixel contains a target object; obtaining a target location result of the target object in the area to be monitored based on the position of the target pixel in the monitoring image; and outputting the target location result by calling a second interface, wherein the second interface includes a second parameter, the parameter value of the second parameter being the target location result.
[0267] In this embodiment, a monitoring image of the area to be monitored is first obtained, which contains a target object. Density estimation is performed on the monitoring image to obtain a density estimation result for the target object. The density estimation result includes multiple density values used to characterize the probability that a target object exists among multiple pixels in the monitoring image. Based on the density estimation result, a target pixel is determined from among the multiple pixels, indicating that the target object exists within the target pixel. Based on the position of the target pixel in the monitoring image, the target location result of the target object in the area to be monitored is obtained, thus achieving the location of the object in the monitoring image. It is noteworthy that density estimation can be performed on the monitoring image to obtain a density estimation result for the target object. Based on this density estimation result, pixels containing the target object can be determined from among multiple pixels, avoiding the location of pixels that do not contain the target object. This improves the accuracy of the target object location result. By obtaining the target object location result, the output information of the target object can be increased, thereby solving the technical problem that related algorithms struggle to output more information about the target object in the monitoring image.
[0268] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0269] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0270] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0271] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0272] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0273] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0274] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An image processing method, characterized by, The method comprises the following steps: obtaining a monitoring image of a region to be monitored, wherein the monitoring image contains a target object; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result contains a plurality of density values for representing probabilities of a plurality of pixel points in the monitoring image existing the target object; determining a target pixel point from the plurality of pixel points based on the density estimation result, wherein the target pixel point exists the target object, the target pixel point is determined from a plurality of second pixel sets according to qualities of the plurality of second pixel sets, the plurality of second pixel sets are obtained by performing a splitting operation on a preset pixel set in the plurality of first pixel sets based on qualities of the plurality of first pixel sets, the quality of each first pixel set is obtained by aggregating density values of pixel points in the each first pixel set, the plurality of first pixel sets are obtained by dividing the plurality of pixel points based on the density estimation result, pixel points in different first pixel sets exist different objects, and the quality of the preset pixel set is greater than a first preset value; obtaining a target positioning result of the target object in the region to be monitored based on a position of the target pixel point in the monitoring image.
2. The method of claim 1, wherein, The method for determining a target pixel point from the plurality of pixel points based on the density estimation result comprises the following steps: dividing the plurality of pixel points into a plurality of first pixel sets based on the density estimation result, wherein pixel points in different first pixel sets exist different objects; aggregating density values of pixel points in each first pixel set to obtain a quality corresponding to the each first pixel set; performing a splitting operation on a preset pixel set in the plurality of first pixel sets based on qualities corresponding to the plurality of first pixel sets to obtain a plurality of second pixel sets; determining the target pixel point from the plurality of second pixel sets based on qualities corresponding to the plurality of second pixel sets.
3. The method of claim 2, wherein, The method for dividing the plurality of pixel points into a plurality of first pixel sets based on the density estimation result comprises the following steps: traversing each pixel point in the monitoring image to determine whether a density value corresponding to the pixel point in the density estimation result is a maximum density value in density values corresponding to all pixel points in a preset region, wherein the preset region represents a region in the monitoring image with the pixel point as a center and pixel points adjacent to the pixel point; in a case where the density value corresponding to the pixel point is the maximum density value, establishing a new set and storing the pixel point into the new set, wherein the new set is used to generate the plurality of first pixel sets; in a case where the density value corresponding to the pixel point is not the maximum density value, pushing the pixel point into a first pixel set corresponding to a peak value in a neighborhood of the pixel point.
4. The method of claim 2, wherein, The each first pixel set adopts a tree structure, a pixel point in the each first pixel set corresponds to a node in the tree structure, and an adjacent relationship between the pixel points in the each first pixel set corresponds to a connection relationship between the nodes in the tree structure, wherein the density values corresponding to the pixel points in each first pixel set are aggregated to obtain the quality corresponding to the each first pixel set, comprising: determining the density value corresponding to the parent node and the density value corresponding to the child node in the tree structure, wherein the child node is a descendant node of the parent node in the tree structure; aggregating the density value corresponding to the parent node and the density value corresponding to the child node to obtain the quality of the parent node; determining the quality of the parent node in the tree structure as the quality corresponding to the each first pixel set.
5. The method of claim 2, wherein, Based on the quality corresponding to the plurality of first pixel sets, a preset pixel set in the plurality of first pixel sets is subjected to a splitting operation to obtain a plurality of second pixel sets, comprising: Step A, obtaining a radiation range of the preset pixel set, wherein the radiation range is used to represent the coordinate range of all pixel points in the preset pixel set; Step B, determining the pixel point corresponding to the maximum density value in the radiation range to obtain a candidate pixel; Step C, based on the candidate pixel, the preset pixel set is subjected to a splitting operation to obtain a first set and a second set after splitting, wherein the first set after splitting contains the candidate pixel and the associated pixel having an association relationship with the candidate pixel, and the second set after splitting contains other pixel points in the preset pixel set except the pixel points in the first set after splitting; Step D, when the quality corresponding to the second set after splitting is greater than a second preset value, updating the radiation range to the coordinate range of all pixel points in the second set after splitting, and repeating the above steps B and C until the quality corresponding to the second set after splitting is less than or equal to the second preset value, to obtain the plurality of second pixel sets, wherein the second preset value is less than the first preset value.
6. The method of claim 5, wherein, Based on the candidate pixel, the preset pixel set is subjected to a splitting operation to obtain a first set and a second set after splitting, comprising: diffusing multiple times with the candidate pixel as the center, and accumulating the density value corresponding to the pixel point at each diffusion position in the preset pixel set with the accumulation result of the previous diffusion position to obtain the accumulation result of the diffusion position, wherein the accumulation result of the first diffusion position is obtained by accumulating the density value corresponding to the pixel point at the first diffusion position with the density value corresponding to the candidate pixel, and each diffusion position is a position of a pixel point in the monitoring image adjacent to the pixel point at the previous diffusion position and away from the candidate pixel, and the first diffusion position is a position of a pixel point adjacent to the candidate pixel; in the case where the accumulation result of the diffusion position is greater than the first preset value, based on the candidate pixel and the pixel points at all diffusion positions before the diffusion position, the first set after splitting is obtained; Delete the pixel points in the first set after splitting from the preset pixel set to obtain the second set after splitting.
7. The method of claim 5, wherein, Each first pixel set adopts a tree structure, and after the candidate pixel points are used to split the preset pixel set to obtain the first set and the second set after splitting, the quality of the node corresponding to the candidate pixel points is set as a third preset value.
8. The method of claim 2, wherein, Based on the quality corresponding to the plurality of second pixel sets, the target pixel points are determined from the plurality of second pixel sets, including: Sort the plurality of second pixel sets according to the quality corresponding to the plurality of second pixel sets to obtain a sorting result. Obtain a target pixel set from a preset number of second pixel sets in the sorting result, wherein the preset number is the number of target objects. Determine the pixel point corresponding to the maximum density value from the pixel points in the target pixel set as the target pixel point.
9. An image processing method characterized by, Including: Obtain a monitoring image by monitoring the activity area through a monitoring device, wherein the monitoring image contains a target crowd; Density estimation is performed on the monitoring image to obtain a density estimation result of the target crowd, wherein the plurality of density values contained in the density estimation result are used to represent the probability of the presence of the target crowd in the plurality of pixel points in the monitoring image; Based on the density estimation result, determine the target pixel point from the plurality of pixel points, wherein the target pixel point exists in the target crowd, the target pixel point is determined from the plurality of second pixel sets according to the quality corresponding to the plurality of second pixel sets, the plurality of second pixel sets are obtained by splitting a preset pixel set in the plurality of first pixel sets based on the quality corresponding to the plurality of first pixel sets, the quality corresponding to each first pixel set is obtained by aggregating the density values corresponding to the pixel points in each first pixel set, the plurality of first pixel sets are obtained by dividing the plurality of pixel points based on the density estimation result, the pixel points in different first pixel sets exist in different objects, and the quality corresponding to the preset pixel set is greater than a first preset value; Based on the position of the target pixel point in the monitoring image, obtain a target positioning result of the target crowd in the activity area.
10. An image processing method characterized by, Including: In response to an input instruction acting on an operation interface, display a monitoring image of a region to be monitored on the operation interface, wherein the monitoring image contains a target object; In response to a positioning instruction acting on the operation interface, a target positioning result of the target object in the to-be-monitored region is displayed on the operation interface, wherein the target positioning result is determined by a position of a target pixel point in the monitoring image, the target pixel point is determined based on a density estimation result of the target object, the density estimation result is obtained by performing density estimation on the monitoring image, a plurality of density values contained in the density estimation result are used to represent probabilities of a plurality of pixel points existing the target object, the target pixel point is determined from a plurality of second pixel sets according to qualities corresponding to the plurality of second pixel sets, the plurality of second pixel sets are obtained by performing a splitting operation on a preset pixel set in a plurality of first pixel sets based on qualities corresponding to the plurality of first pixel sets, a quality corresponding to each first pixel set is obtained by aggregating density values corresponding to pixel points in the each first pixel set, the plurality of first pixel sets are obtained by dividing the plurality of pixel points based on the density estimation result, pixel points in different first pixel sets exist different objects, and a quality corresponding to the preset pixel set is greater than a first preset value.
11. An image processing method, characterized by, Comprise: monitoring a monitoring image of a to-be-monitored region by a monitoring device, wherein the monitoring image contains a target object; displaying the monitoring image on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device; performing density estimation on the monitoring image to obtain a density estimation result of the target object, wherein a plurality of density values contained in the density estimation result are used to represent probabilities of a plurality of pixel points in the monitoring image existing the target object; determining a target pixel point from the plurality of pixel points based on the density estimation result, wherein the target pixel point exists the target object, the target pixel point is determined from a plurality of second pixel sets according to qualities corresponding to the plurality of second pixel sets, the plurality of second pixel sets are obtained by performing a splitting operation on a preset pixel set in a plurality of first pixel sets based on qualities corresponding to the plurality of first pixel sets, a quality corresponding to each first pixel set is obtained by aggregating density values corresponding to pixel points in the each first pixel set, the plurality of first pixel sets are obtained by dividing the plurality of pixel points based on the density estimation result, pixel points in different first pixel sets exist different objects, and a quality corresponding to the preset pixel set is greater than a first preset value; obtaining a target positioning result of the target object in the to-be-monitored region based on a position of the target pixel point in the monitoring image; driving the VR device or the AR device to render and display the target positioning result.
12. An image processing method, characterized by, Comprise: obtaining a monitoring image of a to-be-monitored region by calling a first interface, wherein the first interface comprises a first parameter, a parameter value of the first parameter is the monitoring image, and the monitoring image contains a target object; perform density estimation on the monitoring image to obtain a density estimation result of the target object, wherein the density estimation result contains a plurality of density values for representing probabilities of the plurality of pixel points in the monitoring image existing the target object; determine a target pixel point from the plurality of pixel points based on the density estimation result, wherein the target pixel point exists the target object, the target pixel point is determined from a plurality of second pixel sets according to qualities of the plurality of second pixel sets, the plurality of second pixel sets are obtained by performing a splitting operation on a preset pixel set in the plurality of first pixel sets based on qualities of the plurality of first pixel sets, the quality of each first pixel set is obtained by aggregating density values of pixel points in the each first pixel set, the plurality of first pixel sets are obtained by dividing the plurality of pixel points based on the density estimation result, and pixel points in different first pixel sets exist different objects, and the quality of the preset pixel set is greater than a first preset value; obtain a target positioning result of the target object in the to-be-monitored region based on a position of the target pixel point in the monitoring image; output the target positioning result by calling a second interface, wherein the second interface includes a second parameter, and a parameter value of the second parameter is the target positioning result.
13. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a stored program, wherein the program controls a device where the computer readable storage medium is located to perform the image processing method in any one of claims 1 to 12 when the program is running.
14. An electronic device, comprising: comprise: a processor; a memory connected to the processor, configured to provide the processor with instructions for processing the image processing method in any one of claims 1 to 12.
Citation Information
Patent Citations
Target quantity determination method, device and equipment and storage medium
CN111178235A