Image Data Query Method, Device, Electronic Device and Storage Medium
By setting static and dynamic tags for the camera and using the index table to quickly find camera information, the problem of slow image data query speed in multitasking camera environment is solved, and fast and accurate image data positioning is achieved.
Patent Information
- Application Number
- CN202110807754.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-16
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-07-16
AI Technical Summary
In a multitasking camera environment, image data query speed is slow, making it difficult to quickly locate the required information among many cameras and massive image data.
By setting static tags and/or dynamic tags for the camera, searching camera information based on points and content, so as to quickly locate image data, including point-based static tags and content-based dynamic tags, and using an index table to achieve rapid query.
In the case of multiple cameras and massive image data, the query speed and accuracy of image data are improved and the query time is reduced.
Smart Images

Figure CN114186091B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data management, and in particular, to an image data query method, apparatus, electronic device, and storage medium. Background Art
[0002] With the development of image processing technology, a large amount of image data is required to support various image processing scenarios. The image data is obtained by capturing different scenarios through a camera device. For example, corresponding image data is obtained by capturing a face or a vehicle through a camera. The captured image data is stored in an image library and queried through a front end when needed. With the enhancement of embedded computing power, the camera capture is no longer single, but changes in the multi-task direction. For example, when monitoring motor vehicles, non-motor vehicles and pedestrians are also monitored. When a customer queries, it is necessary to query among numerous cameras and the corresponding massive image data, resulting in a slow query speed of the image data. Summary of the Invention
[0003] An embodiment of the present invention provides an image data query method. By setting corresponding static tags and / or dynamic tags for a camera, camera information corresponding to a point location and / or content can be found, and then corresponding image data can be found according to the corresponding camera information, which can improve the query speed of image data in the case of numerous cameras and the corresponding massive image data.
[0004] In a first aspect, an embodiment of the present invention provides an image data query method, and the method includes:
[0005] Obtain an image data query request including a camera tag, where the camera tag includes a static tag based on a point location and / or a dynamic tag based on content;
[0006] According to the image data query request, find camera information corresponding to the camera tag from a camera library;
[0007] Request image data from an image library according to the camera information corresponding to the camera tag, and return the image data.
[0008] Optionally, the method further includes:
[0009] Obtain camera information of a camera from the camera library;
[0010] Determine whether there is a static tag in the camera information of the camera;
[0011] If there is no static tag in the camera information of the camera, add a static tag to the camera according to the point location of the camera.
[0012] Optionally, the method further includes:
[0013] Obtain the task content of the camera;
[0014] Add a dynamic label to the camera according to the task content of the camera.
[0015] Optionally, the method further includes:
[0016] Obtain the image data of the camera from the image library;
[0017] Cluster the image data to obtain the image clustering result of the camera;
[0018] Add a dynamic label to the camera according to the image clustering result of the camera.
[0019] Optionally, the clustering the image data to obtain the image clustering result of the camera includes:
[0020] Divide the image data according to a preset continuous time period;
[0021] Cluster the image data in each time period to obtain the image clustering result of the camera in each time period;
[0022] The adding a dynamic label to the camera according to the image clustering result of the camera includes:
[0023] Add a dynamic label for each time period to the camera according to the image clustering result of the camera in each time period.
[0024] Optionally, the adding a dynamic label for each time period to the camera according to the image clustering result of the camera in each time period includes:
[0025] Calculate the clustering scores of each clustering category in the current time period according to the image clustering result;
[0026] Determine the dynamic label corresponding to the camera in the current time period according to the clustering scores of the clustering categories, where one clustering category corresponds to one dynamic label;
[0027] Add the dynamic label corresponding to the current time period to the camera.
[0028] Optionally, the determining the dynamic label corresponding to the camera in the current time period according to the clustering scores of the clustering categories includes:
[0029] Obtain the clustering scores of each clustering category of the current camera in the time period n;
[0030] Obtain the label score corresponding to the current camera in time period n−1 and the label score corresponding to time period n−2, where the label score represents the confidence level of the dynamic label corresponding to the clustering category as the dynamic label of the current camera;
[0031] Based on the dynamic label score corresponding to time period n−1, the label score corresponding to time period n−2, and the clustering scores of each clustering category in time period n, calculate the label score corresponding to the current camera in time period n;
[0032] Determine the dynamic label of the current camera in time period n according to the label score corresponding to time period n.
[0033] Optionally, the camera library includes a dynamic database set according to clustering categories, and the method further includes:
[0034] Dynamically store the camera according to the dynamic label of the camera; and
[0035] Establish an index relationship between the camera and the corresponding image data in the image library according to the static label of the camera pair.
[0036] In a second aspect, an embodiment of the present invention provides an image data query device, and the device includes:
[0037] A first acquisition module, configured to acquire an image data query request including a camera label, where the camera label includes a static label based on a location and / or a dynamic label based on content;
[0038] A first query module, configured to find out camera information corresponding to the camera label from the camera library according to the image data query request;
[0039] A second query module, configured to request image data from the image library according to the camera information corresponding to the camera label and return the image data.
[0040] In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, the steps in the image data query method provided by the embodiment of the present invention are implemented.
[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the image data query method provided by the embodiment of the invention are implemented.
[0042] In an embodiment of the present invention, an image data query request including a camera tag is obtained, where the camera tag includes a static tag based on a position and / or a dynamic tag based on content; according to the image data query request, camera information corresponding to the camera tag is found from a camera library; image data is requested from an image library according to the camera information corresponding to the camera tag, and the image data is returned. By setting corresponding static tags and / or dynamic tags for the cameras, the corresponding camera information can be found according to the position and / or content, and then the corresponding image data can be found according to the corresponding camera information. In the case of a large number of cameras and corresponding massive image data, the query speed of the image data can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0044] Figure 1 is a flowchart of an image data query method provided by an embodiment of the present invention;
[0045] Figure 2 is a flowchart of a static tag adding method provided by an embodiment of the present invention;
[0046] Figure 3 is a flowchart of a dynamic tag adding method provided by an embodiment of the present invention;
[0047] Figure 4 is a flowchart of another dynamic tag adding method provided by an embodiment of the present invention;
[0048] Figure 5 is a flowchart of another dynamic tag adding method provided by an embodiment of the present invention;
[0049] Figure 6 is a schematic structural diagram of an image data query device provided by an embodiment of the present invention;
[0050] Figure 7 is a schematic structural diagram of another image data query device provided by an embodiment of the present invention;
[0051] Figure 8 is a schematic structural diagram of another image data query device provided by an embodiment of the present invention;
[0052] Figure 9 is a schematic structural diagram of another image data query device provided by an embodiment of the present invention;
[0053] Figure 10 It is a schematic structural diagram of a clustering module provided by an embodiment of the present invention;
[0054] Figure 11 It is a schematic structural diagram of a third addition module provided by an embodiment of the present invention;
[0055] Figure 12 It is a schematic structural diagram of a determination unit provided by an embodiment of the present invention;
[0056] Figure 13 It is a schematic structural diagram of another image data query device provided by an embodiment of the present invention;
[0057] Figure 14 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0058] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0059] Please refer to Figure 1 , Figure 1 which is a flowchart of an image data query method provided by an embodiment of the present invention. As Figure 1 shown, the image data query method includes the following steps:
[0060] 101. Obtain an image data query request including a camera tag.
[0061] In the embodiment of the present invention, the above camera tag includes a static tag based on a point position and / or a dynamic tag based on content. The above image data query request may be generated by a user through a client. In the client, the user can fill in or select the type of image data to be queried through an interactive interface, and the client encapsulates the image data filled in or selected by the user into a corresponding image data query request.
[0062] The above-mentioned static tags can be understood as tags that remain unchanged for a long time, and the above-mentioned dynamic tags can be understood as tags that change according to different times and different contents. The above-mentioned static tags can be determined according to the fixed installation points of the cameras. For example, if the fixed installation point of a camera is at pole C at intersection B in area A, the corresponding static tag can be pole C at intersection B in area A. The above-mentioned dynamic tags can be determined according to the task content of the cameras. For example, when the task content of a camera is motor vehicle capture, non-motor vehicle capture, pedestrian capture, etc., the dynamic tags of the camera can correspondingly be motor vehicle capture, non-motor vehicle capture, pedestrian capture, etc. Due to the increase in the computing power of embedded devices, the task content of cameras is no longer single. A camera can integrate multiple algorithms to execute multiple tasks. For example, a wide-angle camera can simultaneously execute tasks such as motor vehicle capture, non-motor vehicle capture, and face capture.
[0063] In a possible embodiment, the above-mentioned static tags can be preset manually, such as manually filling in the fixed installation points, or can be preset according to the camera templates. For example, the fixed installation points are preset in the camera templates.
[0064] The above-mentioned query request can include only static tags or only dynamic tags, or include both static tags and dynamic tags at the same time. In this way, users can flexibly query image data.
[0065] 102. According to the image data query request, find out the camera information corresponding to the camera tag from the camera library.
[0066] In the embodiment of the present invention, the above-mentioned camera library stores camera information. The above-mentioned camera information includes the id of the camera and the data address of the camera. The above-mentioned camera library includes an id list of the cameras and a tag index table of the cameras. All the id information of the cameras and the corresponding data storage addresses are stored in the above-mentioned id list. The above-mentioned tag index table stores the index relationship between the camera id and the camera tag. The corresponding camera id can be indexed through the tag in the image data query request, so as to find out the camera id corresponding to the camera tag in the camera library, and the data storage address corresponding to the camera can be found through the camera id.
[0067] In a possible embodiment, the tag index table of the above camera library includes a static tag index table and a dynamic tag index table. Among them, the static tag index table stores the index relationship between the camera id and the static tag of the camera, and the dynamic tag index table stores the index relationship between the camera id and the dynamic tag of the camera. Optionally, the static tag index table can be updated according to the addition or deletion of cameras, and the dynamic tag index table can be updated according to the change of the task content of the camera in different time periods, so as to make the search for dynamic tags more flexible and accurate.
[0068] 103. Request image data from the image library according to the camera information corresponding to the camera tag, and return the image data.
[0069] In the embodiment of the present invention, the above camera information includes the data address of the camera, and the data address of the camera is the image data address in the image library. In the image library, the image data corresponding to each camera can be stored in the same storage area. In the case where the camera performs a capture task, the above image library can also be called a capture library.
[0070] After the corresponding image data is requested from the image library, the image data is returned to the client.
[0071] In the embodiment of the present invention, an image data query request including a camera tag is obtained, and the camera tag includes a static tag based on a point and / or a dynamic tag based on content; according to the image data query request, camera information corresponding to the camera tag is found from the camera library; according to the camera information corresponding to the camera tag, image data is requested from the image library, and the image data is returned. By setting corresponding static tags and / or dynamic tags for the camera, the corresponding camera information can be found according to the point and / or content, and then the corresponding image data can be found according to the corresponding camera information, which can improve the query speed of image data in the case of numerous cameras and corresponding massive image data.
[0072] Optionally, please refer to Figure 2 , Figure 2 which is a flowchart of a static tag adding method provided by the embodiment of the present invention. As Figure 2 shown, it includes the following steps:
[0073] 201. Obtain the camera information of the camera from the camera library.
[0074] In the embodiment of the present invention, the above camera information includes the id of the camera, the above camera library includes a list of camera ids and a static tag index table of the camera, and the static tag index table stores the index relationship between the camera id and the static tag of the camera.
[0075] 202. Determine whether there is a static label in the camera information of the camera.
[0076] In an embodiment of the present invention, according to the id of the camera, the corresponding camera can be found in the above id list of the camera, and according to the index relationship between the id of the camera and the static label of the camera, it can be determined whether the camera has a corresponding static label.
[0077] 203. If there is no static label in the camera information of the camera, add a static label to the camera according to the position of the camera.
[0078] In an embodiment of the present invention, if the camera does not have a corresponding static label, it means that there is no static label in the camera information of the camera, and the static label index table needs to be updated to add a corresponding static label to the camera.
[0079] Specifically, the static label of the camera can be determined according to the fixed installation position of the camera, and then according to the id of the camera, the corresponding static label is added to the part corresponding to the id of the camera in the static label index table, and according to the above static label index table.
[0080] By adding a static label to the camera, the camera at the corresponding position can be quickly found through the static label, and then the image data at the fixed position can be quickly queried according to the camera information of the camera.
[0081] Optionally, the task content of the camera can be obtained, and a dynamic label can be added to the camera according to the task content of the camera.
[0082] In an embodiment of the present invention, the task content of the above camera can be motor vehicle capture, non-motor vehicle capture, pedestrian capture, etc. When a camera integrates multiple algorithms to execute multiple tasks, the dynamic label of the camera can be determined according to the number of times the task is executed or the number of times the algorithm is triggered.
[0083] The above camera library includes the id list of the camera and the dynamic label index table of the camera. The above dynamic label index table stores the index relationship between the camera id and the dynamic label of the camera.
[0084] Further, the image data of the camera can be obtained from the image library; the image data is divided by time period, and through image recognition technology, the image content results corresponding to the image data of each time period are recognized. The image content results include motor vehicles, non-motor vehicles and pedestrians. The appearance times of motor vehicles, non-motor vehicles and pedestrians in each time period can be counted, and combined with the label scores of the target dynamic labels of the corresponding camera in the n-1 time period and the label scores of the target dynamic labels of the corresponding camera in the n-2 time period. The above label scores represent the confidence levels of the dynamic labels corresponding to the above clustering categories as the dynamic labels of the current camera; specifically, the following formula can be used to calculate the label scores of the target dynamic labels:
[0085] d n = max(log A a n , log A b n , log A c n )
[0086]
[0087] In the above formula, d n is the label score of the target dynamic label of the camera in the n time period, A is the dynamic adjustment factor, a n is the appearance times of motor vehicles, b n is the appearance times of non-motor vehicles, c n is the appearance times of pedestrians, d n-1 is the label score of the target dynamic label of the camera in the n-1 time period, d n-2 is the label score of the target dynamic label of the camera in the n-2 time period. If d n = log A a n , it means that the target dynamic label of the camera in the n time period is motor vehicle. If d n = log A b n , it means that the target dynamic label of the camera in the n time period is non-motor vehicle. If d n = log A c n , it means that the target dynamic label of the camera in the n time period is pedestrian.
[0088] In the embodiments of the present invention, according to the dynamic label situation in the previous time period and through iteration based on the label scores of the dynamic labels in the previous time period, the change situation of the dynamic labels over time can be comprehensively considered. Furthermore, the change of the dynamic labels becomes smooth in consecutive time periods, and global correction can be performed on some occlusions during the capture process and misdetections and missed detections during the image recognition process.
[0089] Optionally, please refer to Figure 3 , Figure 3 which is a flowchart of a dynamic label adding method provided by an embodiment of the present invention. As Figure 3 shown, it includes the following steps:
[0090] 301. Obtain the image data of the camera from the image library.
[0091] In the embodiment of the present invention, the id list of the camera can be obtained, and the image data can be extracted from the image library in batches according to the id list of the camera to obtain the image data corresponding to each camera.
[0092] 302. Cluster the image data to obtain the image clustering result of the camera.
[0093] In the embodiment of the present invention, the extracted image data is clustered by camera to obtain the corresponding image clustering result. The above image clustering result includes clustering categories, where one clustering category corresponds to one task content. Specifically, the above clustering categories include motor vehicle category, non-motor vehicle category, and pedestrian category, corresponding to the task contents of motor vehicles, non-motor vehicles, and pedestrians respectively.
[0094] 303. Add dynamic labels to the camera according to the image clustering result of the camera.
[0095] In the embodiment of the present invention, the clustering category of the camera based on the image data can be determined according to the number of image data of each clustering category, the dynamic label of the camera can be determined according to the clustering category, and the index relationship between the camera id and the dynamic label of the camera can be added to the above dynamic label index table. Among them, the task content of the camera is determined according to the clustering category, and the dynamic label of the camera is determined according to the task content of the camera, so that one clustering category corresponds to one dynamic label.
[0096] Optionally, please refer to Figure 4 , Figure 4 which is a flowchart of another dynamic label adding method provided by an embodiment of the present invention. As Figure 4 shown, it includes the following steps:
[0097] 401. Obtain the image data of the camera from the image library.
[0098] In the embodiment of the present invention, the id list of the camera can be obtained, and the image data can be extracted from the image library in batches according to the id list of the camera to obtain the image data corresponding to each camera.
[0099] 402. Divide the image data according to a preset continuous time period.
[0100] In the embodiments of the present invention, the above continuous time periods may be time periods combined into a time cycle, such as the number of days in a month or the number of hours in a day. For example, each hour can be used as a time period, so that the image data is divided into 24-hour segments, and the image data for 24 time periods is obtained.
[0101] 403. Cluster the image data for each time period to obtain the image clustering result of the camera for each time period.
[0102] In the embodiments of the present invention, the image data for each time period is clustered by camera to obtain the corresponding image clustering result. The above image clustering result includes clustering categories, and the clustering categories include motor vehicle categories, non-motor vehicle categories, and pedestrian categories, which respectively correspond to the task contents of motor vehicles, non-motor vehicles, and pedestrians.
[0103] 404. Add dynamic labels for each time period to the camera according to the image clustering result of the camera for each time period.
[0104] In the embodiments of the present invention, the clustering category of the camera based on the image data for the corresponding time period can be determined according to the quantity of the image data of each clustering category for each time period. Then, the dynamic label of the camera for each time period is determined according to the clustering category, and the index relationship between the camera id and the dynamic label of the camera is added to the above dynamic label index table, so as to more conveniently search for the corresponding image data. Among them, the task content of the camera is determined according to the clustering category, and the dynamic label of the camera is determined according to the task content of the camera, so that one clustering category corresponds to one dynamic label. It should be noted that the above dynamic label index table also includes index sub-tables corresponding to each time period, and the above index sub-tables manage the dynamic labels according to the above continuous time periods.
[0105] Optionally, please refer to Figure 5 , Figure 5 which is a flowchart of another method for adding dynamic labels provided by the embodiments of the present invention. As Figure 5 shown, it includes the following steps:
[0106] 501. Obtain the image data of the camera from the image library.
[0107] In the embodiments of the present invention, the id list of the camera can be obtained, and the image data is extracted from the image library in batches according to the id list of the camera to obtain the image data corresponding to each camera.
[0108] 502. Divide the image data according to the preset continuous time periods.
[0109] In the embodiments of the present invention, the above-mentioned continuous time periods may be time periods combined into a time cycle, such as the number of days in a month or the number of hours in a day. For example, each hour can be used as a time period, so that the image data can be divided into 24 hours, and the image data for 24 time periods can be obtained.
[0110] 503. Cluster the image data for each time period to obtain the image clustering result of the camera for each time period.
[0111] In the embodiments of the present invention, the image data for each time period is clustered by camera to obtain the corresponding image clustering result. The above-mentioned image clustering result includes clustering categories, and the above-mentioned clustering categories include motor vehicle categories, non-motor vehicle categories, and pedestrian categories, which respectively correspond to the task contents of motor vehicles, non-motor vehicles, and pedestrians.
[0112] 504. Calculate the clustering scores of each clustering category for the current time period according to the image clustering result.
[0113] In the embodiments of the present invention, the above-mentioned clustering score refers to the total residual or total variance of the image data in each clustering category to the clustering center, which can overall reflect the quantity of the image data and the image clustering effect, and thus more accurately reflect the clustering category of the camera.
[0114] 505. Determine the dynamic label corresponding to the camera for the current time period according to the clustering scores of the clustering categories.
[0115] In the embodiments of the present invention, the clustering category with the highest clustering score can be used as the clustering category of the camera based on the image data for the corresponding time period. Then, the task content of the camera is determined according to the clustering category, and the dynamic label of the camera is determined according to the task content of the camera.
[0116] Specifically, obtain the clustering scores of each clustering category of the current camera in time period n; obtain the target dynamic label scores corresponding to the current camera in time period n - 1 and the target dynamic label scores corresponding to time period n - 2. The above-mentioned label scores represent the confidence levels of using the dynamic labels corresponding to the above-mentioned clustering categories as the dynamic labels of the current camera; calculate the target dynamic label scores corresponding to the current camera in time period n based on the target dynamic label scores corresponding to time period n - 1, the target dynamic label scores corresponding to time period n - 2, and the clustering scores of each clustering category in time period n; determine the dynamic label of the current camera in time period n according to the target dynamic label scores corresponding to time period n.
[0117] More specifically, the following formula can be used to calculate the label scores corresponding to time period n:
[0118] h n =max(logB e n , log B f n , log B g n )
[0119]
[0120] In the above formula, h n is the label score of the target dynamic label of the camera in the n time period, B is the dynamic adjustment factor, e n is the clustering score of the motor vehicle, f n is the clustering score of the non-motor vehicle, g n is the clustering score of the pedestrian, h n-1 is the label score of the target dynamic label of the camera in the n - 1 time period, h n-2 is the label score of the target dynamic label of the camera in the n - 2 time period, is the average standard deviation of all clustering categories of the camera in the n time period, σ n-1 is the standard deviation of the clustering category corresponding to the target dynamic label of the camera in the n - 1 time period, σ n-2 is the standard deviation of the clustering category corresponding to the target dynamic label of the camera in the n - 2 time period. If h n = log B e n , it means that the target dynamic label of the camera in the n time period is a motor vehicle. If h n = log B f n , it means that the target dynamic label of the camera in the n time period is a non-motor vehicle. If h n = log B g n , it means that the target dynamic label of the camera in the n time period is a pedestrian.
[0121] In the embodiment of the present invention, according to the dynamic label situation in the previous time period and iterating according to the label score of the target dynamic label in the previous time period, the change situation of the dynamic label over time can be comprehensively considered. Furthermore, the change of the dynamic label becomes smooth within consecutive time periods, and global correction can be performed on some occlusions during the capture process and mis-statistics and missed-statistics during the image clustering process.
[0122] 506. Add the dynamic label corresponding to the current time period to the camera.
[0123] In an embodiment of the present invention, an index relationship between the camera ID and the dynamic tag of the camera is added to the above-mentioned dynamic tag index table. The above-mentioned dynamic tag index table further includes index sub-tables corresponding to each time period, and the above-mentioned index sub-tables manage the dynamic tags according to the above-mentioned continuous time periods.
[0124] Optionally, in an embodiment of the present invention, the camera can also be dynamically stored according to the dynamic tag of the camera; and an index relationship between the camera and the corresponding image data in the image library is established according to the static tag of the camera pair.
[0125] Specifically, a dynamic library corresponding to the dynamic tag can be set in the camera library to store the dynamic index table between the corresponding dynamic tag and the camera. For example, a motor vehicle dynamic library is set to store the dynamic index table between the cameras corresponding to the motor vehicle tag, a non-motor vehicle dynamic library is set to store the dynamic index table between the cameras corresponding to the non-motor vehicle tag, and a pedestrian dynamic library is set to store the dynamic index table between the cameras corresponding to the pedestrian tag. The above-mentioned dynamic index table further includes index sub-tables corresponding to each time period, and the above-mentioned index sub-tables manage the dynamic tags according to the above-mentioned continuous time periods.
[0126] The cameras in the above-mentioned dynamic library establish an index relationship with the corresponding image data in the image library through the ID of the camera.
[0127] In a possible embodiment, the data storage time of the dynamic library can be dynamically maintained according to the occurrence times of the corresponding dynamic tag of the camera. For example, if the occurrence times of the motor vehicle dynamic tag corresponding to a camera is 500 times within a month (taking the dynamic tag being updated dynamically every hour as an example), then the storage time of this camera in the motor vehicle dynamic library can be half a year; if the occurrence times of the non-motor vehicle dynamic tag is 50 times within a month, then the storage time of this camera in the non-motor vehicle dynamic library can be three months.
[0128] Optionally, when there is a dynamic tag in the query request, the query is preferentially performed in the dynamic library. Of course, the user can also select a query mode, and the query modes include dynamic priority and static priority. Dynamic priority means preferentially querying in the dynamic library, and static priority means preferentially querying in the camera library through the static tag index table. The user can flexibly select the query mode to reduce the amount of data to be queried and improve the query speed.
[0129] It should be noted that the image data query method provided by the embodiments of the present invention can be applied to devices such as smart phones, computers, and servers that can perform data queries.
[0130] Optionally, please refer to Figure 6 , Figure 6It is a schematic structural diagram of an image data query device provided by an embodiment of the present invention. As Figure 6 shown, the device includes:
[0131] A first acquisition module 601, configured to acquire an image data query request including a camera tag, where the camera tag includes a static tag based on a position and / or a dynamic tag based on content;
[0132] A first query module 602, configured to find out camera information corresponding to the camera tag from a camera library according to the image data query request;
[0133] A second query module 603, configured to request image data from an image library according to the camera information corresponding to the camera tag and return the image data.
[0134] Optionally, as Figure 7 shown, the device further includes:
[0135] A second acquisition module 604, configured to acquire camera information of a camera from the camera library;
[0136] A judgment module 605, configured to judge whether there is a static tag in the camera information of the camera;
[0137] A first addition module 606, configured to add a static tag to the camera according to the position of the camera if there is no static tag in the camera information of the camera.
[0138] Optionally, as Figure 8 shown, the device further includes:
[0139] A third acquisition module 607, configured to acquire the task content of the camera;
[0140] A second addition module 608, configured to add a dynamic tag to the camera according to the task content of the camera.
[0141] Optionally, as Figure 9 shown, the device further includes:
[0142] A fourth acquisition module 609, configured to acquire image data of a camera from the image library;
[0143] A clustering module 610, configured to cluster the image data to obtain an image clustering result of the camera;
[0144] A third addition module 611, configured to add a dynamic tag to the camera according to the image clustering result of the camera.
[0145] Optionally, as Figure 10As shown, the clustering module 610 includes:
[0146] A partitioning unit 6101 for partitioning the image data according to a preset continuous time period;
[0147] A clustering unit 6102 for clustering the image data in each time period to obtain the image clustering result of the camera in each time period;
[0148] The third adding module 611 is further configured to add a dynamic label for each time period to the camera according to the image clustering result of the camera in each time period.
[0149] Optionally, as Figure 11 shown, the third adding module 611 includes:
[0150] A calculation unit 6111 for calculating the clustering scores of each clustering category in the current time period according to the image clustering result;
[0151] A determination unit 6112 for determining the dynamic label corresponding to the camera in the current time period according to the clustering scores of the clustering categories, where one clustering category corresponds to one dynamic label;
[0152] An adding unit 6113 for adding the dynamic label corresponding to the current time period to the camera.
[0153] Optionally, as Figure 12 shown, the determination unit 6112 includes:
[0154] A first obtaining subunit 61121 for obtaining the clustering scores of each clustering category of the current camera in time period n;
[0155] A second obtaining subunit 61122 for obtaining the label scores corresponding to the current camera in time period n - 1 and the label scores corresponding to time period n - 2, where the label scores represent the confidence levels of the dynamic labels corresponding to the clustering categories as the dynamic labels of the current camera;
[0156] A calculation subunit 61123 for calculating the label scores corresponding to the current camera in time period n based on the dynamic label scores corresponding to time period n - 1, the label scores corresponding to time period n - 2, and the clustering scores of each clustering category in time period n;
[0157] A determination subunit 61124 for determining the dynamic label of the current camera in time period n according to the label scores corresponding to time period n.
[0158] Optionally, as Figure 13As shown, the device further includes:
[0159] A storage module 612, configured to perform dynamic storage on the camera according to the dynamic tag of the camera; and
[0160] An indexing module 613, configured to establish an indexing relationship between the camera and the corresponding image data in the image library according to the static tag of the camera pair.
[0161] It should be noted that the image data query device provided in the embodiments of the present invention can be applied to devices such as smartphones, computers, and servers that can perform business analysis at the layer level.
[0162] The image data query device provided in the embodiments of the present invention can implement each process implemented by the image data query method in the above method embodiments, and can achieve the same beneficial effects. To avoid repetition, it will not be elaborated here.
[0163] See Figure 14 , Figure 14 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention. As Figure 14 shown, it includes: a memory 1402, a processor 1401, and a computer program of the image data query method stored on the memory 1402 and executable on the processor 1401, where:
[0164] The processor 1401 is configured to call the computer program stored in the memory 1402 and execute the following steps:
[0165] Obtain an image data query request including a camera tag, where the camera tag includes a static tag based on a point position and / or a dynamic tag based on content;
[0166] According to the image data query request, find the camera information corresponding to the camera tag from the camera library;
[0167] Request image data from the image library according to the camera information corresponding to the camera tag, and return the image data.
[0168] Optionally, the method executed by the processor 1401 further includes:
[0169] Obtain the camera information of the camera from the camera library;
[0170] Determine whether there is a static tag in the camera information of the camera;
[0171] If there is no static tag in the camera information of the camera, add a static tag to the camera according to the point position of the camera.
[0172] Optionally, the method executed by the processor 1401 further includes:
[0173] Obtaining the task content of the camera;
[0174] Adding a dynamic label to the camera according to the task content of the camera.
[0175] Optionally, the method executed by the processor 1401 further includes:
[0176] Obtaining the image data of the camera from the image library;
[0177] Clustering the image data to obtain the image clustering result of the camera;
[0178] Adding a dynamic label to the camera according to the image clustering result of the camera.
[0179] Optionally, the clustering the image data to obtain the image clustering result of the camera executed by the processor 1401 includes:
[0180] Dividing the image data according to a preset continuous time period;
[0181] Clustering the image data in each time period to obtain the image clustering result of the camera in each time period;
[0182] The adding a dynamic label to the camera according to the image clustering result of the camera includes:
[0183] Adding a dynamic label for each time period to the camera according to the image clustering result of the camera in each time period.
[0184] Optionally, the adding a dynamic label for each time period to the camera according to the image clustering result of the camera in each time period executed by the processor 1401 includes:
[0185] Calculating the clustering scores of each clustering category in the current time period according to the image clustering result;
[0186] Determining the dynamic label corresponding to the camera in the current time period according to the clustering scores of the clustering categories, wherein one clustering category corresponds to one dynamic label;
[0187] Adding the dynamic label corresponding to the current time period to the camera.
[0188] Optionally, the determining the dynamic label corresponding to the camera in the current time period according to the clustering scores of the clustering categories includes:
[0189] Obtain the clustering scores of each clustering category of the current camera in time period n;
[0190] Obtain the label scores corresponding to time period n−1 and the label scores corresponding to time period n−2 of the current camera, where the label scores represent the confidence that the dynamic label corresponding to the clustering category is used as the dynamic label of the current camera;
[0191] Based on the dynamic label scores corresponding to time period n−1, the label scores corresponding to time period n−2, and the clustering scores of each clustering category in time period n, calculate the label scores corresponding to the current camera in time period n;
[0192] Determine the dynamic label of the current camera in time period n according to the label scores corresponding to time period n.
[0193] Optionally, the camera library includes a dynamic database set according to clustering categories, and the method executed by the processor 1401 further includes:
[0194] Dynamically store the camera according to the dynamic label of the camera; and
[0195] Establish an index relationship between the camera and the corresponding image data in the image library according to the static label of the camera pair.
[0196] It should be noted that the electronic device provided in the embodiments of the present invention can be applied to devices such as smartphones, computers, and servers that can perform image data queries.
[0197] The electronic device provided in the embodiments of the present invention can implement each process implemented by the image data query method in the above method embodiments, and can achieve the same beneficial effects. To avoid repetition, it will not be elaborated here.
[0198] The embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements each process of the image data query method or the application-side image data query method provided in the embodiments of the present invention, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0199] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above various methods. Among them, the storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM), etc.
[0200] The above-disclosed are only the preferred embodiments of the present invention. Of course, the scope of the rights of the present invention cannot be limited thereby. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.
Claims
1. An image data query method, characterized in that, including the following steps: Obtain the image data of the camera from the image library; Divide the image data according to preset continuous time periods; Cluster the image data for each time period to obtain the image clustering result of the camera for each time period; The image clustering result includes clustering categories, and the clustering categories include motor vehicle category, non-motor vehicle category, and pedestrian category; According to the image clustering result, calculate the clustering scores of each clustering category in the current time period, where the clustering score refers to the total residual or total variance of the image data in each clustering category to the clustering center; Obtain the clustering scores of each clustering category of the current camera in time period n; Obtain the target dynamic label scores corresponding to time period n−1 and the target dynamic label scores corresponding to time period n−2 of the current camera, where the target dynamic label score represents the confidence that the dynamic label corresponding to the clustering category is used as the dynamic label of the current camera; Based on the target dynamic label score corresponding to time period n−1, the target dynamic label score corresponding to time period n−2, and the clustering scores of each clustering category in time period n, calculate the target dynamic label score of the current camera corresponding to time period n; specifically, use the following formula to calculate the label score corresponding to time period n: h n = max(log B e n , log B f n , log B g n ) In the above formula, h n is the label score of the target dynamic label of the camera in the n time period, B is the dynamic adjustment factor, e n is the clustering score of the motor vehicle, f n is the clustering score of the non-motor vehicle, g n is the clustering score of the pedestrian, h n-1 is the label score of the target dynamic label of the camera in the n-1 time period, h n-2 is the label score of the target dynamic label of the camera in the n-2 time period, is the average standard deviation of all clustering categories of the camera in the n time period, σ n-1 is the standard deviation of the clustering category corresponding to the target dynamic label of the camera in the n-1 time period, σ n-2 is the standard deviation of the clustering category corresponding to the target dynamic label of the camera in the n-2 time period; according to the target dynamic label score corresponding to the time period n, determine the dynamic label of the current camera in the time period n, where one clustering category corresponds to one dynamic label; if h n = log B e n , it means that the target dynamic label of the camera in the n time period is a motor vehicle. If h n = log B f n , it means that the target dynamic label of the camera in the n time period is a non-motor vehicle. If h n = log B g n , it means that the target dynamic label of the camera in the n time period is a pedestrian; add the dynamic label corresponding to the current time period to the camera; Obtain an image data query request including a camera label, where the camera label includes a static label based on the location and / or a dynamic label based on the content; According to the image data query request, find the camera information corresponding to the camera label from the camera library; Request image data from the image library according to the camera information corresponding to the camera label, and return the image data.
2. The method according to claim 1, wherein The method further includes: Obtain the camera information of the camera from the camera library; Determine whether there is a static label in the camera information of the camera; If there is no static label in the camera information of the camera, add a static label to the camera according to the location of the camera.
3. The method according to claim 1, characterized in that, The method further includes: Obtain the task content of the camera; Add a dynamic label to the camera according to the task content of the camera.
4. The method according to any one of claims 1 to 3, characterized in that The camera library includes a dynamic database set according to clustering categories, and the method further includes: Perform dynamic storage on the camera according to the dynamic label of the camera; and Establish an index relationship between the camera and the corresponding image data in the image library according to the static label of the camera.
5. An image data query device, characterized in that, The device includes: A fourth acquisition module, configured to obtain the image data of the camera from the image library; A clustering module, configured to divide the image data according to preset continuous time periods; cluster the image data for each time period to obtain the image clustering result of the camera for each time period; A third addition module, configured to calculate the clustering scores of each clustering category in the current period according to the image clustering result, where the clustering score refers to the total residual or total variance of the image data in each clustering category to the clustering center; obtain the clustering scores of each clustering category of the current camera in the time period n; obtain the target dynamic label scores corresponding to the current camera in the time period n-1 and the target dynamic label scores corresponding to the time period n-2, where the target dynamic label score represents the confidence that the dynamic label corresponding to the clustering category is used as the dynamic label of the current camera; calculate the target dynamic label score corresponding to the current camera in the time period n based on the target dynamic label score corresponding to the time period n-1, the target dynamic label score corresponding to the time period n-2, and the clustering scores of each clustering category in the time period n; specifically, use the following formula to calculate the label score corresponding to the time period n: h n = max(log B e n , log B f n , log B g n ) In the above formula, h n is the label score of the target dynamic label of the camera in the n time period, B is the dynamic adjustment factor, e n is the clustering score of the motor vehicle, f n is the clustering score of the non-motor vehicle, g n is the clustering score of the pedestrian, h n-1 is the label score of the target dynamic label of the camera in the n-1 time period, h n-2 is the label score of the target dynamic label of the camera in the n-2 time period, is the average standard deviation of all clustering categories of the camera in the n time period, σ n-1 is the standard deviation of the clustering category corresponding to the target dynamic label of the camera in the n-1 time period, σ n-2 is the standard deviation of the clustering category corresponding to the target dynamic label of the camera in the n-2 time period; according to the target dynamic label score corresponding to the time period n, determine the dynamic label of the current camera in the time period n, where one clustering category corresponds to one dynamic label; if h n = log B e n , it means that the target dynamic label of the camera in the n time period is a motor vehicle. If h n = log B f n , it means that the target dynamic label of the camera in the n time period is a non-motor vehicle. If h n = log B g n , it means that the target dynamic label of the camera in the n time period is a pedestrian; add the dynamic label corresponding to the current time period to the camera; A first acquisition module, configured to obtain an image data query request including a camera label, where the camera label includes a location-based static label and / or a content-based dynamic label; A first query module, configured to find out camera information corresponding to the camera label from a camera library according to the image data query request; A second query module, configured to request image data from an image library according to the camera information corresponding to the camera label and return the image data.
6. An electronic device, characterized in that, Comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, the steps in the image data query method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the image data query method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Regulation and control method and device for traffic signal lamp, and electronic equipment
CN108629988A
Character track retrieval method and system
CN110532923A
Video structuralization real-time updating method and system based on incremental updating
CN110598042A
Place attribute classification method, device, electronic equipment and storage medium
CN112131942A