CN113051415B - Image storage method, device, equipment and storage medium - Google Patents

Image storage method, device, equipment and storage medium Download PDF

Info

Publication number
CN113051415B
CN113051415B CN201911375433.4A CN201911375433A CN113051415B CN 113051415 B CN113051415 B CN 113051415B CN 201911375433 A CN201911375433 A CN 201911375433A CN 113051415 B CN113051415 B CN 113051415B
Authority
CN
China
Prior art keywords
image
stored
background
group
format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911375433.4A
Other languages
Chinese (zh)
Other versions
CN113051415A (en
Inventor
张鹏国
金琦峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201911375433.4A priority Critical patent/CN113051415B/en
Publication of CN113051415A publication Critical patent/CN113051415A/en
Application granted granted Critical
Publication of CN113051415B publication Critical patent/CN113051415B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification

Abstract

The embodiment of the invention discloses an image storage method, an image storage device, image storage equipment and a storage medium. The image storage method comprises the following steps: acquiring a background image to be stored in the image group; determining background image information to be stored; determining the storage format of the image group according to the background image information to be stored; wherein the storage format is a frame group format or a picture format; and storing the image group by adopting the determined storage format. The embodiment of the invention realizes the determination of the storage format by determining the information of the background picture to be stored in the image group, and correspondingly stores the background picture to be stored in the image group by adopting the determined storage format. The storage format is selected from the frame group format and the picture format, so that the frame group format is adopted for storage under specific conditions, the utilization rate of the storage space is further improved, and the storage efficiency is improved.

Description

Image storage method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of face recognition, in particular to an image storage method, device, equipment and storage medium.
Background
With the continuous improvement of the infrastructure of the safe city, the video data is continuously enriched and shows explosive growth. The improvement of the face recognition technology realizes the purpose of converting unstructured information in the monitored image into structured information such as personnel pictures, identities and the like, storing the structured information to facilitate the processing of subsequent services, and saving a large amount of storage space. Storage of structured information, however, is also a challenge for existing systems. For example, in a face snapshot system, a snapshot small image of a face and a corresponding background large image are generally stored, so that when searching for structural information of a person according to the small image, more detailed information can be determined from the corresponding background large image.
In the existing scheme, in order to reduce the storage space of the required pictures, the face snapshot system multiplexes the pictures, that is, if the background large pictures corresponding to at least two snapshot small pictures are the same, only one background large picture is stored in the system, so as to reduce a certain storage space.
However, when each face in a video is captured, the optimal capturing time may be different with the activity of the human body, and some capturing times are slightly different within 1 second, so that the corresponding background large images are different, and the background large images cannot be multiplexed. In a video scene with dense people, it may occur that each frame of picture in the video is decoded and stored as a large background picture, which occupies more space than the original video storage.
Disclosure of Invention
Embodiments of the present invention provide an image storage method, an image storage apparatus, an image storage device, and a storage medium, where by analyzing background image information to be stored, a frame group format or a picture format is used to store a corresponding image group, so as to improve a utilization rate of a storage space and improve storage efficiency.
In a first aspect, an embodiment of the present invention provides an image storage method, including:
acquiring a background image to be stored in the image group;
determining background picture information to be stored;
determining the storage format of the image group according to the background image information to be stored; wherein the storage format is a frame group format or a picture format;
and storing the image group by adopting the determined storage format.
In a second aspect, an embodiment of the present invention provides an image access method, including:
determining a target snapshot object small image of a target object, and acquiring a target storage result which is stored in association with the target snapshot object small image;
and if the storage format of the target storage result is a frame group format, acquiring target background image frame group information which has a mapping relation with the target snap-shot object small image, and decoding the target background image frame group information to obtain a target background image.
In a third aspect, an embodiment of the present invention further provides an image storage apparatus, including:
the background image to be stored acquisition module is used for acquiring a background image to be stored in the image group;
the background image information to be stored determining module is used for determining the background image information to be stored;
the storage format determining module is used for determining the storage format of the image group according to the background image information to be stored; wherein the storage format is a frame group format or a picture format;
and the image group storage module is used for storing the image group by adopting the determined storage format.
In a fourth aspect, an embodiment of the present invention provides an image access apparatus, including:
the target storage result determining module is used for determining a target snapshot object small image of a target object and acquiring a target storage result which is stored in association with the target snapshot object small image;
and the target background image determining module is used for acquiring target background image frame group information which has a mapping relation with the target snap-shot object small image if the storage format of the target storage result is a frame group format, and decoding the target background image frame group information to obtain the target background image.
In a fifth aspect, an embodiment of the present invention further provides a computer device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement an image storage method or an image access method as described in any embodiment of the present invention.
In a sixth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements an image storage method or an image access method according to any embodiment of the present invention.
The embodiment of the invention realizes the determination of the storage format by determining the information of the background picture to be stored in the image group, and correspondingly stores the background picture to be stored in the image group by adopting the determined storage format. The storage format is selected from the frame group format and the picture format, so that the frame group format is adopted for storage under specific conditions, the utilization rate of the storage space is further improved, and the storage efficiency is improved.
Drawings
FIG. 1 is a flowchart of an image storage method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of an image storage method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of an image accessing method according to a third embodiment of the present invention;
FIG. 4 is a schematic diagram of an image storage apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an image access apparatus in a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device in a sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Fig. 1 is a flowchart of an image storage method according to a first embodiment of the present invention, and this embodiment is applicable to solving a situation where a large amount of storage space is occupied when a large amount of background images are stored according to a decoded picture format. The method may be performed by an image storage apparatus, which may be implemented in software and/or hardware, and may be configured in a computer device, for example, the computer device may be a device with communication and computing capabilities, such as a backend server. As shown in fig. 1, the method specifically includes:
step 101, obtaining a background image to be stored in the image group.
The group of pictures refers to an acquired video coding sequence, and is composed of frames between two I frames, that is, one I frame and a plurality of P frames. The I-frame, which is usually the first frame of each group of pictures, is moderately compressed and serves as a reference point for random access, and can be referred to as a picture. A P frame is predicted from a P frame or an I frame preceding it, and it is compared with the same information or data between P frames or I frames preceding it, i.e., inter-frame compression is performed in consideration of the characteristics of motion. For example, the determination of the I frame and the P frame in the Group of pictures can be determined by using a video compression technique, such as an MPEG (Moving Picture Experts Group) standard video compression technique. The background image is a frame image that can specify the background of the snap-shot object in the image group, and may be determined by decoding of an I frame or a P frame. Alternatively, the image set may be obtained locally or via an image collector. The image collector comprises a video monitor, and is used for obtaining a video recording, coding the video recording to obtain a video coding sequence and transmitting the video coding sequence. The background image to be stored refers to a large background image corresponding to the object with the optimal angle in the image group, and needs to be stored so as to be called in the subsequent processing. The snapshot object refers to a target to be tracked, such as a human face or a license plate. The background image to be stored in the image group can be determined by receiving information carried in the local image group or by identifying and determining the image group acquired in real time through an intelligent image acquisition device.
Specifically, after the image group compressed and encoded by the image collector is acquired, the image group is decoded and correspondingly analyzed, and if the angle of the snap-shot object on each frame of image in each image group is respectively determined, the frame where the snap-shot object with the optimal angle is located is determined and is used as the background image to be stored. For example, when the snapshot object is a human face, the human face feature value may be used to determine the angle of the human face in the background image, for example, deep learning is used to score various angles of the human face, such as a front face, a side face, or a low head. And determining the background picture to be stored where the snapshot face with the highest score is located according to the scoring result. All background pictures to be stored, which are determined by a picture group, contain all objects to be captured in the picture group. The background image needing to be stored is determined by the angle of the snapshot object in the background image, and the interference of irrelevant background images can be removed.
And step 102, determining background image information to be stored.
Specifically, after the background image to be stored is determined, size information, position information, and the like of the background image are determined. Optionally, the background image information to be stored includes: size information of the background image and/or relative position information in the image group is to be stored. Illustratively, after determining the background image to be stored, the sequence number and image size of the background image in the group of pictures are obtained, for example, for a group of pictures GOP25, which includes an I frame and 24P frames, three snap-shot objects are identified in the picture of the group of pictures, the optimum angles obtained by the snap-shot are P3, P6 and P22, and then 3, 6 and 22 are the position information of the background image to be stored; the three background images are 300KB in size, which is the size information. By determining the size information and the position information of the background image to be stored, the size of the memory occupied by the background image to be stored can be determined, and the distribution condition of the background image to be stored in the image group can be determined.
103, determining a storage format of the image group according to the background image information to be stored; wherein the storage format is a frame group format or a picture format.
The storage format of the frame group format refers to a part of frames in the undecoded image group stored according to the background image information to be stored; the storage format of the picture format refers to storing the corresponding decoded background picture according to the background picture information to be stored.
Specifically, the storage format adopted when the background image to be stored in the image is stored is determined according to the size information and the position information of the background image to be stored determined in one image group. Exemplarily, if it is determined that the memory occupied by all the decoded pictures of the background picture to be stored is too large according to the size information of the background picture to be stored, a frame group format is adopted; or determining that the positions of all the background pictures to be stored are dispersed in the image group according to the position information of the background pictures to be stored, and adopting a picture format. The corresponding storage format is selected according to the difference of the background image information to be stored, so that the storage format is more accordant with the actual storage condition, and the utilization rate of storage is improved.
Optionally, determining a storage format of the image group according to the background image information to be stored, including:
determining the total image capacity of all background images to be stored in the image group according to the background image information to be stored;
determining the total frame group capacity of all background images from an initial frame background image to a tail background image to be stored in the image group according to the background image information to be stored;
if the total picture capacity is equal to or larger than the total frame group capacity, the storage format of the picture group is a frame group format; otherwise, determining the storage format of the image group as a picture format.
The total picture capacity refers to the corresponding size of all decoded background pictures to be stored, and can be represented by the size of the memory occupied by all decoded background pictures to be stored. The total frame group capacity refers to the size of a frame group including all frames corresponding to the background pictures to be stored before decoding, and can be represented by the memory size occupied by all frames from an initial frame I in the image group to a background picture to be stored at the tail of the background picture to be stored.
Specifically, the memory size occupied by storing all decoded background pictures to be stored is determined as the total picture capacity according to the size information of the background pictures to be stored; and determining the position of the background image to be stored at the tail part in the background image to be stored according to the position information of the background image to be stored, and calculating the memory size occupied by the image group before decoding from the initial frame to the background image to be stored at the tail part to be stored as the total frame group capacity. Exemplarily, on the basis of the above example, the total picture capacity is the sum of the picture sizes after decoding P3, P6 and P22; the total frame group capacity is the sum of the capacity occupied by the frame group consisting of I frames to P22. Because the resolution of the video stream acquired by the image collector is determined, the size of the I frame and the size of the P frame in the group of pictures are approximately determined, for example, each frame of picture occupies about 300KB after decoding, the size of the P frame before decoding occupies about 30KB, and the I frame occupies more memory than the P frame. Namely, according to the determined resolution of the video stream, the total picture capacity and the total frame group pictures of the background picture to be stored can be determined.
When the total picture capacity of the background picture to be stored is equal to or larger than the total frame group capacity, the storage of the decoded original picture is more memory occupied than the storage of the compressed frame group, namely, the corresponding frame in the picture group can be stored by using the frame group format; if the total picture capacity of the background picture to be stored is smaller than the total frame group capacity, the internal memory occupied by the decoded original picture for storage is less than that occupied by the compressed frame group for storage, and the background picture to be stored in the picture group can be stored by using the picture format.
The total picture capacity and the total frame group capacity of the background picture to be stored are pre-calculated, and the format which occupies relatively less memory is selected for storage, so that the utilization rate of the storage space can be improved, and the problem of low storage efficiency caused by simultaneous storage of pictures with similar time or pictures with high similarity can be avoided. The P frame is predicted and determined according to the I frame or the previous P frame, so that the occupied memory is small, the corresponding frame group is stored, the storage space is reduced, and the storage quality of the background image to be stored is ensured.
Optionally, determining the total image capacity of all background images to be stored in the image group according to the background image information to be stored includes:
and determining the total picture capacity of all the background pictures to be stored in the image group according to the number of the background pictures to be stored and the size of a single background picture.
Specifically, the size of each frame of image after decoding is determined according to the resolution of the video stream, that is, the size of a single background image. Illustratively, for a 1080P code stream, the frame rate is 30, the size of the code stream is 8Mbps, and after each frame of image is decoded, the frame rate is typically 300KB. The total picture capacity can be determined according to the determined number of the background pictures to be stored. Alternatively, the total picture capacity may be determined according to the sum of the actual capacity of each decoded background picture to be stored. When the angle analysis is carried out on the snap-shot object, each frame of image in the image group needs to be decoded, the actual size of each background image can be obtained, and then the actual total image capacity of all the background images to be stored is determined according to the determined number and position information of the background images to be stored. In practical applications, the difference between the final total picture capacity determined by the two determination methods is negligible.
And step 104, storing the image group by adopting the determined storage format.
Specifically, the background image to be stored determined in the image group is stored in a corresponding format according to the determined storage format. Exemplarily, if the storage format is a frame group format, storing a continuous frame group containing all background images to be stored; and if the storage format is a picture format, storing all the decoded background picture pictures of the background picture to be stored.
Different image groups are stored by adopting different storage formats, and the correlation between the I frame and the P frame before decoding in the image groups is utilized, so that the storage quality of the background image to be stored when the frame groups are used for storage is ensured, and the utilization rate of the storage space is improved.
Optionally, if the storage format is a frame group format, the storing the image group by using the determined storage format includes:
and storing all background images from the initial frame background image to the background image to be stored at the tail part in the image group as a frame group.
Specifically, when the determined storage format is the frame group format, the background image to be stored at the tail part of the background image to be stored is determined, that is, the background image with the largest sequence number of all the background images to be stored in the image is determined. All background pictures (including the initial frame and the last background picture to be stored at the tail part) from the initial frame of the picture group to the background picture to be stored at the tail part are packed to be used as a frame group for storage, namely the frame group format is a video stream sequence format before decoding and is in a compression state, thereby greatly saving the occupied memory.
Illustratively, on the basis of the above example, the P22 corresponding frame is the background image to be stored at the tail. When the group of pictures where P3, P6 and P22 are located is stored according to the frame group format, the group of frames from the I frame to P22 needs to be stored. The storage mode of the frame group format solves the problem that the storage capacity requirement of the storage of the decoded original pictures is high when a large number of background pictures need to be stored in the video data.
The embodiment of the invention realizes the determination of the storage format by pre-determining the total picture capacity and the total frame group capacity of the background picture to be stored in the picture group and adopting the corresponding storage format to store the background picture to be stored in the picture group according to the pre-judgment of the occupied memory, and selects the format with the minimum occupied memory to store. The method and the device realize storage in different formats under different conditions, select the frame group format for storage when a large number of pictures with low information content exist in the pictures with more background pictures to be stored, save the storage capacity of the pictures, further improve the utilization rate of the storage space and improve the storage efficiency.
Example two
Fig. 2 is a flowchart of an image storage method according to a second embodiment of the present invention, where the second embodiment is further optimized based on the first embodiment, and the storage efficiency is improved by predetermining the density of the snap-shot object for pre-determination. As shown in fig. 2, the method includes:
step 201, obtaining a background image to be stored in the image group.
Step 202, determining the density of the snap-shot object in the acquisition area of the image acquisition device in the time period of the image group.
The time period refers to a preset period value, the density of the object to be captured is calculated once according to the period, and the storage formats in the time period are determined according to the density of the object to be captured. Snap object density refers to the number of objects in the video frame within a unit.
Specifically, the density of the snap-shot object in the acquisition area of the image acquisition device is determined according to the time period. For example, the time period is t seconds, and may be set to 5 seconds, i.e., the snapshot object density determination result is updated every 5 seconds. In the time t, n snap-shot objects come in and go out of the video picture in total, the time of each snap-shot object entering the picture is t1, the time of each snap-shot object leaving the picture is t2, the corresponding activity time of the snap-shot object is delta t, the density of the snap-shot objects is the ratio of the sum of the activity times of the n snap-shot objects to t, namely the density is
Figure BDA0002340823330000101
Wherein, δ t i The activity time of the ith snapshot object in the video picture is obtained. Through the determination of the density of the snapshot object, the traffic of the snapshot object in the video in a time period can be preliminarily known, such as the traffic of peopleAnd determining, and estimating the size of the background image to be stored according to the determined human flow.
And 203, if the density of the snap-shot object is equal to or greater than a first density threshold value, determining that the storage format of the image group is a frame group format.
Specifically, the first density threshold is used for characterizing that the density of the snap-shot object is large, and when the density exceeds the first density threshold, it indicates that there are many snap-shot objects in the current belonging time period and there are many background images to be stored, and the total image capacity of the snap-shot object is larger than the total frame group capacity under normal conditions, so that the frame group format can be directly adopted to store the background images to be stored in the image group. Illustratively, the density of the snapshot object is compared with a first density threshold value, and when the human flow in the video picture is more, the frame group format is determined to be directly adopted for storage, so that the loss caused by calculation of the capacity of the background image to be stored in each image group is avoided.
And 204, if the density of the snapshot object is less than or equal to a second density threshold, determining that the storage format of the image group is a picture format.
Wherein the first density threshold is greater than the second density threshold.
Specifically, the second density threshold is used for characterizing that the density of the snap-shot object is smaller, and when the density of the snap-shot object is smaller than the second density threshold, it indicates that the snap-shot object in the current belonging time period is less, and the background image required to be stored is less, so that the total image capacity of the snap-shot object is smaller than the total frame group capacity under normal conditions, and therefore, the background image to be stored in the image group can be directly stored in an image format. Illustratively, the density of the snapshot object is compared with the second density threshold value, and when the flow of people in the video picture is less, the snapshot object is determined to be directly stored in a picture format, so that the loss caused by the capacity calculation of the background picture to be stored in each image group is avoided.
Step 205, if the density of the snap-shot object belongs to the range between the first density threshold and the second density threshold, executing a determination operation of the background map information to be stored; determining the storage format of the image group according to the background image information to be stored; and storing the image group by adopting the determined storage format.
Wherein the storage format is a frame group format or a picture format.
Specifically, when the density of the snap-shot objects belongs to a range between the first density threshold and the second density threshold, it is described that the comparison result of the total image capacity and the total frame group capacity of the snap-shot objects cannot be determined according to the number of the snap-shot objects in the current belonging time period, and therefore the determination operation of the background image information to be stored needs to be executed; determining the storage format of the image group according to the background image information to be stored; and storing the image group by adopting the determined storage format. The specific implementation method can refer to the first embodiment.
Different storage formats are selected according to different densities of the snap-shot objects, the corresponding storage format is directly determined under the condition that the density of the snap-shot objects is large or small, and the storage format is determined by comparing the total picture capacity and the total frame group capacity only when the density of the snap-shot objects is between the two densities. The performance loss caused by comparison of the picture capacity under a certain condition is reduced, the time for determining the capacity is reduced, and the storage efficiency is further improved.
Optionally, storing the image group further includes:
in the image group, determining a small snap-shot object image of the background image to be stored, and establishing a mapping relation between the small snap-shot object image and the background image to be stored;
and performing association storage on the storage result of the image group and the mapping relation.
The snapshot object thumbnail refers to an object thumbnail for determining an optimal snapshot angle of the background image to be stored, for example, when the snapshot object is a human face, it is determined that the image group P3 is the background image to be stored according to the optimal snapshot angle of the human face a, and the snapshot object thumbnail of P3 is a part of the image in which the human face a in P3 is located; or the background images to be stored determined according to the face A and the face B are both P3, and the small snap-shot object image corresponding to the P3 is the face A small image and the face B small image which are taken out from the background images.
Specifically, the snap-shot object small images in each background image to be stored in the image group are determined, and a mapping relation is established for each snap-shot object small image and the background image to be stored of the source of the snap-shot object small image, that is, the source background image of the snap-shot object small image can be found by determining the snap-shot object small images, and all the snap-shot object small images, the storage result for storing the image group according to the corresponding storage format, and the mapping relation between the snap-shot object small images and the storage result are stored in an associated manner. Exemplarily, on the basis of the above example, if the picture format storage is performed on P3, P6 and P22, the small snap-shot object pictures therein are deducted, and the mapping relationships with P3, P6 and P22 are respectively established; or if the frame group format storage is performed on the P3, the P6 and the P22, the snap-shot object small image therein is captured, and the mapping relationship between the snap-shot object small image and the corresponding frame in the stored frame group is respectively established, for example, the mapping relationship between the face a and the 3 rd frame in the frame group is established.
By determining the small image of the snapshot object, the structural information of the snapshot object, such as human face features and the like, can be obtained, the small image can be conveniently determined according to the structural information of the human face, the background image information associated with the small image is determined according to the mapping relation between the small image and the background image, and the relevance between the stored information is improved.
In a possible implementation manner, the storage format of the image group is determined according to the density of the snap-shot object in the acquisition area of the image acquisition device or the background image information to be stored. Specifically, the storage format is determined by two pieces of information at the same time.
According to the embodiment of the invention, the density of the snapshot object is predetermined before the storage mode is determined, and the storage format directly selected when the density of the snapshot object is larger or smaller is determined through comparison between the determined density of the snapshot object and the threshold value, so that the calculation of the size of the background image to be stored under the condition is avoided, and the storage efficiency is improved. And the small images of the snap-shot objects in the background images to be stored are stored, and the mapping relation between the small images and the background images is stored, so that the richness of the information and the relevance between the information are improved.
EXAMPLE III
Fig. 3 is a flowchart of an image access method in a third embodiment of the present invention, and this embodiment is applicable to solving a problem that after a background image to be stored and a snap-shot object thumbnail in an image group are stored, access to the snap-shot object thumbnail and the background image can be achieved through related information. The method may be performed by an image accessing apparatus, which may be implemented in software and/or hardware, and may be configured in a computer device, for example, the computer device may be a device with communication and computing capabilities, such as a backend server. As shown in fig. 3, the method specifically includes:
step 301, determining a target snapshot object small image of a target object, and acquiring a target storage result stored in association with the target snapshot object small image.
Specifically, the target object may be target structured information, such as gender, facial features, or a snapshot object thumbnail. And determining a target snap-shot object small image meeting the requirement according to the target object, and background image information stored in association with the target snap-shot object small image. Illustratively, when the target object is a female with gender, face map information of the female with gender in the stored snap-shot object small images is determined, and background map information which has a mapping relation with the face maps is determined, wherein the background map information comprises a directly stored background map or background map frame group information for frame group storage. For example, the background map may be stored in a jpg format when stored as a picture, and may be stored in a picg format when stored as a frame group. Optionally, when the image group is stored, all background images between the background image to be stored determined in the image group from the initial frame background image to the background image to be stored at the tail are stored as the frame group. Since the present embodiment is described for accessing after the image group is stored, the first embodiment and the second embodiment may be referred to as a method for storing a background image to be stored in the image group, and details are not described here.
Step 302, if the storage format of the target storage result is a frame group format, acquiring target background image frame group information having a mapping relation with the target snap-shot object small image, and decoding the target background image frame group information to obtain a target background image.
Specifically, when it is determined that the background image stored in association with the snap-shot object thumbnail is in a frame group format, the frame group is decoded according to the frame group number having a mapping relationship with the snap-shot object thumbnail during storage, and then the background image of the corresponding frame group number is obtained. And when the background image which is stored in association with the snap-shot object small image is determined to be in a picture format, directly reading the background image which has a mapping relation with the snap-shot object small image.
Illustratively, if the target storage result is in picg format, the storage format is, for examplehttp://192.168.10.20/ 1563169914256.picgNo.4Where No.4 indicates the 4 th frame group for the entire saved frame group having a mapping relation with the snap-shot object thumbnail. And decoding the corresponding associated frame group, and reading the picture with the corresponding serial number of 4 as a target background picture. And if the target storage result is in a jpg format, directly reading a picture which is stored locally and has a mapping relation with the snapshot object small picture to be used as a target background picture.
According to the embodiment of the invention, the stored picture is dynamically acquired according to the judgment on the format of the storage result when the background picture is called, so that the utilization rate of the storage memory is improved.
Example four
Fig. 4 is a schematic structural diagram of an image storage apparatus according to a fourth embodiment of the present invention, which is applicable to solve a situation where a large amount of storage space is occupied when a large number of background images are stored according to a decoded picture format.
As shown in fig. 4, the apparatus includes:
a background image to be stored acquiring module 410, configured to acquire a background image to be stored in the image group;
a to-be-stored background map information determining module 420, configured to determine background map information to be stored;
a storage format determining module 430, configured to determine a storage format of the image group according to the background image information to be stored; wherein the storage format is a frame group format or a picture format;
and the image group storage module 440 is configured to store the image group in the determined storage format.
The embodiment of the invention realizes the determination of the storage format by determining the information of the background picture to be stored in the image group, and correspondingly stores the background picture to be stored in the image group by adopting the determined storage format. The storage format is selected from the frame group format and the picture format, so that the frame group format is adopted for storage under specific conditions, the utilization rate of a storage space is further improved, and the storage efficiency is improved.
Optionally, the storage format determining module 430 includes:
a total image capacity determining unit, configured to determine, according to the background image information to be stored, a total image capacity of all background images to be stored in the image group;
a total frame group capacity determining unit, configured to determine, according to the background image information to be stored, a total frame group capacity of all background images from an initial frame background image to a tail background image to be stored in the image group;
a storage format determining unit configured to determine a storage format of the image group as a frame group format if the total picture capacity is equal to or greater than the total frame group capacity; otherwise, determining the storage format of the image group as a picture format.
Optionally, the total picture capacity determining unit is specifically configured to:
and determining the total picture capacity of all the background pictures to be stored in the image group according to the number of the background pictures to be stored and the size of a single background picture.
Optionally, the apparatus further includes a snapshot object density determining module, specifically configured to:
determining the density of a snapshotted object in the acquisition area of the image acquisition device in the time period of the image group;
if the density of the snapshot object is equal to or greater than a first density threshold value, determining that the storage format of the image group is a frame group format;
if the density of the snapshot object is smaller than or equal to a second density threshold value, determining that the storage format of the image group is a picture format;
if the density of the snapshot object belongs to the range between the first density threshold value and the second density threshold value, the determination operation of the background image information to be stored is executed;
wherein the first density threshold is greater than the second density threshold.
Optionally, if the storage format is a frame group format, the image group storage module 440 is specifically configured to:
and storing all background images from the initial frame background image to the background image to be stored at the tail part in the image group as a frame group.
Optionally, the image group storage module 440 further includes a snapshot object thumbnail storage unit, specifically configured to:
in the image group, determining a small snap-shot object image of the background image to be stored, and establishing a mapping relation between the small snap-shot object image and the background image to be stored;
and performing association storage on the storage result of the image group and the mapping relation.
Optionally, the apparatus further includes a target background map determining module, specifically configured to:
determining a target snapshot object small image of a target object, and acquiring a target storage result which is stored in association with the target snapshot object small image;
and if the storage format of the target storage result is a frame group format, acquiring target background image frame group information which has a mapping relation with the target snap-shot object small image, and decoding the target background image frame group information to obtain a target background image.
The image storage device provided by the embodiment of the invention can execute the image storage method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects for executing the image storage method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an image accessing apparatus in a fifth embodiment of the present invention, and this embodiment may be applied to solve a problem that after a background image to be stored and a snap-shot object thumbnail in an image group are stored, access to the snap-shot object thumbnail and the background image may be implemented through related information. As shown in fig. 5, the apparatus includes:
a target storage result determining module 510, configured to determine a target snap-shot object small image of a target object, and obtain a target storage result stored in association with the target snap-shot object small image;
and a target background image determining module 520, configured to, if the storage format of the target storage result is a frame group format, obtain target background image frame group information having a mapping relationship with the target snap-shot object thumbnail, and decode the target background image frame group information to obtain a target background image.
The image access device provided by the embodiment of the invention can execute the image access method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the image access method.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a computer device according to a sixth embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 6 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 6, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory device 28, and a bus 18 that couples various system components including the system memory device 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory device bus or memory device controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system storage 28 may include computer system readable media in the form of volatile storage, such as Random Access Memory (RAM) 30 and/or cache storage 32. The computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Storage 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in storage 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, computer device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system storage device 28, for example, to implement an image storage method provided by an embodiment of the present invention, including:
acquiring a background image to be stored in the image group;
determining background image information to be stored;
determining the storage format of the image group according to the background image information to be stored; wherein the storage format is a frame group format or a picture format;
and storing the image group by adopting the determined storage format.
Or the image access method provided by the embodiment of the invention comprises the following steps:
determining a target snapshot object small image of a target object, and acquiring a target storage result which is stored in association with the target snapshot object small image;
and if the storage format of the target storage result is a frame group format, acquiring target background image frame group information which has a mapping relation with the target snap-shot object small image, and decoding the target background image frame group information to obtain a target background image.
EXAMPLE seven
The seventh embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements an image storage method provided in the embodiment of the present invention, where the computer program includes:
acquiring a background image to be stored in the image group;
determining background picture information to be stored;
determining the storage format of the image group according to the background image information to be stored; the storage format is a frame group format or a picture format;
and storing the image group by adopting the determined storage format.
Or the image access method provided by the embodiment of the invention comprises the following steps:
determining a target snapshot object small image of a target object, and acquiring a target storage result which is stored in association with the target snapshot object small image;
and if the storage format of the target storage result is a frame group format, acquiring target background image frame group information which has a mapping relation with the target snap-shot object small image, and decoding the target background image frame group information to obtain a target background image.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. Those skilled in the art will appreciate that the present invention is not limited to the particular embodiments described herein, and that various obvious changes, rearrangements and substitutions will now be apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. An image storage method, comprising:
determining a background image to be stored in the image group according to the angle of the snap-shot object on each frame of image in the image group; wherein the group of pictures comprises a video encoding sequence;
determining background picture information to be stored;
determining the storage format of the image group according to the background image information to be stored; the storage format is a frame group format or a picture format; the frame group format refers to storing partial frames in an undecoded image group according to background image information to be stored; the picture format refers to storing a corresponding decoded background picture according to the background picture information to be stored;
storing the image group by adopting a determined storage format;
determining a storage format of the image group according to the background image information to be stored, wherein the determining comprises the following steps:
determining the total image capacity of all background images to be stored in the image group according to the background image information to be stored; wherein, the total picture capacity is the memory capacity occupied by all decoded background pictures to be stored;
determining the total frame group capacity of all background images from an initial frame background image to a background image to be stored at the tail part in the image group according to the background image information to be stored; the background image is a frame image including a background of a snapshot object in the image group; the total frame group capacity is the frame group size of all corresponding frames before decoding the background image to be stored;
if the total picture capacity is equal to or larger than the total frame group capacity, the storage format of the picture group is a frame group format; otherwise, determining the storage format of the image group as a picture format.
2. The method according to claim 1, wherein determining a total picture capacity of all background pictures to be stored in the image group according to the background picture information to be stored comprises:
and determining the total picture capacity of all the background pictures to be stored in the image group according to the number of the background pictures to be stored and the size of a single background picture.
3. The method of claim 1, wherein prior to determining that background map information is to be stored, further comprising:
determining the density of a snapshotted object in an acquisition area of an image collector in the time period of the image group; wherein the snap shot object density is the number of objects in the video picture within a unit;
if the density of the snapshot object is equal to or larger than a first density threshold value, determining that the storage format of the image group is a frame group format;
if the density of the snapshot object is smaller than or equal to a second density threshold value, determining that the storage format of the image group is a picture format;
if the density of the snapshot object belongs to the range between the first density threshold value and the second density threshold value, the determination operation of the background image information to be stored is executed;
wherein the first density threshold is greater than the second density threshold.
4. The method according to claim 1, wherein if the storage format is a frame group format, the storing the group of pictures in the determined storage format comprises:
and storing all background images from the initial frame background image to the background image to be stored at the tail part in the image group as a frame group.
5. The method of any of claims 1-4, wherein storing the set of images further comprises:
in the image group, determining a small snap-shot object image of the background image to be stored, and establishing a mapping relation between the small snap-shot object image and the background image to be stored;
and performing associated storage on the storage result of the image group and the mapping relation.
6. The method according to claim 5, wherein after storing the stored result of the image group in association with the mapping relationship, the method further comprises:
determining a target snapshot object small image of a target object, and acquiring a target storage result which is stored in association with the target snapshot object small image;
and if the storage format of the target storage result is a frame group format, acquiring target background image frame group information which has a mapping relation with the target snap-shot object small image, and decoding the target background image frame group information to obtain a target background image.
7. An image storage apparatus, comprising:
the background image to be stored acquisition module is used for determining the background image to be stored in the image group according to the angle of the snap-shot object on each frame of image in the image group; wherein the group of pictures comprises a video encoding sequence;
the background image information to be stored determining module is used for determining the background image information to be stored;
the storage format determining module is used for determining the storage format of the image group according to the background image information to be stored; wherein the storage format is a frame group format or a picture format; the frame group format refers to storing partial frames in an undecoded image group according to background image information to be stored; the picture format refers to storing a corresponding decoded background picture according to the background picture information to be stored;
the image group storage module is used for storing the image group by adopting a determined storage format;
wherein, the storage format determining module comprises:
a total image capacity determining unit, configured to determine, according to the background image information to be stored, a total image capacity of all background images to be stored in the image group; wherein, the total picture capacity is the memory capacity occupied by all decoded background pictures to be stored;
a total frame group capacity determining unit, configured to determine, according to the background image information to be stored, a total frame group capacity of all background images from an initial frame background image to a tail background image to be stored in the image group; the background image is a frame image including a background of a snapshot object in the image group; the total frame group capacity is the frame group size of all corresponding frames before decoding the background pictures to be stored;
a storage format determining unit configured to determine a storage format of the image group as a frame group format if the total picture capacity is equal to or greater than the total frame group capacity; otherwise, determining the storage format of the image group as a picture format.
8. A computer device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the image storage method of any one of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the image storage method according to any one of claims 1 to 6.
CN201911375433.4A 2019-12-27 2019-12-27 Image storage method, device, equipment and storage medium Active CN113051415B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911375433.4A CN113051415B (en) 2019-12-27 2019-12-27 Image storage method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911375433.4A CN113051415B (en) 2019-12-27 2019-12-27 Image storage method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113051415A CN113051415A (en) 2021-06-29
CN113051415B true CN113051415B (en) 2023-02-21

Family

ID=76506127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911375433.4A Active CN113051415B (en) 2019-12-27 2019-12-27 Image storage method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113051415B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08214265A (en) * 1995-01-31 1996-08-20 Sony Corp Method and device for reproducing encoded data
JP2008245147A (en) * 2007-03-28 2008-10-09 Sharp Corp Image processor, image reader, image forming apparatus, image processing method, computer program and recording medium
CN105357594B (en) * 2015-11-19 2018-08-31 南京云创大数据科技股份有限公司 The massive video abstraction generating method of algorithm is concentrated based on the video of cluster and H264
US10728510B2 (en) * 2018-04-04 2020-07-28 Motorola Mobility Llc Dynamic chroma key for video background replacement

Also Published As

Publication number Publication date
CN113051415A (en) 2021-06-29

Similar Documents

Publication Publication Date Title
CN111898416A (en) Video stream processing method and device, computer equipment and storage medium
US20120057640A1 (en) Video Analytics for Security Systems and Methods
WO2022062344A1 (en) Method, system, and device for detecting salient target in compressed video, and storage medium
US11057635B2 (en) Methods and systems for video synopsis
CN114679607B (en) Video frame rate control method and device, electronic equipment and storage medium
CN112954398B (en) Encoding method, decoding method, device, storage medium and electronic equipment
CN112990273B (en) Compressed domain-oriented video sensitive character recognition method, system and equipment
US11004237B2 (en) Palette coding for color compression of point clouds
CN110619284A (en) Video scene division method, device, equipment and medium
CN111368593B (en) Mosaic processing method and device, electronic equipment and storage medium
CN113051415B (en) Image storage method, device, equipment and storage medium
US20060002612A1 (en) Device and process for video compression
US20220358744A1 (en) Multi-resolution image processing device and method capable of processing recognition of multiple dynamic objects
US11095901B2 (en) Object manipulation video conference compression
CN115379233B (en) Big data video information analysis method and system
CN111698533A (en) Video processing method, device, equipment and storage medium
CN108668169B (en) Image information processing method and device, and storage medium
CN114245032B (en) Automatic switching method and system for video framing, video player and storage medium
CN109886234B (en) Target detection method, device, system, electronic equipment and storage medium
KR101212845B1 (en) Method And System For Sampling Moving Picture
US20200380267A1 (en) Object trajectory augmentation on a newly displayed video stream
CN114691603A (en) Target information storage method, device, electronic equipment and medium
CN107480616B (en) Skin color detection unit analysis method and system based on image analysis
KR101174176B1 (en) Method And System For Sampling Moving Picture
CN114627036B (en) Processing method and device of multimedia resources, readable medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant