WO2022057773A1 - Image storage method and apparatus, computer device and storage medium - Google Patents

Image storage method and apparatus, computer device and storage medium Download PDF

Info

Publication number
WO2022057773A1
WO2022057773A1 PCT/CN2021/118045 CN2021118045W WO2022057773A1 WO 2022057773 A1 WO2022057773 A1 WO 2022057773A1 CN 2021118045 W CN2021118045 W CN 2021118045W WO 2022057773 A1 WO2022057773 A1 WO 2022057773A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
shooting
images
face
same
Prior art date
Application number
PCT/CN2021/118045
Other languages
French (fr)
Chinese (zh)
Inventor
雷霆
苏炜
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022057773A1 publication Critical patent/WO2022057773A1/en

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules

Definitions

  • the present application relates to the technical field of data storage, and in particular, to a method, apparatus, computer device and storage medium for image storage.
  • view applications such as face retrieval and face tracking have been derived from video surveillance.
  • the captured image can usually be processed as follows before implementing the view application.
  • the camera sends the real-time captured images to the storage system, such as Huawei's Intelligent Video Surveillance (IVS), which parses the received images to obtain the face images in the images, and the corresponding images of each face.
  • the storage system such as Huawei's Intelligent Video Surveillance (IVS)
  • IVRS Intelligent Video Surveillance
  • the face feature data may be a feature vector
  • the structured data includes the shooting time, shooting location, quality score, age, gender, etc. corresponding to the face image.
  • the face image, the corresponding face feature data, and the face structured data are stored correspondingly for use by subsequent view applications.
  • Embodiments of the present application provide an image storage method, apparatus, computer device, and storage medium.
  • the technical solution is as follows:
  • a method for image storage comprising:
  • the stored image set contains one or more images
  • the images in the image set and the first image have: the same shooting object , the same shooting location, and the shooting time interval less than a preset threshold, delete the unselected images.
  • the image may be a face image, and for the convenience of description, the following image is a face image for description.
  • the shooting location is the location where the image shooting device is located, and the preset threshold may be 5 minutes to 10 minutes.
  • the face image can be obtained after the image capture device performs face recognition on the captured video, and then sent by the image capture device to the intelligent video surveillance platform (IVS, Intelligent Video Surveillance), or it can be sent by the IVS to the image capture device.
  • the video is obtained by face recognition.
  • the face images acquired by IVS are acquired in the order of shooting time. For example, the shooting time corresponding to the face image acquired later is later than the shooting time corresponding to the face image acquired earlier.
  • the currently acquired face image After each acquisition of a face image, if it is determined that there is a face image with the same shooting object and shooting location as the currently acquired face image, and the shooting time interval is less than the preset threshold, the currently acquired face image will be stored.
  • the face image is added to the image set corresponding to the face image satisfying the above conditions. Specifically, when judging whether the two face images correspond to the same shooting object, the similarity of the feature data of the two can be calculated, and if the similarity is greater than a preset threshold, it is considered that the two correspond to the same shooting object.
  • At least one face image can be selected to be saved, and the rest can be deleted.
  • a deduplication operation can be performed on the face images of the same object that are continuously photographed at the same location in a short period of time, and it is not necessary to store all of them, which effectively saves storage resources.
  • the method further includes:
  • a face image whenever a face image is acquired, it can be judged first whether there is the same shooting object, the same shooting location, and the shooting time interval smaller than the preset threshold as the face image. If there is no face image with the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold as the face image, a new image set will be established, and the obtained face image will be The face image is added to the newly created image collection.
  • the triggering conditions of the above-mentioned deduplication operation may include:
  • a fourth face image with the same shooting object, the same shooting location, and a shooting time interval smaller than the preset threshold as the first face image is not acquired.
  • the image collection can be de-duplicated.
  • the preset duration may be equal to the aforementioned preset threshold.
  • the deduplication time interval may be set to 10 minutes, and the corresponding preset duration may also be set to 10 minutes, or the preset duration may be set to be slightly larger than the aforementioned preset threshold.
  • the triggering conditions of the above-mentioned deduplication operation may include:
  • a fifth face image with the same shooting object as the first face image and a different shooting point is obtained.
  • the photographing object corresponding to the first face image has gone to another place, and the image set can be deduplicated.
  • the triggering conditions of the above-mentioned deduplication operation may include:
  • the number of face images included in the image set is greater than the target number, or it is determined that the size of the storage space occupied by the face images included in the image set is greater than the target storage value.
  • the number of face images included in each image set may be detected according to a preset detection period, and if the number is greater than the preset number, a deduplication operation may be performed on the image set.
  • the target quantity can be set according to actual needs, for example, the preset quantity can be set to 10 to 20 sheets.
  • the size of the storage space occupied by the face images in each image set may be detected according to a preset detection period, and if it is greater than the target storage value, the image set may be deduplicated.
  • the target storage value can be set according to actual needs, for example, can be set to 300KB to 600KB.
  • the method further includes:
  • the starting time in the target shooting time period is the earliest time in the shooting time of the image in the image regroup and the first image
  • the target shooting time is the latest time in the shooting time of the images in the image set and the first image
  • the structured data and face feature data of the unselected images are deleted.
  • the structured data and face feature data corresponding to these face images may also be deleted.
  • its shooting time can be modified to the target shooting time period, wherein the starting time in the target shooting time period is the shooting time corresponding to the face image in the image set.
  • the earliest time in the target shooting time period is the latest time in the shooting time corresponding to the face image in the image set.
  • the saved face image and its structured data may indicate that the corresponding shooting object is located at the shooting location corresponding to the face image within the above-mentioned target shooting time period.
  • the selected image is the highest quality image.
  • the quality of the face image is related to factors such as the illumination of the face image, the angle of the face, and the like, and can usually be expressed by a quality score.
  • an image storage device comprising:
  • a deduplication module configured to perform a deduplication operation on the first image and the stored image set, and is specifically used for:
  • the apparatus further includes:
  • the establishment module is used to obtain the second image, and if there is no third image with the same shooting object, the same shooting location, and the shooting time interval smaller than the preset threshold value as the second image, the establishment includes: an image collection of the second image.
  • the trigger condition of the deduplication operation includes:
  • a fourth person who has the same subject, the same shooting location, and the shooting time interval less than the preset threshold as the first face image has not been acquired face image.
  • the trigger condition of the deduplication operation includes:
  • a fifth face image with the same shooting object as the first face image and a different shooting location is obtained.
  • the trigger condition of the deduplication operation includes:
  • the deduplication module is further used for:
  • the starting time in the target shooting time period is the difference between the images in the image re-set and the shooting time of the first image.
  • the earliest time, the end time in the target shooting time period is the latest time in the shooting time of the image in the image set and the first image;
  • the selected image is the highest quality image.
  • a method for image storage comprising:
  • the images in the image set are acquired from the storage device, and the images in the image set and the first image have: the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold;
  • the deduplication operation is performed on the image collection, which specifically includes: selecting an image from the image collection to save, and deleting unselected images.
  • the object stays at the same shooting location for a long time, and is shot by the The image capturing equipment at the location continuously captures face images, and these face images only need to save the face images with the best quality.
  • these face images are divided into multiple batches for deduplication. In this way, more face images will be saved. Therefore, the saved face images can also be deduplicated twice.
  • the best image is saved, and the remaining images can be deleted.
  • an image storage device comprising:
  • an acquisition module configured to acquire an image in an image set from a storage device, where the image in the image set and the first image have: the same shooting object, the same shooting location, and a shooting time interval less than a preset threshold;
  • the deduplication module is used to perform deduplication operation on the image set, and is specifically used for:
  • a computer device in a fifth aspect, includes a processor and a memory, the memory stores at least one instruction, the instruction is loaded and executed by the processor to implement the above-mentioned first aspect and The operations performed by the method for image storage described in the third aspect.
  • a computer-readable storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to implement the image storage as described in the first and third aspects above the operation performed by the method.
  • a seventh aspect provides a computer program product that, when the computer program product is run on a computer device, causes the computer device to execute the image storage method as described in the first and third aspects above. operate.
  • de-duplication processing may be performed on the acquired image and the image in the stored image set, where the image in the image set and the currently acquired image satisfy the following conditions: have the same The shooting time, the same shooting location, and the shooting time interval is less than the preset threshold, which means that the currently acquired image and the images in the image set are multiple images continuously shot by the same object in the same shooting location in a short period of time.
  • the images are very similar to each other. In this way, it is not necessary to save all of these images, only some images are selected to be saved, and unselected images are deleted, which can effectively save storage resources.
  • FIG. 1 is a schematic diagram of an implementation scenario provided by an embodiment of the present application.
  • FIG. 2 is a flowchart of a method for image storage provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of establishing an image set provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of adding a face image to an image set provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a face image deduplication provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an apparatus for image storage provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • An embodiment of the present application provides an image storage method, which can be implemented by a computer device, and the computer device has a storage function, such as a computer, a server, a network attached storage (NAS) storage system, a storage area network (storage area network, SAN) storage system, distributed storage system, cloud storage system, network video recorder (NVR), etc.
  • a storage function such as a computer, a server, a network attached storage (NAS) storage system, a storage area network (storage area network, SAN) storage system, distributed storage system, cloud storage system, network video recorder (NVR), etc.
  • NAS network attached storage
  • SAN storage area network
  • NVR network video recorder
  • the implementation scene of the embodiment of the present application may include a front-end image capturing device and an IVS, wherein the image capturing device may be a conventional camera, or may be a smart camera that can be installed with applications, such as a software-defined camera (software defined camera). camera, SDC). Image shooting equipment can be deployed in streets, intersections and other places according to actual needs.
  • the image capturing device can send the captured images to the IVS, and the IVS deduplicates the images of the same object continuously captured by the same image capturing device in a short period of time. In this way, the storage space can be effectively saved, and the limited In the storage space, more valuable data can be stored.
  • IVS can provide the user with services such as face retrieval.
  • the total amount of face images is relatively small, which can effectively improve the efficiency of face retrieval and give users a better experience.
  • the basis for removing duplicate images in this embodiment is that images with the same shooting object, the same shooting location, and a shooting time interval smaller than a preset threshold are considered as similar images. Duplicate image deletion is performed on these similar images. That is, only one (or multiple) of them is kept, and the rest of the images are deleted, thereby saving storage space.
  • the operation of removing duplicate images can have various modes of operation, such as:
  • Mode 1 Multiple images have been stored in the storage device (the whole of the multiple images is called an image set), and deduplication is performed between the multiple images.
  • Mode 2 Multiple images have been stored in the storage device (the whole of the multiple images is called an image set), and deduplication is performed between the newly received image and the multiple stored images.
  • a method flow of an image storage may include the following steps:
  • Step 201 Acquire a first image.
  • the acquisition location of the first image and the image set may be different, for example, the first image is acquired by the computer device from outside the storage device, and the image set is acquired by the computer device from the storage device.
  • the first image may be acquired from the same location as the image set, for example, both acquired from a storage device by a computer device.
  • Computer devices and storage devices can be integrated together, such as storage devices with computing capabilities.
  • the image may be a face image, and in the following embodiments, the image is a face image as an example for description.
  • the method of acquiring the face image by the IVS may also be different.
  • the image capturing device After the image capturing device captures the video, face recognition is performed on the video frames in the video according to the preset frame interval to obtain the face image and the scene image in the corresponding video frame.
  • the preset frame interval may be, for example, 3 frames, 5 frames, or the like. Then, the face image in the video frame is sent to the IVS, and the IVS can directly obtain the face image.
  • the image capturing device can also simultaneously send the scene image in the video frame and the corresponding shooting time and shooting location, where the shooting location is the location of the image capturing device.
  • the image capturing device may not send the capturing location of the face image, but the device identification of the image capturing device.
  • the image capturing device After the image capturing device captures a picture, face recognition is performed on the captured picture to obtain a face image and a scene image in each picture. Then, the face image in each picture is sent to the IVS, and the IVS can directly obtain the face image.
  • the image capturing device may also send the scene image in the picture and the corresponding shooting time and shooting location at the same time.
  • the image capturing device may not send the capturing location of the face image, but the device identification of the image capturing device.
  • IVS can process in real time, that is, after receiving the face image sent by the image capturing device, it directly acquires the face image and performs subsequent processing.
  • the IVS may store the received face data first, and then acquire the face images in sequence according to the shooting time when the face image needs to be deduplicated. For example, a technician can set a deduplication period, and every time a preset deduplication period is reached, a stored face image is acquired and a deduplication operation is performed, wherein the deduplication period can be one day, three days, or the like.
  • the image capture device After the image capture device captures the video, it can be directly sent to the IVS without face recognition. After receiving the video sent by the image capturing device, the IVS can perform face recognition on the video frames in the video according to the preset frame interval, and obtain the face images and scene images in the corresponding video frames.
  • the image capturing device when it sends the video to the IVS, it can also send the shooting time information at the same time.
  • the shooting time information may be the shooting time corresponding to each video frame in the video, or the shooting start time of the video.
  • the shooting time information is the shooting start time of the video
  • IVS after receiving the shooting start time, IVS can calculate the frame rate of the video frame that needs face recognition in the video according to the shooting start time and the frame rate of the video. filming time.
  • the frame rate of the video may be sent by the image capturing device when sending the video, or may be stored locally by the IVS.
  • the IVS can store the frame rate and the device ID of the image capture device correspondingly, and the image capture device can carry the device ID of the machine when sending video.
  • the IVS can query the frame rate corresponding to the received device identifier according to the received device identifier and the corresponding relationship between the device identifier and the frame rate.
  • the image capturing device may also send at least one information of the shooting location of the video or the device identification of the image capturing device at the same time.
  • the IVS may store the correspondence between the device identifier and the shooting location, and the IVS can determine the corresponding shooting location according to the device identifier.
  • the image capturing device can directly send the captured pictures to the IVS without performing face recognition, and at the same time, it can also send the shooting time and shooting location of each picture.
  • the IVS can perform face recognition on the picture to obtain the face image and scene image in the picture.
  • IVS can process it in real time, that is, after receiving the above data sent by the image capture device, it can directly perform face recognition to obtain a face image, or IVS can first store the received data, and then When there is a need, video frames or pictures are obtained in sequence according to the shooting time, and face recognition is performed to obtain a face image.
  • the acquired face images are acquired in the order of their shooting time.
  • the shooting time corresponding to the face image acquired later is later than the shooting time corresponding to the face image acquired earlier.
  • these images can be captured by the same camera or captured by different cameras.
  • Step 202 performing a deduplication operation on the first image and the stored image set, specifically, may include the following processing:
  • the stored image set contains one or more images, and the images in the image set and the first image have: the same shooting object, the same shooting location, and a shooting time interval less than a preset threshold.
  • the storage location of the stored image is a storage device, such as a computer, a storage server, or a NAS, a storage cloud, a distributed storage device, and the like.
  • the stored image may be located in memory or in a non-volatile medium (eg, hard disk, solid state disk, tape).
  • image collection is a representative name for one or more images. It does not mean that a structure such as a set actually exists, nor does it mean that the executor of this step needs to perform operations such as creating a set. Of course, for the convenience of operation, images that meet the conditions can also be managed by creating sets, and images that meet the same deduplication conditions can be divided into the same set.
  • the deduplication operation may not need to be performed frequently. Therefore, the totality of images that have been received in the past and meet the deduplication (duplication) conditions can be called an image set.
  • the newly-received image and the image that has been stored in the past can be de-duplicated.
  • the population (ie, the set of images) of images eligible for deduplication in the system is periodically deduplicated.
  • every time a face image is obtained it can be determined whether there is a face image stored with the same subject, the same shooting location, and the shooting time interval is less than the preset threshold as the currently obtained face image. If face images satisfying the above conditions are stored, an image set including the currently acquired face images is established.
  • the preset threshold can be set according to actual needs, for example, can be set between 5 minutes and 10 minutes, such as 10 minutes.
  • a plurality of image sets have been stored, such as image set 1, image set 2 and image set 3.
  • the currently obtained face image E, the corresponding shooting object is shooting object 4, and the shooting location is Location b, the shooting time is 10:35 on September 1, 2019, and the face image E has the same shooting object, the same shooting location, and the shooting time interval is less than a preset threshold (for example, 10 minutes) ), an image set 4 needs to be established, and the face image E is added to the image set 4.
  • a preset threshold for example, 10 minutes
  • the face feature data of the currently acquired face image and the stored face features of all or part of the face images in each image set can be used
  • the similarity calculation is performed on the data. If the similarity between the face feature data of the target face image and the face feature data of the currently obtained face image is greater than the preset similarity threshold, it can be considered that the image set where the target face image is located The face image in and the currently acquired face image correspond to the same object.
  • the similarity calculation may be Euclidean distance calculation, cosine distance calculation, or the like.
  • the above part of the face image may be the face image with the highest quality in the image set, and the quality of the face image is related to the illumination of the face image, the angle of the face, and the like.
  • the quality of the face image can also be represented by a quality mark, different quality marks correspond to different quality levels, and the higher the quality level corresponding to the quality mark of the face image, the higher the quality of the face image.
  • a pre-trained feature extraction model can be used to extract features from the currently acquired face image to obtain its corresponding face feature data, and the face The image and the facial feature data are stored correspondingly for use in calculating the similarity of the facial feature data.
  • the pre-trained machine learning model can also be used to identify the gender, age, quality score and other data corresponding to the currently acquired face image. These data can be related to the shooting time and shooting location corresponding to the face image. The data together serve as the structured data of the face image.
  • face images, face feature data and structured data may be stored correspondingly.
  • the currently acquired face image can be stored.
  • the face images are added to the image set where the face images satisfying the above conditions are located.
  • a plurality of image sets have been stored, such as image set 1, image set 2 and image set 3.
  • a trigger condition for the deduplication operation can be set, and when the trigger condition for the deduplication operation is satisfied, the deduplication operation is performed on the face images in the image set, and at least one face image is selected to save, and no The selected face image is deleted.
  • the face image newly added to the image set is hereinafter referred to as the first face image.
  • trigger conditions for the deduplication operation some of which are listed below:
  • no face image is acquired that has the same shooting object, the same shooting location, and a shooting time interval smaller than the preset threshold as the first face image.
  • the preset duration may be equal to the preset threshold.
  • the preset threshold may be set to 10 minutes, and the corresponding preset duration may also be set to 10 minutes, or the preset duration may be set to be slightly larger than the preset threshold.
  • a face image with the same shooting object as the first face image and a different shooting location is obtained.
  • the shooting object corresponding to the first face image has gone to a place other than the shooting location corresponding to the image set where the first face image is located, then the image set where the first face image is located can be de-duplicated operate.
  • the size of the storage space occupied by the face images in each image set can be detected according to the preset detection period, and if it is greater than the target storage value, the image set can be deduplicated.
  • the target storage value can be set according to actual needs, for example, can be set to 300KB to 600KB.
  • the number of face images in each image set may be detected according to a preset detection period, and if the number is greater than the preset number, a deduplication operation may be performed on the image set.
  • the number of targets can be set according to actual needs, for example, it can be set to 10 (or 20) images, that is, deduplication is performed whenever 10 (or 20) similar images are collected.
  • the number of targets can also be set to 2, that is, whenever an image with the same shooting object, the same shooting location and the shooting time interval less than the preset threshold is obtained as the first face image in the image set, the The image collection is deduplicated.
  • the third trigger condition of the deduplication operation and the fourth trigger condition of the deduplication operation can both reduce the storage pressure of the device.
  • Deduplication regularly, for example, every day at 3:00 a.m., the images in the storage device are searched, and the set of images that meet the deduplication conditions (that is, the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold) multiple images) for deduplication.
  • the deduplication conditions that is, the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold
  • the trigger conditions 1, 2, and 3, or 1, 2, 4, and 5 of the above-mentioned deduplication operation can be used in combination.
  • the at least one face image selected in the above-mentioned deduplication operation is the face image with the highest quality in the image set.
  • a preset number of face images may be selected for saving.
  • the preset number may be set according to actual requirements, and may be an integer greater than or equal to 1.
  • the shooting time corresponding to the selected face image may also be modified to the target shooting time period.
  • the start time in the target shooting time period is the earliest time in the shooting time corresponding to the face image in the image set, and the end time in the target shooting time period is the latest in the shooting time corresponding to the face image in the image set. time.
  • an image set includes face image X, face image Y and face image Z, wherein:
  • Face image X subject 1, shooting location a, shooting time at 10:00 on September 1, 2020, quality score 90;
  • Face image Y subject 1, shooting location a, shooting time at 10:02 on September 1, 2020, quality score 87;
  • Face image Z subject 1, shooting location a, shooting time at 10:06 on September 1, 2020, quality score 96.
  • the face image Z has the highest quality score, and the face image Z can be saved, and the face image X and the face image Y can be deleted.
  • the shooting time corresponding to the face image Z can be modified to a shooting time period, wherein the starting time in the shooting time period is the earliest time among the shooting times corresponding to the face image X, the face image Y and the face image Z. : At 10:00 on September 1, 2020, the end time in the shooting time period is the latest time among the shooting times corresponding to face image X, face image Y and face image Z: September 1, 2020 10: 06.
  • structured data and face feature data of unselected face images can also be deleted.
  • the trigger condition for the deduplication operation includes the trigger condition 3 of the deduplication operation or the trigger condition 4 of the deduplication operation
  • it may happen that the object stays at the same shooting location for a long time The face images are continuously captured by the image capturing equipment at the shooting location, and these face images only need to save the face images with the best quality.
  • these face images are divided into multiple batches for deduplication, which will save more face images. Therefore, the saved face images can also be deduplicated twice.
  • processing It can be as follows: in the two-person face images with the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold, the higher-quality face images are retained, and the lower-quality face images are deleted.
  • Face image 1 subject 1, shooting location a, shooting time period 10:00 on September 1, 2020 to 10:15 on September 1, 2020, quality score 90;
  • Face image 2 subject 1, shooting location a, shooting time period from 10:17 on September 1, 2020 to 10:30 on September 1, 2020, quality score 85;
  • Face image 3 subject 1, shooting location a, shooting time period from 10:35 on September 1, 2020 to 10:50 on September 1, 2020, with a quality score of 95.
  • the photographing objects and locations corresponding to face image 1 and face image 2 are the same, and the minimum time interval of the corresponding photographing time period is 2 minutes less than a preset threshold (for example, 10 minutes), and then it is determined that face image 1
  • face image 1 The quality score is greater than the quality score of face image 2, then face image 1 is saved, and face image 2 is deleted.
  • the start time of the shooting time period corresponding to face image 1 is modified to the earliest shooting time in the shooting time period corresponding to face image 1 and face image 2: 10:00 on September 1, 2020
  • the face The end time of the shooting time period corresponding to image 1 is modified to the latest shooting time in the shooting time period corresponding to face image 1 and face image 2: 10:30 on September 1, 2020.
  • the relevant information of face image 1 is as follows:
  • Face image 1 subject 1, shooting location a, shooting time period from 10:00 on September 1, 2020 to 10:30 on September 1, 2020, with a quality score of 90.
  • the subject and the shooting location corresponding to the modified face 1 and the face image 3 are the same, and the minimum time interval of the corresponding shooting time period is 5 minutes less than the above-mentioned preset threshold, and it is determined that the face image 3 If the quality score is greater than the quality score of face image 1, face image 3 is retained and face image 1 is deleted.
  • the start time of the shooting time period corresponding to face image 3 is modified to the earliest shooting time in the shooting time period corresponding to face image 1 and face image 3: 10:00 on September 1, 2020, the face The end time of the shooting time period corresponding to image 3 is modified to the latest shooting time in the shooting time period corresponding to face image 1 and face image 3: 10:50 on September 1, 2020.
  • the relevant information of face image 3 is as follows:
  • Face image 3 subject 1, shooting location a, shooting time period from 10:00 on September 1, 2020 to 10:50 on September 1, 2020, with a quality score of 95.
  • the face image can be further de-duplicated, so as to achieve the purpose of retaining only the highest-quality face image of the same object shot at the same shooting location in a short period of time. storage.
  • an embodiment of the present application also provides a device for image storage, as shown in Figure 6, the device includes:
  • an acquisition module 610 configured to acquire the first image, and specifically can implement the acquisition function mentioned in the above step 201, as well as other implicit steps;
  • the deduplication module 620 is used to perform deduplication operation on the first image and the stored image set, and is specifically used for:
  • the deduplication module 620 can implement the deduplication function mentioned in the above step 202, as well as other implicit steps.
  • the apparatus further includes:
  • the establishment module 630 is used to obtain the second image, if there is no third image with the same shooting object, the same shooting location, and the shooting time interval smaller than the preset threshold as the second image, then establish An image collection including the second image.
  • the trigger condition of the deduplication operation includes:
  • a fourth person who has the same subject, the same shooting location, and the shooting time interval less than the preset threshold as the first face image has not been acquired face image.
  • the trigger condition of the deduplication operation includes:
  • a fifth face image with the same shooting object as the first face image and a different shooting location is obtained.
  • the trigger condition of the deduplication operation includes:
  • the deduplication module 620 is further configured to:
  • the starting time in the target shooting time period is the difference between the images in the image re-set and the shooting time of the first image.
  • the earliest time, the end time in the target shooting time period is the latest time in the shooting time of the image in the image set and the first image;
  • the selected image is the image with the highest quality, such as the one image with the highest quality, or the two images with the highest quality.
  • the acquiring module 610 is further configured to acquire images in the image set from the storage device, where the images in the image set and the first image have: the same shooting object, the same shooting location, and shooting less than a preset threshold time interval;
  • the deduplication module 620 is further configured to perform deduplication operations on the first image and the stored image set, specifically including:
  • FIG. 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the computer device may be the IVS in the above method embodiment.
  • the computer device 700 may vary greatly due to different configurations or performances, and may include a or more than one processor (central processing units, CPU) 701 and one or more than one memory 702, wherein, the memory 702 stores at least one instruction, the at least one instruction is loaded and executed by the processor 701 to The methods provided by the foregoing method embodiments are implemented.
  • the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface for input and output, and the server may also include other components for implementing device functions, which will not be described here.
  • the computer program product includes one or more computer instructions, and when the computer program instructions are loaded and executed on a device, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that the device can access, or a data storage device such as a server, data center, or the like that includes an integration of one or more available media.
  • the usable medium may be a magnetic medium (such as a floppy disk, a hard disk, and a magnetic tape, etc.), an optical medium (such as a digital video disk (Digital Video Disk, DVD), etc.), or a semiconductor medium (such as a solid-state disk, etc.).
  • All or part of the steps in the above-mentioned embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be only a computer-readable storage medium. Read memory, disk or CD, etc.

Abstract

An image storage method and apparatus, a computer device and a storage medium, relating to the technical field of data storage. The method comprises: acquiring a first image, selecting and storing at least one image from among the first image and a stored image set, and deleting unselected images. The stored image set contains one or more images. The images in the image set and the first image have the same photographed subject, the same photographed place, and a photographing time interval less than a preset threshold value. In the present application, not all of the images of the same photographed subject that are consecutively photographed at the same place within a short time are stored, only some of the images are selected and stored, such that a waste of storage space can be effectively reduced.

Description

图像存储的方法、装置、计算机设备和存储介质Image storage method, apparatus, computer equipment and storage medium
本申请要求于2020年09月15日提交的申请号为202010968900.0、发明名称为“图像存储的方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with application number 202010968900.0 filed on September 15, 2020 and the title of the invention is "image storage method, device, computer equipment and storage medium", the entire contents of which are incorporated herein by reference Applying.
技术领域technical field
本申请涉及数据存储技术领域,特别涉及一种图像存储的方法、装置、计算机设备和存储介质。The present application relates to the technical field of data storage, and in particular, to a method, apparatus, computer device and storage medium for image storage.
背景技术Background technique
随着视频监控的不断发展,在视频监控的基础上衍生出了人脸检索、人脸追踪等视图应用。在实现视图应用之前通常可以对拍摄的图像进行如下处理。With the continuous development of video surveillance, view applications such as face retrieval and face tracking have been derived from video surveillance. The captured image can usually be processed as follows before implementing the view application.
摄像机将实时拍摄的图像发送至存储系统,例如华为公司的智能视频监控平台(Intelligent Video Surveillance,IVS),IVS对接收到的图像进行解析,得到图像中的人脸图像,以及每个人脸图像对应的人脸特征数据和结构化数据。其中,人脸特征数据可以为特征向量,结构化数据包括人脸图像对应的拍摄时间、拍摄地点、质量分值、年龄、性别等。然后,将人脸图像和对应的人脸特征数据、人脸结构化数据对应存储,以供后续的视图应用使用。The camera sends the real-time captured images to the storage system, such as Huawei's Intelligent Video Surveillance (IVS), which parses the received images to obtain the face images in the images, and the corresponding images of each face. facial feature data and structured data. The face feature data may be a feature vector, and the structured data includes the shooting time, shooting location, quality score, age, gender, etc. corresponding to the face image. Then, the face image, the corresponding face feature data, and the face structured data are stored correspondingly for use by subsequent view applications.
在实现本申请的过程中,发明人发现相关技术至少存在以下问题:In the process of realizing this application, the inventor found that the related art has at least the following problems:
如果某一拍摄对象在同一地点长时间停留,那么,该地点部署的摄像机会持续拍摄大量包括该拍摄对象的图像。这样,在IVS对这些图像进行解析时,会得到该拍摄对象的大量人脸图像,这些人脸图像相互间十分相似,但是却会占用大量的存储空间,造成对存储空间的浪费。If a subject stays in the same location for a long time, cameras deployed at that location will continue to capture a large number of images that include the subject. In this way, when the IVS analyzes these images, a large number of face images of the photographed object will be obtained. These face images are very similar to each other, but they will occupy a large amount of storage space and cause a waste of storage space.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种图像存储的方法、装置、计算机设备和存储介质。所述技术方案如下:Embodiments of the present application provide an image storage method, apparatus, computer device, and storage medium. The technical solution is as follows:
第一方面,提供了一种图像存储的方法,该方法包括:In a first aspect, a method for image storage is provided, the method comprising:
获取第一图像,对第一图像与已存储的图像集合进行去重操作,具体包括:Acquire the first image, and perform a deduplication operation on the first image and the stored image set, specifically including:
从第一图像与已存储的图像集合中选择至少一张图像进行保存,其中,已存储的图像集合中拥有一张或者多张图像,图像集合中的图像与第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔,删除未选择的图像。Select at least one image from the first image and the stored image set to save, wherein the stored image set contains one or more images, and the images in the image set and the first image have: the same shooting object , the same shooting location, and the shooting time interval less than a preset threshold, delete the unselected images.
在本申请实施例提供的方案中,图像可以为人脸图像,为了便于说明,以下均以图像为人脸图像为了进行说明。拍摄地点为图像拍摄设备所在地点,预设阈值可以为5分钟到10分钟。人脸图像可以为图像拍摄设备对拍摄的视频进行人脸识别后得到的,然后再由图像拍摄设备发送给智能视频监控平台(IVS,Intelligent Video Surveillance),也可以为IVS对图像拍摄设备发送的视频进行人脸识别得到的。此外,IVS获取人脸图像是按照拍摄时间顺序获取 的。例如,在后获取的人脸图像对应的拍摄时间要晚于在先获取的人脸图像对应的拍摄时间。每次获取到人脸图像后,如果确定存储有与当前获取到的人脸图像对应的拍摄对象和拍摄地点相同、且拍摄时间间隔小于预设阈值的人脸图像,则将当前获取到的人脸图像添加到该满足上述条件的人脸图像对应的图像集合中。具体的,判断两人脸图像是否对应同一拍摄对象时,可以计算二者的特征数据的相似度,如果相似度大于预设阈值,则认为二者对应同一拍摄对象。In the solutions provided by the embodiments of the present application, the image may be a face image, and for the convenience of description, the following image is a face image for description. The shooting location is the location where the image shooting device is located, and the preset threshold may be 5 minutes to 10 minutes. The face image can be obtained after the image capture device performs face recognition on the captured video, and then sent by the image capture device to the intelligent video surveillance platform (IVS, Intelligent Video Surveillance), or it can be sent by the IVS to the image capture device. The video is obtained by face recognition. In addition, the face images acquired by IVS are acquired in the order of shooting time. For example, the shooting time corresponding to the face image acquired later is later than the shooting time corresponding to the face image acquired earlier. After each acquisition of a face image, if it is determined that there is a face image with the same shooting object and shooting location as the currently acquired face image, and the shooting time interval is less than the preset threshold, the currently acquired face image will be stored. The face image is added to the image set corresponding to the face image satisfying the above conditions. Specifically, when judging whether the two face images correspond to the same shooting object, the similarity of the feature data of the two can be calculated, and if the similarity is greater than a preset threshold, it is considered that the two correspond to the same shooting object.
对于上述添加处理后的图像集合中的人脸图像可以选择至少一张人脸图像进行保存,其余进行删除处理。这样,对于同一地点短时间内连续拍摄到的同一对象的人脸图像可以做去重操作,无需全部存储,有效节省了存储资源。For the face images in the above-mentioned image set after adding processing, at least one face image can be selected to be saved, and the rest can be deleted. In this way, a deduplication operation can be performed on the face images of the same object that are continuously photographed at the same location in a short period of time, and it is not necessary to store all of them, which effectively saves storage resources.
在一种可能的实现方式中,该方法还包括:In a possible implementation, the method further includes:
获取第二图像,如果未存储有与第二图像具有相同的拍摄对象、相同的拍摄地点、以及小于预设阈值的拍摄时间间隔的第三图像,则建立包括第二图像的图像集合。Acquiring a second image, and establishing an image set including the second image if there is no third image having the same shooting object, the same shooting location, and a shooting time interval smaller than a preset threshold as the second image.
在本申请实施例提供的方案中,每当获取到人脸图像时,可以先判断是否存储有与该人脸图像具有相同的拍摄对象、相同的拍摄地点、以及小于预设阈值的拍摄时间间隔的人脸图像,如果未存储有与该人脸图像具有相同的拍摄对象、相同的拍摄地点、以及小于预设阈值的拍摄时间间隔人脸图像,则建立新建一个图像集合,将获取的该人脸图像添加到新建的图像集合中。In the solution provided by the embodiment of the present application, whenever a face image is acquired, it can be judged first whether there is the same shooting object, the same shooting location, and the shooting time interval smaller than the preset threshold as the face image. If there is no face image with the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold as the face image, a new image set will be established, and the obtained face image will be The face image is added to the newly created image collection.
在一种可能的实现方式中,上述去重操作的触发条件可以包括:In a possible implementation manner, the triggering conditions of the above-mentioned deduplication operation may include:
在获取到第一图像之后的预设时长内,未获取到与第一人脸图像具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的第四人脸图像。Within a preset period of time after the first image is acquired, a fourth face image with the same shooting object, the same shooting location, and a shooting time interval smaller than the preset threshold as the first face image is not acquired.
在本申请实施例提供的方案中,对于一个图像集合来说,如果在获取到第一人脸图像(该图像集合中最新添加的人脸图像)后的预设时长内,未获取到与第一人脸图像具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的人脸图像,则可以对图像集合进行去重操作。其中,预设时长可以等于上述预设阈值,例如,去重时间间隔设置为10分钟,相应的预设时长也可以设置为10分钟,或者预设时长可以设置可以略大于上述预设阈值。In the solution provided by the embodiment of the present application, for an image set, if the first face image (the latest added face image in the image set) is obtained within a preset time period, the first face image is not obtained. If the face image has the same shooting object, the same shooting location, and the face image whose shooting time interval is less than the preset threshold, the image collection can be de-duplicated. The preset duration may be equal to the aforementioned preset threshold. For example, the deduplication time interval may be set to 10 minutes, and the corresponding preset duration may also be set to 10 minutes, or the preset duration may be set to be slightly larger than the aforementioned preset threshold.
在一种可能的实现方式中,上述去重操作的触发条件可以包括:In a possible implementation manner, the triggering conditions of the above-mentioned deduplication operation may include:
获取到与第一人脸图像具有相同的拍摄对象,不同的摄地点的第五人脸图像。A fifth face image with the same shooting object as the first face image and a different shooting point is obtained.
在本申请实施例提供的方案中,在此情况下,说明第一人脸图像对应的拍摄对象已经去了另外的地点,则可以对图像集合进行去重操作。In the solution provided by the embodiment of the present application, in this case, it is indicated that the photographing object corresponding to the first face image has gone to another place, and the image set can be deduplicated.
在一种可能的实现方式中,上述去重操作的触发条件可以包括:In a possible implementation manner, the triggering conditions of the above-mentioned deduplication operation may include:
确定图像集合包括的人脸图像的数量大于目标数量,或者,确定图像集合包括的人脸图像所占存储空间的大小大于目标存储值。It is determined that the number of face images included in the image set is greater than the target number, or it is determined that the size of the storage space occupied by the face images included in the image set is greater than the target storage value.
在本申请实施例提供的方案中,可以按照预设检测周期,检测每个图像集合中包括的人脸图像的数量,如果大于预设数量,则可以对该图像集合进行去重操作。其中,目标数量可以根据实际需求设置,例如预设数量可以设置为10张到20张。或者,可以按照预设检测周期,检测每个图像集合中的人脸图像所占存储空间的大小,如果大于目标存储值,则可以将该图像集合进行去重操作。其中,目标存储值可以根据实际需求设置,例如可以设置为300KB到600KB。In the solution provided by the embodiment of the present application, the number of face images included in each image set may be detected according to a preset detection period, and if the number is greater than the preset number, a deduplication operation may be performed on the image set. The target quantity can be set according to actual needs, for example, the preset quantity can be set to 10 to 20 sheets. Alternatively, the size of the storage space occupied by the face images in each image set may be detected according to a preset detection period, and if it is greater than the target storage value, the image set may be deduplicated. Among them, the target storage value can be set according to actual needs, for example, can be set to 300KB to 600KB.
在一种可能的实现方式中,该方法还包括:In a possible implementation, the method further includes:
将被选择的人脸图像的拍摄时间修改为目标拍摄时间段,其中,目标拍摄时间段中的起始时间为图像重集合中的图像和所述第一图像的拍摄时间中的最早时间,目标拍摄时间段中的结束时间为图像集合中的图像和第一图像的拍摄时间中的最晚时间,删除未选择的图像的结构化数据和人脸特征数据。Modify the shooting time of the selected face image to the target shooting time period, wherein the starting time in the target shooting time period is the earliest time in the shooting time of the image in the image regroup and the first image, and the target shooting time The end time in the shooting time period is the latest time in the shooting time of the images in the image set and the first image, and the structured data and face feature data of the unselected images are deleted.
在本申请实施例提供的方案中,为了进一步节省存储空间,在删除未选择的人脸图像时,还可以删除这些人脸图像对应的结构化数据和人脸特征数据。此外,对于去除集合中保留至少一张人脸图像,可以将其拍摄时间修改为目标拍摄时间段,其中,目标拍摄时间段中的起始时间为图像集合中的人脸图像对应的拍摄时间中的最早时间,目标拍摄时间段中的结束时间为图像集合中的人脸图像对应的拍摄时间中的最晚时间。这样,保存的人脸图像及其结构化数据可以表示对应的拍摄对象在上述目标拍摄时间段内位于该人脸图像对应的拍摄地点处。In the solution provided by the embodiment of the present application, in order to further save storage space, when deleting unselected face images, the structured data and face feature data corresponding to these face images may also be deleted. In addition, for retaining at least one face image in the removal set, its shooting time can be modified to the target shooting time period, wherein the starting time in the target shooting time period is the shooting time corresponding to the face image in the image set. The earliest time in the target shooting time period is the latest time in the shooting time corresponding to the face image in the image set. In this way, the saved face image and its structured data may indicate that the corresponding shooting object is located at the shooting location corresponding to the face image within the above-mentioned target shooting time period.
在一种可能的实现方式中,所述被选择的图像是质量最高的图像。In one possible implementation, the selected image is the highest quality image.
在本申请实施例提供的方案中,人脸图像的质量高低与人脸图像的光照、人脸角度等因素有关,通常可以以质量分值表示。In the solution provided by the embodiment of the present application, the quality of the face image is related to factors such as the illumination of the face image, the angle of the face, and the like, and can usually be expressed by a quality score.
第二方面,提供了一种图像存储的装置,所述装置包括:In a second aspect, an image storage device is provided, the device comprising:
获取模块,用于第一图像;an acquisition module for the first image;
去重模块,用于对所述第一图像与已存储的图像集合进行去重操作,具体用于:A deduplication module, configured to perform a deduplication operation on the first image and the stored image set, and is specifically used for:
从所述第一图像与已存储的图像集合中选择至少一张图像进行保存,其中,所述已存储的图像集合中拥有一张或者多张图像,所述图像集合中的图像与所述第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔;Select at least one image from the first image and the stored image set to save, wherein the stored image set has one or more images, and the image in the image set is the same as the first image. An image has: the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold;
删除未选择的图像。Delete unselected images.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
建立模块,用于获取第二图像,如果未存储有与所述第二图像具有相同的拍摄对象、相同的拍摄地点、以及小于所述预设阈值的拍摄时间间隔的第三图像,则建立包括所述第二图像的图像集合。The establishment module is used to obtain the second image, and if there is no third image with the same shooting object, the same shooting location, and the shooting time interval smaller than the preset threshold value as the second image, the establishment includes: an image collection of the second image.
在一种可能的实现方式中,所述去重操作的触发条件,包括:In a possible implementation manner, the trigger condition of the deduplication operation includes:
在获取到所述第一图像之后的预设时长内,未获取到与所述第一人脸图像具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的第四人脸图像。Within a preset period of time after the first image is acquired, a fourth person who has the same subject, the same shooting location, and the shooting time interval less than the preset threshold as the first face image has not been acquired face image.
在一种可能的实现方式中,所述去重操作的触发条件,包括:In a possible implementation manner, the trigger condition of the deduplication operation includes:
获取到与所述第一人脸图像具有相同的拍摄对象,不同的摄地点的第五人脸图像。A fifth face image with the same shooting object as the first face image and a different shooting location is obtained.
在一种可能的实现方式中,所述去重操作的触发条件,包括:In a possible implementation manner, the trigger condition of the deduplication operation includes:
确定所述图像集合包括的人脸图像的数量大于目标数量,或者,It is determined that the number of face images included in the image set is greater than the target number, or,
确定所述图像集合包括的人脸图像所占存储空间的大小大于目标存储值。It is determined that the size of the storage space occupied by the face images included in the image set is greater than the target storage value.
在一种可能的实现方式中,所述去重模块,还用于:In a possible implementation manner, the deduplication module is further used for:
将被选择的人脸图像的拍摄时间修改为目标拍摄时间段,其中,所述目标拍摄时间段中的起始时间为所述图像重集合中的图像和所述第一图像的拍摄时间中的最早时间,所述目标拍摄时间段中的结束时间为所述图像集合中的图像和所述第一图像的拍摄时间中的最晚时间;Modify the shooting time of the selected face image to a target shooting time period, wherein the starting time in the target shooting time period is the difference between the images in the image re-set and the shooting time of the first image. The earliest time, the end time in the target shooting time period is the latest time in the shooting time of the image in the image set and the first image;
删除未选择的图像的结构化数据和人脸特征数据。Remove structured data and facial feature data for unselected images.
在一种可能的实现方式中,被选择的图像是质量最高的图像。In one possible implementation, the selected image is the highest quality image.
第三方面,提供了一种图像存储的方法,所述方法包括:In a third aspect, a method for image storage is provided, the method comprising:
从存储设备中获取图像集合中的图像,图像集合中的图像与第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔;对第一图像与已存储的图像集合进行去重操作,具体包括:从图像集合中选择一张图像进行保存,删除未选择的图像。The images in the image set are acquired from the storage device, and the images in the image set and the first image have: the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold; The deduplication operation is performed on the image collection, which specifically includes: selecting an image from the image collection to save, and deleting unselected images.
在本申请实施例所提供的方案中,在将图像集合中图像的数量或者占用存储空间作为去重操作的触发条件时,可能会出现如下情况:对象在同一拍摄地点长时间停留,被该拍摄地点的图像拍摄设备连续拍摄到人脸图像,而这些人脸图像只需保存质量最好的人脸图像即可,但是由于上述触发条件,导致这些人脸图像是被分为多批次去重的,这样就会保存更多的人脸图像,因此,对于保存下来的人脸图像还可以进行二次去重。上述情况下保存下来的一些图像之间满足具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的条件,这些图像可以认为是属于同一图像集合,对于这些图像可以选择质量最好的一张图像进行保存,而余下的图像进行删除处理即可。In the solution provided by the embodiment of the present application, when the number of images in the image set or the occupied storage space is used as the triggering condition for the deduplication operation, the following situation may occur: the object stays at the same shooting location for a long time, and is shot by the The image capturing equipment at the location continuously captures face images, and these face images only need to save the face images with the best quality. However, due to the above trigger conditions, these face images are divided into multiple batches for deduplication. In this way, more face images will be saved. Therefore, the saved face images can also be deduplicated twice. Some images saved in the above cases meet the conditions of having the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold, these images can be considered to belong to the same image set, and the quality can be selected for these images. The best image is saved, and the remaining images can be deleted.
第四方面,提供了一种图像存储的装置,所述装置包括:In a fourth aspect, an image storage device is provided, the device comprising:
获取模块,用于从存储设备中获取图像集合中的图像,所述图像集合中的图像与第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔;an acquisition module, configured to acquire an image in an image set from a storage device, where the image in the image set and the first image have: the same shooting object, the same shooting location, and a shooting time interval less than a preset threshold;
去重模块,用于对所述图像集合进行去重操作,具体用于:The deduplication module is used to perform deduplication operation on the image set, and is specifically used for:
从图像集合中选择一张图像进行保存;Select an image from the image collection to save;
删除未选择的图像。Delete unselected images.
第五方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如上述第一方面和第三方面所述的图像存储的方法所执行的操作。In a fifth aspect, a computer device is provided, the computer device includes a processor and a memory, the memory stores at least one instruction, the instruction is loaded and executed by the processor to implement the above-mentioned first aspect and The operations performed by the method for image storage described in the third aspect.
第六方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如上述第一方面和第三方面所述的图像存储的方法所执行的操作。In a sixth aspect, a computer-readable storage medium is provided, the storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to implement the image storage as described in the first and third aspects above the operation performed by the method.
第七方面,提供了一种计算机程序产品,当所述计算机程序产品在计算机设备上运行时,使得所述计算机设备执行如上述第一方面和第三方面所述的图像存储的方法所执行的操作。A seventh aspect provides a computer program product that, when the computer program product is run on a computer device, causes the computer device to execute the image storage method as described in the first and third aspects above. operate.
本申请实施例提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solutions provided in the embodiments of the present application are:
本申请实施例中,在获取到图像后,可以对获取到该图像与存储的图像集合中的图像进行去重处理,此处图像集合中的图像与当前获取的图像满足如下条件:具有相同的拍摄时间、相同的拍摄地点,且拍摄时间间隔小于预设阈值,这样即说明当前获取的图像以及该图像集 合中的图像是同一个对象在相同拍摄地点短时间内连续拍摄的多张图像,这些图像相互间十分相似。这样,对于这些图像无需全部保存,仅选择部分分图像保存,删除未选择的图像,可以有效节省了存储资源。In this embodiment of the present application, after an image is acquired, de-duplication processing may be performed on the acquired image and the image in the stored image set, where the image in the image set and the currently acquired image satisfy the following conditions: have the same The shooting time, the same shooting location, and the shooting time interval is less than the preset threshold, which means that the currently acquired image and the images in the image set are multiple images continuously shot by the same object in the same shooting location in a short period of time. The images are very similar to each other. In this way, it is not necessary to save all of these images, only some images are selected to be saved, and unselected images are deleted, which can effectively save storage resources.
附图说明Description of drawings
图1是本申请实施例提供的一种实施场景示意图;FIG. 1 is a schematic diagram of an implementation scenario provided by an embodiment of the present application;
图2是本申请实施例提供的一种图像存储的方法流程图;2 is a flowchart of a method for image storage provided by an embodiment of the present application;
图3是本申请实施例提供的一种建立图像集合的示意图;3 is a schematic diagram of establishing an image set provided by an embodiment of the present application;
图4是本申请实施例提供的一种向图像集合添加人脸图像的示意图;4 is a schematic diagram of adding a face image to an image set provided by an embodiment of the present application;
图5是本申请实施例提供的一种人脸图像去重的示意图;5 is a schematic diagram of a face image deduplication provided by an embodiment of the present application;
图6是本申请实施例提供的一种图像存储的装置结构示意图;6 is a schematic structural diagram of an apparatus for image storage provided by an embodiment of the present application;
图7是本申请实施例提供的一种计算机设备的结构示意图。FIG. 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
具体实施方式detailed description
本申请实施例提供了一种图像存储的方法,该方法可以由计算机设备实现,该计算机设备拥有存储功能,例如是计算机、服务器、网络附加存储(network attached storage,NAS)存储系统、存储区域网络(storage area network,SAN)存储系统、分布式存储系统、云存储系统、网络硬盘刻录机(network video recorder,NVR)等。具体而言,可以为华为公司的智能视频监控平台(intelligent video surveillance,IVS)。IVS可以为用户提供人脸检索等服务,下面以此进行举例。An embodiment of the present application provides an image storage method, which can be implemented by a computer device, and the computer device has a storage function, such as a computer, a server, a network attached storage (NAS) storage system, a storage area network (storage area network, SAN) storage system, distributed storage system, cloud storage system, network video recorder (NVR), etc. Specifically, it can be an intelligent video surveillance platform (intelligent video surveillance, IVS) of Huawei. IVS can provide users with services such as face retrieval. The following is an example.
参见图1,本申请实施例的实施场景中可以包括有前端的图像拍摄设备以及IVS,其中,图像拍摄设备可以为常规摄像机,还可以为可以安装应用的智能摄像机,例如软件定义摄像机(software defined camera,SDC)。图像拍摄设备可以根据实际需要部署在街道、路口等地点。在本申请实施例中图像拍摄设备可以将拍摄的图像发送至IVS,由IVS对同一图像拍摄设备短时间内连续拍摄到的同一对象的图像进行去重,这样,可以有效节省存储空间,使得有限的存储空间内,可以存储更多有价值的数据。此外,在上述对象为人,图像为人脸图像的情况下,IVS可以给用户提供人脸检索等服务,在本申请实施例对人脸图像进行去重操作的基础上,IVS在进行人脸检索时,人脸图像由于进行了去重操作,总量相对较少,可以有效提高人脸检索的效率,给用户更好的使用体验。本实施例中去除重复图像的依据是:把拥有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的图像认为是相似的图像。对于这些相似的图像进行重复图像删除。也就是,仅保留其中的一种(或者多张),把余下的图像删除,从而节约存储空间。Referring to FIG. 1 , the implementation scene of the embodiment of the present application may include a front-end image capturing device and an IVS, wherein the image capturing device may be a conventional camera, or may be a smart camera that can be installed with applications, such as a software-defined camera (software defined camera). camera, SDC). Image shooting equipment can be deployed in streets, intersections and other places according to actual needs. In this embodiment of the present application, the image capturing device can send the captured images to the IVS, and the IVS deduplicates the images of the same object continuously captured by the same image capturing device in a short period of time. In this way, the storage space can be effectively saved, and the limited In the storage space, more valuable data can be stored. In addition, in the case that the above-mentioned object is a person and the image is a face image, IVS can provide the user with services such as face retrieval. , due to the deduplication operation, the total amount of face images is relatively small, which can effectively improve the efficiency of face retrieval and give users a better experience. The basis for removing duplicate images in this embodiment is that images with the same shooting object, the same shooting location, and a shooting time interval smaller than a preset threshold are considered as similar images. Duplicate image deletion is performed on these similar images. That is, only one (or multiple) of them is kept, and the rest of the images are deleted, thereby saving storage space.
去除重复图像的操作可以有多种操作模式,例如:The operation of removing duplicate images can have various modes of operation, such as:
模式一:存储设备中已经存储了多张图像(这多张图像的整体称为图像集合),在这多张图像之间进行去重。Mode 1: Multiple images have been stored in the storage device (the whole of the multiple images is called an image set), and deduplication is performed between the multiple images.
模式二:存储设备中已经存储了多张图像(这多张图像的整体称为图像集合),对新收到的图像与已经存储的多张图像之间进行去重。Mode 2: Multiple images have been stored in the storage device (the whole of the multiple images is called an image set), and deduplication is performed between the newly received image and the multiple stored images.
参见图2,本申请实施例提供的一种图像存储的方法流程可以包括如下步骤:Referring to FIG. 2 , a method flow of an image storage provided by an embodiment of the present application may include the following steps:
步骤201、获取第一图像。Step 201: Acquire a first image.
第一图像可以和图像集合的获取位置不一样,例如第一图像是计算机设备从存储设备的外部获取,而图像集合是计算机设备从存储设备之中获取。第一图像可以和图像集合的获取位置一样,例如都由计算机设备从存储设备之中获取。计算机设备和存储设备可以集成在一起,例如拥有计算功能的存储设备。The acquisition location of the first image and the image set may be different, for example, the first image is acquired by the computer device from outside the storage device, and the image set is acquired by the computer device from the storage device. The first image may be acquired from the same location as the image set, for example, both acquired from a storage device by a computer device. Computer devices and storage devices can be integrated together, such as storage devices with computing capabilities.
其中,图像可以为人脸图像,以下实施例中均以图像为人脸图像为例进行说明。The image may be a face image, and in the following embodiments, the image is a face image as an example for description.
在实施中,根据图像拍摄设备的功能不用,IVS获取人脸图像的方法也可以不同。下面对于IVS获取人脸图像的方法进行说明:In implementation, according to the different functions of the image capturing device, the method of acquiring the face image by the IVS may also be different. The following describes the method for obtaining a face image by IVS:
方法一、method one,
图像拍摄设备拍摄视频的情况下:In the case of video capture by image capture equipment:
图像拍摄设备拍摄视频后,按照预设帧间隔对视频中的视频帧进行人脸识别,得到相应视频帧中的人脸图像和场景图像。其中,预设帧间隔例如可以为3帧、5帧等。然后,将视频帧中的人脸图像发送至IVS,IVS即可以直接获取到人脸图像。After the image capturing device captures the video, face recognition is performed on the video frames in the video according to the preset frame interval to obtain the face image and the scene image in the corresponding video frame. The preset frame interval may be, for example, 3 frames, 5 frames, or the like. Then, the face image in the video frame is sent to the IVS, and the IVS can directly obtain the face image.
此外,图像拍摄设备在向IVS发送每个视频帧的人脸图像时,还可以同时发送视频帧中的场景图像以及对应的拍摄时间、拍摄地点,其中,拍摄地点即为图像拍摄设备所在地点。或者,图像拍摄设备可以不发送人脸图像的拍摄地点,而是发送图像拍摄设备的设备标识。In addition, when sending the face image of each video frame to the IVS, the image capturing device can also simultaneously send the scene image in the video frame and the corresponding shooting time and shooting location, where the shooting location is the location of the image capturing device. Alternatively, the image capturing device may not send the capturing location of the face image, but the device identification of the image capturing device.
图像拍摄设备拍摄图片的情况下:In the case of a picture taken by an image capture device:
图像拍摄设备拍摄图片后,对拍摄的图片进行人脸识别,得到每个图片中的人脸图像和场景图像。然后,将每个图片中的人脸图像发送至IVS,则IVS可以直接获取到人脸图像。After the image capturing device captures a picture, face recognition is performed on the captured picture to obtain a face image and a scene image in each picture. Then, the face image in each picture is sent to the IVS, and the IVS can directly obtain the face image.
此外,图像拍摄设备在向IVS发送每个图片对应的人脸图像时,还可以同时发送该图片中的场景图像以及对应的拍摄时间、拍摄地点。或者,图像拍摄设备可以不发送人脸图像的拍摄地点,而是发送图像拍摄设备的设备标识。In addition, when sending the face image corresponding to each picture to the IVS, the image capturing device may also send the scene image in the picture and the corresponding shooting time and shooting location at the same time. Alternatively, the image capturing device may not send the capturing location of the face image, but the device identification of the image capturing device.
根据实际需要,IVS可以实时处理,即接收到图像拍摄设备发送的人脸图像后,直接获取该人脸图像,并执行后续处理。或者,IVS可以先对接收到的人脸数据进行存储,在需要进行人脸图像去重时,再按照拍摄时间顺序依次获取人脸图像。例如,技术人员可以设置去重周期,每当达到预设去重时,获取存储的人脸图像,进行去重操作,其中,去重周期可以为一天、三天等。According to actual needs, IVS can process in real time, that is, after receiving the face image sent by the image capturing device, it directly acquires the face image and performs subsequent processing. Alternatively, the IVS may store the received face data first, and then acquire the face images in sequence according to the shooting time when the face image needs to be deduplicated. For example, a technician can set a deduplication period, and every time a preset deduplication period is reached, a stored face image is acquired and a deduplication operation is performed, wherein the deduplication period can be one day, three days, or the like.
方法二、Method Two,
图像拍摄设备拍摄视频的情况下:In the case of video capture by image capture equipment:
图像拍摄设备拍摄视频后,可以不进行人脸识别而直接发送给IVS。IVS在接收到图像拍摄设备发送的视频后,可以按照预设帧间隔对视频中的视频帧进行人脸识别,得到相应视频帧中的人脸图像和场景图像。After the image capture device captures the video, it can be directly sent to the IVS without face recognition. After receiving the video sent by the image capturing device, the IVS can perform face recognition on the video frames in the video according to the preset frame interval, and obtain the face images and scene images in the corresponding video frames.
此外,图像拍摄设备在向IVS发送视频时,还可以同时发送拍摄时间信息。其中,该拍摄时间信息可以为该视频中的每个视频帧分别对应的拍摄时间,还可以是视频的拍摄起始时间。在拍摄时间信息是视频的拍摄起始时间的情况,IVS在接收到该拍摄起始时间后,可以根据该拍摄起始时间以及视频的帧率,计算出视频中需要做人脸识别的视频帧的拍摄时间。In addition, when the image capturing device sends the video to the IVS, it can also send the shooting time information at the same time. The shooting time information may be the shooting time corresponding to each video frame in the video, or the shooting start time of the video. In the case where the shooting time information is the shooting start time of the video, after receiving the shooting start time, IVS can calculate the frame rate of the video frame that needs face recognition in the video according to the shooting start time and the frame rate of the video. filming time.
此处,视频的帧率可以为图像拍摄设备在发送视频时一起发送的,也可以为IVS本地存储的。IVS本地存储帧率的情况下,IVS可以对帧率和图像拍摄设备的设备标识对应存储,图像拍摄设备在发送视频时,可以携带本机的设备标识。相应的,IVS可以根据接收到的设备标识,以及设备标识和帧率的对应关系,查询接收到的设备标识对应的帧率。Here, the frame rate of the video may be sent by the image capturing device when sending the video, or may be stored locally by the IVS. When the IVS stores the frame rate locally, the IVS can store the frame rate and the device ID of the image capture device correspondingly, and the image capture device can carry the device ID of the machine when sending video. Correspondingly, the IVS can query the frame rate corresponding to the received device identifier according to the received device identifier and the corresponding relationship between the device identifier and the frame rate.
另外,图像拍摄设备在向IVS发送视频和拍摄时间信息时,还可以同时发送该视频的拍摄地点或者图像拍摄设备的设备标识中的至少一个信息。在发送设备标识的情况下,IVS可以存储有设备标识与拍摄地点的对应关系,IVS根据设备标识即可确定出对应的拍摄地点。In addition, when sending the video and the shooting time information to the IVS, the image capturing device may also send at least one information of the shooting location of the video or the device identification of the image capturing device at the same time. In the case of sending the device identifier, the IVS may store the correspondence between the device identifier and the shooting location, and the IVS can determine the corresponding shooting location according to the device identifier.
图像拍摄设备拍摄图片的情况下:In the case of a picture taken by an image capture device:
图像拍摄设备可以将拍摄的图片不进行人脸识别而直接发送给IVS,同时,还可以发送每个图片对于的拍摄时间和拍摄地点。The image capturing device can directly send the captured pictures to the IVS without performing face recognition, and at the same time, it can also send the shooting time and shooting location of each picture.
此外,在发送图片的同时还可以发送图片的拍摄地点和拍摄时间。IVS在接收到图像拍摄设备发送的图片后,可以对图片进行人脸识别,得到该图片中的人脸图像和场景图像。In addition, when sending the picture, you can also send the shooting location and shooting time of the picture. After receiving the picture sent by the image capturing device, the IVS can perform face recognition on the picture to obtain the face image and scene image in the picture.
同样的,根据实际需要,IVS可以实时处理,即接收到图像拍摄设备发送的上述数据后,直接执行人脸识别,以获取人脸图像,或者,IVS可以先对接收到的数据进行存储,在有需求时,再按照拍摄时间顺序依次获取视频帧或者图片,进行人脸识别,获取人脸图像。Similarly, according to actual needs, IVS can process it in real time, that is, after receiving the above data sent by the image capture device, it can directly perform face recognition to obtain a face image, or IVS can first store the received data, and then When there is a need, video frames or pictures are obtained in sequence according to the shooting time, and face recognition is performed to obtain a face image.
此处需要说明的是,无论上述方法一还是方法二,获取人脸图像均是按照其拍摄时间顺序获取的。例如,在后获取的人脸图像对应的拍摄时间要晚于在先获取的人脸图像对应的拍摄时间。并且,这些图像可以是同一个摄像机拍摄的,也可以是不同摄像机拍摄的。It should be noted here that, regardless of the first method or the second method, the acquired face images are acquired in the order of their shooting time. For example, the shooting time corresponding to the face image acquired later is later than the shooting time corresponding to the face image acquired earlier. Also, these images can be captured by the same camera or captured by different cameras.
步骤202、对第一图像与已存储的图像集合进行去重操作,具体的,可以包括如下处理: Step 202, performing a deduplication operation on the first image and the stored image set, specifically, may include the following processing:
从第一图像与已存储的图像集合中选择至少一张图像进行保存,删除未选择的图像。其中,已存储的图像集合中拥有一张或者多张图像,图像集合中的图像与第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔。Select at least one image from the first image and the set of stored images to save, and delete unselected images. The stored image set contains one or more images, and the images in the image set and the first image have: the same shooting object, the same shooting location, and a shooting time interval less than a preset threshold.
其中,已存储图像的存储位置是存储设备,例如计算机、存储服务器,或者NAS、存储云,分布式存储设备等。具体而言,已存储图像可以位于内存中或者非易失性介质(例如硬盘、固态硬盘、磁带)中。The storage location of the stored image is a storage device, such as a computer, a storage server, or a NAS, a storage cloud, a distributed storage device, and the like. In particular, the stored image may be located in memory or in a non-volatile medium (eg, hard disk, solid state disk, tape).
另外需要特别指出的是,“图像集合”是对一张或者多张图像的代称。并不意味着真实存在集合这样的结构,也不意味着本步骤的执行者需要执行创建集合等操作。当然,为了操作的方便,也可以通过创建集合的方式,对符合条件的图像进行管理,把符合相同去重条件的图像划分为同一个集合。In addition, it should be pointed out that "image collection" is a representative name for one or more images. It does not mean that a structure such as a set actually exists, nor does it mean that the executor of this step needs to perform operations such as creating a set. Of course, for the convenience of operation, images that meet the conditions can also be managed by creating sets, and images that meet the same deduplication conditions can be divided into the same set.
考虑到节约计算资源等目的,去重操作可能不需要频繁的执行。因此,可以把过去已经收到的、且符合去重(重删)条件的图像的总体称呼为图像集合。当再次收到新的图像,且满足执行去重的条件时,可以把新收到的图像和过去已经存储的图像进行去重。或者,定期对系统中符合去重条件的图像的总体(也就是图像集合)进行重删。Considering the purpose of saving computing resources, etc., the deduplication operation may not need to be performed frequently. Therefore, the totality of images that have been received in the past and meet the deduplication (duplication) conditions can be called an image set. When a new image is received again and the conditions for performing de-duplication are met, the newly-received image and the image that has been stored in the past can be de-duplicated. Alternatively, the population (ie, the set of images) of images eligible for deduplication in the system is periodically deduplicated.
在实施中,每当获取到人脸图像后,可以判断是否存储有与当前获取到的人脸图像的拍摄对象相同、拍摄地点相同、且拍摄时间间隔小于预设阈值的人脸图像,如果未存储有满足上述条件的人脸图像,则建立包括当前获取到的人脸图像的图像集合。其中,预设阈值可以根据实际需求设置,例如可以设置在5分钟到10分钟之间,如10分钟。In implementation, every time a face image is obtained, it can be determined whether there is a face image stored with the same subject, the same shooting location, and the shooting time interval is less than the preset threshold as the currently obtained face image. If face images satisfying the above conditions are stored, an image set including the currently acquired face images is established. The preset threshold can be set according to actual needs, for example, can be set between 5 minutes and 10 minutes, such as 10 minutes.
如图3所示,目前已经存储了多个图像集合,如图像集合1、图像集合2和图像集合3,当前获取到的人脸图像E,其对应的拍摄对象为拍摄对象4,拍摄地点为地点b,拍摄时间为2019年9月1日10:35,且并未存储有与该人脸图像E具有相同的拍摄对象、相同的拍摄地点、且拍摄时间间隔小于预设阈值(例如10分钟)的人脸图像,则需要建立一个图像集合4,并将该人脸图像E添加到该图像集合4中。As shown in FIG. 3 , a plurality of image sets have been stored, such as image set 1, image set 2 and image set 3. The currently obtained face image E, the corresponding shooting object is shooting object 4, and the shooting location is Location b, the shooting time is 10:35 on September 1, 2019, and the face image E has the same shooting object, the same shooting location, and the shooting time interval is less than a preset threshold (for example, 10 minutes) ), an image set 4 needs to be established, and the face image E is added to the image set 4.
在判断是否存储有与当前获取的人脸图像具有相同的拍摄对象时,可以采用当前获取的 人脸图像的人脸特征数据和存储的各图像集合中的全部或部分人脸图像的人脸特征数据进行相似度计算,如果计算得到目标人脸图像的人脸特征数据与当前获取的人脸图像的人脸特征数据的相似度大于预设相似度阈值,则可以认为目标人脸图像所在图像集合中的人脸图像和当前获取的人脸图像对应同一拍摄对象。其中,相似度计算可以为欧式距离计算、余弦距离计算等。When judging whether there is the same photographic object as the currently acquired face image, the face feature data of the currently acquired face image and the stored face features of all or part of the face images in each image set can be used The similarity calculation is performed on the data. If the similarity between the face feature data of the target face image and the face feature data of the currently obtained face image is greater than the preset similarity threshold, it can be considered that the image set where the target face image is located The face image in and the currently acquired face image correspond to the same object. The similarity calculation may be Euclidean distance calculation, cosine distance calculation, or the like.
上述部分人脸图像可以为图像集合中质量最高的人脸图像,该人脸图像的质量与人脸图像的光照、人脸角度等有关。判断人脸图像的质量可以有如下方法:在获取到人脸图像后,输入预先训练的机器学习模型分析得出该人脸图像的质量分值,质量分值越高则代表该人脸图像的质量越高。此外,人脸图像的质量还可以以质量标识进行表示,不同的质量标识对应不同的质量等级,人脸图像的质量标识对应的质量等级越高则标识该人脸图像的质量越高。The above part of the face image may be the face image with the highest quality in the image set, and the quality of the face image is related to the illumination of the face image, the angle of the face, and the like. There are the following methods for judging the quality of the face image: after obtaining the face image, input the pre-trained machine learning model to analyze the quality score of the face image, and the higher the quality score, the better the face image. The higher the quality. In addition, the quality of the face image can also be represented by a quality mark, different quality marks correspond to different quality levels, and the higher the quality level corresponding to the quality mark of the face image, the higher the quality of the face image.
另外,需要说明的是,每当获取到人脸图像后,即可以采用预先训练的特征提取模型,对当前获取的人脸图像进行特征提取,得到其对应的人脸特征数据,并将人脸图像和人脸特征数据对应存储,以便计算人脸特征数据的相似度时使用。除此之外,还可以对采用预先训练的机器学习模型,识别当前获取的人脸图像对应的性别、年龄、质量分值等数据,这些数据可以与人脸图像对应的拍摄时间、拍摄地点等数据共同作为该人脸图像的结构化数据。相应的,可以将人脸图像、人脸特征数据和结构化数据对应存储。In addition, it should be noted that whenever a face image is acquired, a pre-trained feature extraction model can be used to extract features from the currently acquired face image to obtain its corresponding face feature data, and the face The image and the facial feature data are stored correspondingly for use in calculating the similarity of the facial feature data. In addition, the pre-trained machine learning model can also be used to identify the gender, age, quality score and other data corresponding to the currently acquired face image. These data can be related to the shooting time and shooting location corresponding to the face image. The data together serve as the structured data of the face image. Correspondingly, face images, face feature data and structured data may be stored correspondingly.
在获取到人脸图像后,如果判断出存储有与当前获取到的人脸图像的拍摄对象相同、拍摄地点相同、且拍摄时间间隔小于预设阈值的人脸图像,则可以将当前获取到的人脸图像添加到满足上述条件的人脸图像所在的图像集合中。After the face image is acquired, if it is determined that there is a face image stored with the same subject, the same shooting location and the shooting time interval as the currently acquired face image, and the shooting time interval is less than the preset threshold, the currently acquired face image can be stored. The face images are added to the image set where the face images satisfying the above conditions are located.
如图4所示,目前已经存储了多个图像集合,如图像集合1、图像集合2和图像集合3,当前获取到的人脸图像E,其拍摄对象为拍摄对象3,拍摄地点为地点b,拍摄时间为2019年9月1日10:40,且存储有与该人脸图像E具有相同的拍摄对象、相同的拍摄地点、且拍摄时间间隔小于预设阈值(例如10分钟)的人脸图像D,该人脸图像D属于图像集合3,则可以将该人脸图像E添加到该图像集合3中。As shown in FIG. 4 , a plurality of image sets have been stored, such as image set 1, image set 2 and image set 3. The currently obtained face image E, the shooting object of which is shooting object 3, and the shooting location is site b , the shooting time is 10:40 on September 1, 2019, and the face image E has the same subject, the same shooting location, and the shooting time interval is less than the preset threshold (for example, 10 minutes). Image D, the face image D belongs to the image set 3, the face image E can be added to the image set 3.
在一种可能的实现方式中,可以设置去重操作的触发条件,在满足去重操作的触发条件时对图像集合中的人脸图像进行去重操作,选择至少一张人脸图像保存,未选择的人脸图像做删除处理。为了便于说明,下面将最新添加到图像集合中的人脸图像称为第一人脸图像。去重操作的触发条件可以有多种,下面列举其中几种进行说明:In a possible implementation manner, a trigger condition for the deduplication operation can be set, and when the trigger condition for the deduplication operation is satisfied, the deduplication operation is performed on the face images in the image set, and at least one face image is selected to save, and no The selected face image is deleted. For the convenience of description, the face image newly added to the image set is hereinafter referred to as the first face image. There are many trigger conditions for the deduplication operation, some of which are listed below:
去重操作的触发条件一、Trigger condition of deduplication operation 1.
在获取到第一图像之后的预设时长内,未获取到与第一人脸图像具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的人脸图像。Within a preset period of time after the first image is acquired, no face image is acquired that has the same shooting object, the same shooting location, and a shooting time interval smaller than the preset threshold as the first face image.
对于一个图像集合来说,如果在获取到第一人脸图像后的预设时长内,未获取到与第一人脸图像具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的人脸图像,则对图像集合进行去重操作。其中,预设时长可以等于预设阈值,例如,预设阈值设置为10分钟,相应的预设时长也可以设置为10分钟,或者预设时长可以设置可以略大于预设阈值。For an image set, if within a preset period of time after the first face image is acquired, the same subject, the same shooting location, and the shooting that is smaller than the preset threshold as the first face image are not acquired For face images with time interval, deduplication operation is performed on the image collection. The preset duration may be equal to the preset threshold. For example, the preset threshold may be set to 10 minutes, and the corresponding preset duration may also be set to 10 minutes, or the preset duration may be set to be slightly larger than the preset threshold.
去重操作的触发条件二、Trigger condition for deduplication operation 2.
获取到与第一人脸图像具有相同的拍摄对象,不同的摄地点的人脸图像。A face image with the same shooting object as the first face image and a different shooting location is obtained.
在此情况下,说明第一人脸图像对应的拍摄对象已经去了第一人脸图像所在图像集合对 应的拍摄地点以外的地点,则可以对该第一人脸图像所在的图像集合进行去重操作。In this case, it means that the shooting object corresponding to the first face image has gone to a place other than the shooting location corresponding to the image set where the first face image is located, then the image set where the first face image is located can be de-duplicated operate.
去重操作的触发条件三、Trigger condition for deduplication operation 3.
确定图像集合中的人脸图像所占存储空间大于目标存储值。It is determined that the storage space occupied by the face images in the image set is larger than the target storage value.
可以按照预设检测周期,检测每个图像集合中的人脸图像所占存储空间的大小,如果大于目标存储值,则可以将该图像集合进行去重操作。其中,目标存储值可以根据实际需求设置,例如可以设置为300KB到600KB。The size of the storage space occupied by the face images in each image set can be detected according to the preset detection period, and if it is greater than the target storage value, the image set can be deduplicated. Among them, the target storage value can be set according to actual needs, for example, can be set to 300KB to 600KB.
去重操作的触发条件四、Trigger condition for deduplication operation 4.
确定图像集合中的人脸图像达到目标数量。Determines the target number of face images in the image collection.
可以按照预设检测周期,检测每个图像集合中的人脸图像的数量,如果大于预设数量,则可以将该图像集合进行去重操作。其中,目标数量可以根据实际需求设置,例如可以设置为10张(或者20张),即:每当凑够10张(或者20张)相似的图像,则进行去重。当然,目标数量也可以设置为2张,即:每当获取到与该图像集合中的第一人脸图像具有相同拍摄对象、相同拍摄地点且小于预设阈值的拍摄时间间隔的图像,则对该图像集合进行去重操作。The number of face images in each image set may be detected according to a preset detection period, and if the number is greater than the preset number, a deduplication operation may be performed on the image set. The number of targets can be set according to actual needs, for example, it can be set to 10 (or 20) images, that is, deduplication is performed whenever 10 (or 20) similar images are collected. Of course, the number of targets can also be set to 2, that is, whenever an image with the same shooting object, the same shooting location and the shooting time interval less than the preset threshold is obtained as the first face image in the image set, the The image collection is deduplicated.
上述去重操作的触发条件三和去重操作的触发条件四,均可以减小设备存储压力。The third trigger condition of the deduplication operation and the fourth trigger condition of the deduplication operation can both reduce the storage pressure of the device.
去重操作的触发条件五、Trigger condition for deduplication operation 5.
定时去重,例如每天凌晨3点,对存储设备中的图像进行查找,对符合去重条件的图像集合(也就是具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的多张图像)进行去重。Deduplication regularly, for example, every day at 3:00 a.m., the images in the storage device are searched, and the set of images that meet the deduplication conditions (that is, the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold) multiple images) for deduplication.
需要说明的是,上述去重操作的触发条件一、二、三,或者一、二、四、五可以组合使用。It should be noted that, the trigger conditions 1, 2, and 3, or 1, 2, 4, and 5 of the above-mentioned deduplication operation can be used in combination.
在一种可能的实现方式中,上述去重操作中所选择的至少一张人脸图像为图像集合中质量最高的人脸图像。In a possible implementation manner, the at least one face image selected in the above-mentioned deduplication operation is the face image with the highest quality in the image set.
在实施中,可以选择预设数目张人脸图像进行保存,具体的,预设数目可以根据实际需求设置,可以为大于等于1的整数。In implementation, a preset number of face images may be selected for saving. Specifically, the preset number may be set according to actual requirements, and may be an integer greater than or equal to 1.
在又一种可能的实现方式中,在进行去重操作时,还可以将选择的人脸图像对应的拍摄时间修改为目标拍摄时间段。目标拍摄时间段中的起始时间为图像集合中的人脸图像对应的拍摄时间中的最早时间,目标拍摄时间段中的结束时间为图像集合中的人脸图像对应的拍摄时间中的最晚时间。In yet another possible implementation manner, during the deduplication operation, the shooting time corresponding to the selected face image may also be modified to the target shooting time period. The start time in the target shooting time period is the earliest time in the shooting time corresponding to the face image in the image set, and the end time in the target shooting time period is the latest in the shooting time corresponding to the face image in the image set. time.
例如,如图5所示,在一个图像集合中包括人脸图像X、人脸图像Y和人脸图像Z,其中:For example, as shown in Figure 5, an image set includes face image X, face image Y and face image Z, wherein:
人脸图像X:拍摄对象1、拍摄地点a、拍摄时间2020年9月1日10:00,质量分值90;Face image X: subject 1, shooting location a, shooting time at 10:00 on September 1, 2020, quality score 90;
人脸图像Y:拍摄对象1、拍摄地点a、拍摄时间2020年9月1日10:02,质量分值87;Face image Y: subject 1, shooting location a, shooting time at 10:02 on September 1, 2020, quality score 87;
人脸图像Z:拍摄对象1、拍摄地点a、拍摄时间2020年9月1日10:06,质量分值96。Face image Z: subject 1, shooting location a, shooting time at 10:06 on September 1, 2020, quality score 96.
可以判断出,人脸图像Z的质量分值最高,则可以保存人脸图像Z,删除人脸图像X和人脸图像Y。并且,可以将人脸图像Z对应的拍摄时间修改为拍摄时间段,其中,拍摄时间段中的起始时间为人脸图像X、人脸图像Y和人脸图像Z对应的拍摄时间中的最早时间:2020年9月1日10:00,拍摄时间段中的结束时间为人脸图像X、人脸图像Y和人脸图像Z对应的拍摄时间中的最晚时间:2020年9月1日10:06。It can be determined that the face image Z has the highest quality score, and the face image Z can be saved, and the face image X and the face image Y can be deleted. In addition, the shooting time corresponding to the face image Z can be modified to a shooting time period, wherein the starting time in the shooting time period is the earliest time among the shooting times corresponding to the face image X, the face image Y and the face image Z. : At 10:00 on September 1, 2020, the end time in the shooting time period is the latest time among the shooting times corresponding to face image X, face image Y and face image Z: September 1, 2020 10: 06.
此外,还可以将未选择的人脸图像的结构化数据和人脸特征数据进行删除处理。In addition, the structured data and face feature data of unselected face images can also be deleted.
在又一种可能的实现方式中,对于去重操作的触发条件包括上述去重操作的触发条件三或者去重操作的触发条件四的情况下,可能会出现对象在同一拍摄地点长时间停留,被该拍摄地点的图像拍摄设备连续拍摄到人脸图像,而这些人脸图像只需保存质量最好的人脸图像即可,但是由于上述去重操作的触发条件三或者去重操作的触发条件四,导致这些人脸图像是被分为多批次去重的,这样就会保存更多的人脸图像,因此,对于保存下来的人脸图像还可以进行二次去重,相应的,处理可以如下:将具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的两人脸图像中,质量较高的人脸图像保留,质量较低的人脸图像做删除处理,并且将质量较高的人脸图像对应的拍摄时间段的起始时间修改为上述两人脸图像对应的拍摄时间段中最早拍摄时间,结束时间修改为上述两人脸图像对应的拍摄时间段中的最晚拍摄时间。In another possible implementation manner, when the trigger condition for the deduplication operation includes the trigger condition 3 of the deduplication operation or the trigger condition 4 of the deduplication operation, it may happen that the object stays at the same shooting location for a long time, The face images are continuously captured by the image capturing equipment at the shooting location, and these face images only need to save the face images with the best quality. Fourth, these face images are divided into multiple batches for deduplication, which will save more face images. Therefore, the saved face images can also be deduplicated twice. Correspondingly, processing It can be as follows: in the two-person face images with the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold, the higher-quality face images are retained, and the lower-quality face images are deleted. , and modify the start time of the shooting time period corresponding to the high-quality face image to the earliest shooting time in the shooting time period corresponding to the above-mentioned two-face image, and modify the end time to the shooting time period corresponding to the above-mentioned two-face image The latest shooting time in .
例如,存储有如下人脸图像:For example, the following face images are stored:
人脸图像1:拍摄对象1、拍摄地点a、拍摄时间段2020年9月1日10:00-2020年9月1日10:15,质量分值90;Face image 1: subject 1, shooting location a, shooting time period 10:00 on September 1, 2020 to 10:15 on September 1, 2020, quality score 90;
人脸图像2:拍摄对象1、拍摄地点a、拍摄时间段2020年9月1日10:17-2020年9月1日10:30,质量分值85;Face image 2: subject 1, shooting location a, shooting time period from 10:17 on September 1, 2020 to 10:30 on September 1, 2020, quality score 85;
人脸图像3:拍摄对象1、拍摄地点a、拍摄时间段2020年9月1日10:35-2020年9月1日10:50,质量分值95。Face image 3: subject 1, shooting location a, shooting time period from 10:35 on September 1, 2020 to 10:50 on September 1, 2020, with a quality score of 95.
首先,确定人脸图像1和人脸图像2对应的拍摄对象和拍摄地点相同,且对应的拍摄时间段的最小时间间隔为2分钟小于预设阈值(例如10分钟),又确定人脸图像1的质量分值大于人脸图像2的质量分值,则将人脸图像1保存,将人脸图像2删除。并且,将人脸图像1对应的拍摄时间段的起始时间修改为人脸图像1和人脸图像2对应的拍摄时间段中的最早拍摄时间:2020年9月1日10:00,将人脸图像1对应的拍摄时间段的结束时间修改为人脸图像1和人脸图像2对应的拍摄时间段中的最晚拍摄时间:2020年9月1日10:30。修改后,人脸图像1的相关信息如下:First, it is determined that the photographing objects and locations corresponding to face image 1 and face image 2 are the same, and the minimum time interval of the corresponding photographing time period is 2 minutes less than a preset threshold (for example, 10 minutes), and then it is determined that face image 1 The quality score is greater than the quality score of face image 2, then face image 1 is saved, and face image 2 is deleted. In addition, the start time of the shooting time period corresponding to face image 1 is modified to the earliest shooting time in the shooting time period corresponding to face image 1 and face image 2: 10:00 on September 1, 2020, the face The end time of the shooting time period corresponding to image 1 is modified to the latest shooting time in the shooting time period corresponding to face image 1 and face image 2: 10:30 on September 1, 2020. After modification, the relevant information of face image 1 is as follows:
人脸图像1:拍摄对象1、拍摄地点a、拍摄时间段2020年9月1日10:00-2020年9月1日10:30,质量分值90。Face image 1: subject 1, shooting location a, shooting time period from 10:00 on September 1, 2020 to 10:30 on September 1, 2020, with a quality score of 90.
然后,又确定修改后的人脸1和人脸图像3对应的拍摄对象和拍摄地点相同,且对应的拍摄时间段的最小时间间隔为5分钟小于上述预设阈值,又确定人脸图像3的质量分值大于人脸图像1的质量分值,则将人脸图像3保留,将人脸图像1删除。并且,将人脸图像3对应的拍摄时间段的起始时间修改为人脸图像1和人脸图像3对应的拍摄时间段中的最早拍摄时间:2020年9月1日10:00,将人脸图像3对应的拍摄时间段的结束时间修改为人脸图像1和人脸图像3对应的拍摄时间段中的最晚拍摄时间:2020年9月1日10:50。修改后,人脸图像3的相关信息如下:Then, it is determined that the subject and the shooting location corresponding to the modified face 1 and the face image 3 are the same, and the minimum time interval of the corresponding shooting time period is 5 minutes less than the above-mentioned preset threshold, and it is determined that the face image 3 If the quality score is greater than the quality score of face image 1, face image 3 is retained and face image 1 is deleted. In addition, the start time of the shooting time period corresponding to face image 3 is modified to the earliest shooting time in the shooting time period corresponding to face image 1 and face image 3: 10:00 on September 1, 2020, the face The end time of the shooting time period corresponding to image 3 is modified to the latest shooting time in the shooting time period corresponding to face image 1 and face image 3: 10:50 on September 1, 2020. After modification, the relevant information of face image 3 is as follows:
人脸图像3:拍摄对象1、拍摄地点a、拍摄时间段2020年9月1日10:00-2020年9月1日10:50,质量分值95。Face image 3: subject 1, shooting location a, shooting time period from 10:00 on September 1, 2020 to 10:50 on September 1, 2020, with a quality score of 95.
可见,通过上述处理可以进一步对人脸图像进行去重,达到同一拍摄地点短时间内拍摄的同一对象仅保留质量最高的人脸图像的目的,较大程度的对人脸图像进行去重,节省存储空间。It can be seen that through the above processing, the face image can be further de-duplicated, so as to achieve the purpose of retaining only the highest-quality face image of the same object shot at the same shooting location in a short period of time. storage.
基于相同的技术构思,本申请实施例还提供了一种图像存储的装置,如图6所示,该装 置包括:Based on the same technical concept, an embodiment of the present application also provides a device for image storage, as shown in Figure 6, the device includes:
获取模块610,用于获取第一图像,具体可以实现上述步骤201提到的获取功能,以及其他隐含步骤;an acquisition module 610, configured to acquire the first image, and specifically can implement the acquisition function mentioned in the above step 201, as well as other implicit steps;
去重模块620,用于对所述第一图像与已存储的图像集合进行去重操作,具体用于:The deduplication module 620 is used to perform deduplication operation on the first image and the stored image set, and is specifically used for:
从所述第一图像与已存储的图像集合中选择至少一张图像进行保存,其中,所述已存储的图像集合中拥有一张或者多张图像,所述图像集合中的图像与所述第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔;Select at least one image from the first image and the stored image set to save, wherein the stored image set has one or more images, and the image in the image set is the same as the first image. An image has: the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold;
删除未选择的图像。具体的,去重模块620可以实现上述步骤202提到的去重功能,以及其他隐含步骤。Delete unselected images. Specifically, the deduplication module 620 can implement the deduplication function mentioned in the above step 202, as well as other implicit steps.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the apparatus further includes:
建立模块630,用于获取第二图像,如果未存储有与所述第二图像具有相同的拍摄对象、相同的拍摄地点、以及小于所述预设阈值的拍摄时间间隔的第三图像,则建立包括所述第二图像的图像集合。The establishment module 630 is used to obtain the second image, if there is no third image with the same shooting object, the same shooting location, and the shooting time interval smaller than the preset threshold as the second image, then establish An image collection including the second image.
在一种可能的实现方式中,所述去重操作的触发条件,包括:In a possible implementation manner, the trigger condition of the deduplication operation includes:
在获取到所述第一图像之后的预设时长内,未获取到与所述第一人脸图像具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的第四人脸图像。Within a preset period of time after the first image is acquired, a fourth person who has the same subject, the same shooting location, and the shooting time interval less than the preset threshold as the first face image has not been acquired face image.
在一种可能的实现方式中,所述去重操作的触发条件,包括:In a possible implementation manner, the trigger condition of the deduplication operation includes:
获取到与所述第一人脸图像具有相同的拍摄对象,不同的摄地点的第五人脸图像。A fifth face image with the same shooting object as the first face image and a different shooting location is obtained.
在一种可能的实现方式中,所述去重操作的触发条件,包括:In a possible implementation manner, the trigger condition of the deduplication operation includes:
确定所述图像集合包括的人脸图像的数量大于目标数量,或者,It is determined that the number of face images included in the image set is greater than the target number, or,
确定所述图像集合包括的人脸图像所占存储空间的大小大于目标存储值。It is determined that the size of the storage space occupied by the face images included in the image set is greater than the target storage value.
在一种可能的实现方式中,所述去重模块620,还用于:In a possible implementation manner, the deduplication module 620 is further configured to:
将被选择的人脸图像的拍摄时间修改为目标拍摄时间段,其中,所述目标拍摄时间段中的起始时间为所述图像重集合中的图像和所述第一图像的拍摄时间中的最早时间,所述目标拍摄时间段中的结束时间为所述图像集合中的图像和所述第一图像的拍摄时间中的最晚时间;Modify the shooting time of the selected face image to a target shooting time period, wherein the starting time in the target shooting time period is the difference between the images in the image re-set and the shooting time of the first image. The earliest time, the end time in the target shooting time period is the latest time in the shooting time of the image in the image set and the first image;
删除未选择的图像的结构化数据和人脸特征数据。Remove structured data and facial feature data for unselected images.
在一种可能的实现方式中,被选择的图像是质量最高的图像,例如质量最高的一张图像,或者质量最高的两张图像。In a possible implementation manner, the selected image is the image with the highest quality, such as the one image with the highest quality, or the two images with the highest quality.
此外,获取模块610,还用于从存储设备中获取图像集合中的图像,所述图像集合中的图像与第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔;In addition, the acquiring module 610 is further configured to acquire images in the image set from the storage device, where the images in the image set and the first image have: the same shooting object, the same shooting location, and shooting less than a preset threshold time interval;
去重模块620,还用于对所述第一图像与已存储的图像集合进行去重操作,具体包括:The deduplication module 620 is further configured to perform deduplication operations on the first image and the stored image set, specifically including:
从图像集合中选择一张图像进行保存;Select an image from the image collection to save;
删除未选择的图像。Delete unselected images.
需要说明的是:上述实施例提供的图像存储的装置在图像存储时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将计算机设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的图像存储的装置与图像存储的方法实施例属于同一构思,其具体实 现过程详见方法实施例,这里不再赘述。It should be noted that: when the image storage device provided in the above embodiments is used for image storage, only the division of the above functional modules is used as an example for illustration. That is, the internal structure of the computer equipment is divided into different functional modules to complete all or part of the functions described above. In addition, the image storage apparatus and the image storage method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
图7是本申请实施例提供的一种计算机设备的结构示意图,该计算机设备可以为上述方法实施例中的IVS,该计算机设备700可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)701和一个或一个以上的存储器702,其中,所述存储器702中存储有至少一条指令,所述至少一条指令由所述处理器701加载并执行以实现上述方法实施例提供的方法。当然,该服务器还可以具有有线或无线网络接口、键盘以及输入输出接口等部件,以便进行输入输出,该服务器还可以包括其他用于实现设备功能的部件,在此不做赘述。FIG. 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application. The computer device may be the IVS in the above method embodiment. The computer device 700 may vary greatly due to different configurations or performances, and may include a or more than one processor (central processing units, CPU) 701 and one or more than one memory 702, wherein, the memory 702 stores at least one instruction, the at least one instruction is loaded and executed by the processor 701 to The methods provided by the foregoing method embodiments are implemented. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface for input and output, and the server may also include other components for implementing device functions, which will not be described here.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现,当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令,在设备上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴光缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是设备能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(如软盘、硬盘和磁带等),也可以是光介质(如数字视盘(Digital Video Disk,DVD)等),或者半导体介质(如固态硬盘等)。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof, and when implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions, and when the computer program instructions are loaded and executed on a device, all or part of the processes or functions described in the embodiments of the present application are generated. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that the device can access, or a data storage device such as a server, data center, or the like that includes an integration of one or more available media. The usable medium may be a magnetic medium (such as a floppy disk, a hard disk, and a magnetic tape, etc.), an optical medium (such as a digital video disk (Digital Video Disk, DVD), etc.), or a semiconductor medium (such as a solid-state disk, etc.).
上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。All or part of the steps in the above-mentioned embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be only a computer-readable storage medium. Read memory, disk or CD, etc.
以上所述仅为本申请一个实施例,并不用以限制本申请,凡所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above description is only an embodiment of the present application, and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made should be included within the protection scope of the present application.

Claims (18)

  1. 一种图像存储的方法,其特征在于,所述方法包括:A method for image storage, characterized in that the method comprises:
    获取第一图像;get the first image;
    对所述第一图像与已存储的图像集合进行去重操作,具体包括:Perform a deduplication operation on the first image and the stored image set, specifically including:
    从所述第一图像与已存储的图像集合中选择至少一张图像进行保存,其中,所述已存储的图像集合中拥有一张或者多张图像,所述图像集合中的图像与所述第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔;Select at least one image from the first image and the stored image set to save, wherein the stored image set has one or more images, and the image in the image set is the same as the first image. An image has: the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold;
    删除未选择的图像。Delete unselected images.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    获取第二图像;get the second image;
    如果未存储有与所述第二图像具有相同的拍摄对象、相同的拍摄地点、以及小于所述预设阈值的拍摄时间间隔的第三图像,则建立包括所述第二图像的图像集合。If there is no third image having the same photographing subject, the same photographing location, and a photographing time interval smaller than the preset threshold as the second image, an image set including the second image is established.
  3. 根据权利要求1所述的方法,其特征在于,所述去重操作的触发条件,包括:The method according to claim 1, wherein the triggering condition of the deduplication operation comprises:
    在获取到所述第一图像之后的预设时长内,未获取到与所述第一人脸图像具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的第四人脸图像。Within a preset period of time after the first image is acquired, a fourth person who has the same subject, the same shooting location, and the shooting time interval less than the preset threshold as the first face image has not been acquired face image.
  4. 根据权利要求1所述的方法,其特征在于,所述去重操作的触发条件,包括:The method according to claim 1, wherein the triggering condition of the deduplication operation comprises:
    获取到与所述第一人脸图像具有相同的拍摄对象,不同的摄地点的第五人脸图像。A fifth face image with the same shooting object as the first face image and a different shooting location is obtained.
  5. 根据权利要求1所述的方法,其特征在于,所述去重操作的触发条件,包括:The method according to claim 1, wherein the triggering condition of the deduplication operation comprises:
    确定所述图像集合包括的人脸图像的数量大于目标数量,或者,It is determined that the number of face images included in the image set is greater than the target number, or,
    确定所述图像集合包括的人脸图像所占存储空间的大小大于目标存储值。It is determined that the size of the storage space occupied by the face images included in the image set is greater than the target storage value.
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, wherein the method further comprises:
    将被选择的人脸图像的拍摄时间修改为目标拍摄时间段,其中,所述目标拍摄时间段中的起始时间为所述图像重集合中的图像和所述第一图像的拍摄时间中的最早时间,所述目标拍摄时间段中的结束时间为所述图像集合中的图像和所述第一图像的拍摄时间中的最晚时间;Modify the shooting time of the selected face image to a target shooting time period, wherein the starting time in the target shooting time period is the difference between the images in the image re-set and the shooting time of the first image. The earliest time, the end time in the target shooting time period is the latest time in the shooting time of the image in the image set and the first image;
    删除未选择的图像的结构化数据和人脸特征数据。Remove structured data and facial feature data for unselected images.
  7. 根据权利要求1-6中任一项所述的方法,其特征在于,被选择的图像是质量最高的图像。The method according to any one of claims 1-6, wherein the selected image is the image of the highest quality.
  8. 一种图像存储的装置,其特征在于,所述装置包括:An image storage device, characterized in that the device comprises:
    获取模块,用于第一图像;an acquisition module for the first image;
    去重模块,用于对所述第一图像与已存储的图像集合进行去重操作,具体用于:A deduplication module, configured to perform a deduplication operation on the first image and the stored image set, and is specifically used for:
    从所述第一图像与已存储的图像集合中选择至少一张图像进行保存,其中,所述已存储的图像集合中拥有一张或者多张图像,所述图像集合中的图像与所述第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔;Select at least one image from the first image and the stored image set to save, wherein the stored image set has one or more images, and the image in the image set is the same as the first image. An image has: the same shooting object, the same shooting location, and the shooting time interval less than the preset threshold;
    删除未选择的图像。Delete unselected images.
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The apparatus according to claim 8, wherein the apparatus further comprises:
    建立模块,用于获取第二图像,如果未存储有与所述第二图像具有相同的拍摄对象、相同的拍摄地点、以及小于所述预设阈值的拍摄时间间隔的第三图像,则建立包括所述第二图像的图像集合。The establishment module is used to obtain the second image, and if there is no third image with the same shooting object, the same shooting location, and the shooting time interval smaller than the preset threshold value as the second image, the establishment includes: an image collection of the second image.
  10. 根据权利要求8所述的装置,其特征在于,所述去重操作的触发条件,包括:The device according to claim 8, wherein the trigger condition of the deduplication operation comprises:
    在获取到所述第一图像之后的预设时长内,未获取到与所述第一人脸图像具有相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔的第四人脸图像。Within a preset period of time after the first image is acquired, a fourth person who has the same subject, the same shooting location, and the shooting time interval less than the preset threshold as the first face image has not been acquired face image.
  11. 根据权利要求8所述的装置,其特征在于,所述去重操作的触发条件,包括:The device according to claim 8, wherein the trigger condition of the deduplication operation comprises:
    获取到与所述第一人脸图像具有相同的拍摄对象,不同的摄地点的第五人脸图像。A fifth face image with the same shooting object as the first face image and a different shooting location is obtained.
  12. 根据权利要求8所述的装置,其特征在于,所述去重操作的触发条件,包括:The device according to claim 8, wherein the trigger condition of the deduplication operation comprises:
    确定所述图像集合包括的人脸图像的数量大于目标数量,或者,It is determined that the number of face images included in the image set is greater than the target number, or,
    确定所述图像集合包括的人脸图像所占存储空间的大小大于目标存储值。It is determined that the size of the storage space occupied by the face images included in the image set is greater than the target storage value.
  13. 根据权利要求8-12中任一项所述的装置,其特征在于,所述去重模块,还用于:The device according to any one of claims 8-12, wherein the deduplication module is further used for:
    将被选择的人脸图像的拍摄时间修改为目标拍摄时间段,其中,所述目标拍摄时间段中的起始时间为所述图像重集合中的图像和所述第一图像的拍摄时间中的最早时间,所述目标拍摄时间段中的结束时间为所述图像集合中的图像和所述第一图像的拍摄时间中的最晚时间;Modify the shooting time of the selected face image to a target shooting time period, wherein the starting time in the target shooting time period is the difference between the images in the image re-set and the shooting time of the first image. The earliest time, the end time in the target shooting time period is the latest time in the shooting time of the image in the image set and the first image;
    删除未选择的图像的结构化数据和人脸特征数据。Remove structured data and facial feature data for unselected images.
  14. 根据权利要求8-13中任一项所述的装置,其特征在于,被选择的图像是质量最高的图像。14. The apparatus of any one of claims 8-13, wherein the selected image is the highest quality image.
  15. 一种计算机设备,其特征在于,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如权利要求1至权利要求7中任一项所述的图像存储的方法所执行的操作。A computer device, characterized in that the computer device comprises a processor and a memory, the memory stores at least one instruction, and the instruction is loaded and executed by the processor to realize the invention as claimed in claim 1 to claim 7 The operations performed by the image storage method described in any one of the above.
  16. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如权利要求1至权利要求7中任一项所述的图像存储的方法所执行的操作。A computer-readable storage medium, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to realize the image according to any one of claims 1 to 7 The operation performed by the stored method.
  17. 一种图像存储的方法,其特征在于,所述方法包括:A method for image storage, characterized in that the method comprises:
    从存储设备中获取图像集合中的图像,所述图像集合中的图像与第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔;Acquiring images in the image set from the storage device, where the images in the image set and the first image have: the same shooting object, the same shooting location, and a shooting time interval less than a preset threshold;
    对所述第一图像与已存储的图像集合进行去重操作,具体包括:Perform a deduplication operation on the first image and the stored image set, specifically including:
    从图像集合中选择一张图像进行保存;Select an image from the image collection to save;
    删除未选择的图像。Delete unselected images.
  18. 一种图像存储的装置,其特征在于,所述装置包括:An image storage device, characterized in that the device comprises:
    获取模块,用于从存储设备中获取图像集合中的图像,所述图像集合中的图像与第一图像具有:相同的拍摄对象,相同的拍摄地点,以及小于预设阈值的拍摄时间间隔;an acquisition module, configured to acquire images in the image set from the storage device, where the images in the image set and the first image have: the same shooting object, the same shooting location, and a shooting time interval less than a preset threshold;
    去重模块,用于对所述图像集合进行去重操作,具体用于:The deduplication module is used to perform deduplication operation on the image set, and is specifically used for:
    从图像集合中选择一张图像进行保存;Select an image from the image collection to save;
    删除未选择的图像。Delete unselected images.
PCT/CN2021/118045 2020-09-15 2021-09-13 Image storage method and apparatus, computer device and storage medium WO2022057773A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010968900.0 2020-09-15
CN202010968900.0A CN114268730A (en) 2020-09-15 2020-09-15 Image storage method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022057773A1 true WO2022057773A1 (en) 2022-03-24

Family

ID=80776470

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/118045 WO2022057773A1 (en) 2020-09-15 2021-09-13 Image storage method and apparatus, computer device and storage medium

Country Status (2)

Country Link
CN (1) CN114268730A (en)
WO (1) WO2022057773A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117372933B (en) * 2023-12-06 2024-02-20 南京智绘星图信息科技有限公司 Image redundancy removing method and device and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408428A (en) * 2014-11-28 2015-03-11 东莞宇龙通信科技有限公司 Processing method and device for same-scene photos
CN105205181A (en) * 2015-10-28 2015-12-30 上海斐讯数据通信技术有限公司 Photo management method and management system
CN105760461A (en) * 2016-02-04 2016-07-13 上海卓易科技股份有限公司 Automatic album establishing method and device
CN107832452A (en) * 2017-11-23 2018-03-23 苏州亿科赛卓电子科技有限公司 A kind of photo management method and device
CN110046266A (en) * 2019-03-28 2019-07-23 广东紫晶信息存储技术股份有限公司 A kind of intelligent management and device of photo
JP2020067966A (en) * 2018-10-26 2020-04-30 株式会社メルカリ Image data management system, image data management method, and image data management program
CN111597363A (en) * 2019-02-21 2020-08-28 奇酷互联网络科技(深圳)有限公司 Method for detecting repeated photos, mobile terminal and device with storage function

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408428A (en) * 2014-11-28 2015-03-11 东莞宇龙通信科技有限公司 Processing method and device for same-scene photos
CN105205181A (en) * 2015-10-28 2015-12-30 上海斐讯数据通信技术有限公司 Photo management method and management system
CN105760461A (en) * 2016-02-04 2016-07-13 上海卓易科技股份有限公司 Automatic album establishing method and device
CN107832452A (en) * 2017-11-23 2018-03-23 苏州亿科赛卓电子科技有限公司 A kind of photo management method and device
JP2020067966A (en) * 2018-10-26 2020-04-30 株式会社メルカリ Image data management system, image data management method, and image data management program
CN111597363A (en) * 2019-02-21 2020-08-28 奇酷互联网络科技(深圳)有限公司 Method for detecting repeated photos, mobile terminal and device with storage function
CN110046266A (en) * 2019-03-28 2019-07-23 广东紫晶信息存储技术股份有限公司 A kind of intelligent management and device of photo

Also Published As

Publication number Publication date
CN114268730A (en) 2022-04-01

Similar Documents

Publication Publication Date Title
JP6916895B2 (en) Face image duplication deletion method and device, electronic device, storage medium, program
US8634603B2 (en) Automatic media sharing via shutter click
JP5612310B2 (en) User interface for face recognition
CN104994426B (en) Program video identification method and system
WO2016127478A1 (en) Image processing method and device, and terminal
CN101646070B (en) Novel intelligent security-protecting and monitoring method and special equipment thereof
WO2020111776A1 (en) Electronic device for focus tracking photographing and method thereof
US20130343618A1 (en) Searching for Events by Attendants
CN116916049B (en) Video data online acquisition and storage system based on cloud computing technology
WO2018028253A1 (en) Information processing method, apparatus and storage medium
WO2022057773A1 (en) Image storage method and apparatus, computer device and storage medium
WO2021051912A1 (en) Media data transmission method and related device
WO2011114668A1 (en) Data processing device and data processing method
WO2014201891A1 (en) Multi-target tracking method and system, and computer storage medium
CN110543584A (en) method, device, processing server and storage medium for establishing face index
CN108540817B (en) Video data processing method, device, server and computer readable storage medium
TW201601541A (en) Network camera data managing system and managing method thereof
KR101812103B1 (en) Method and program for setting thumbnail image
KR20120051952A (en) Method and apparatus for image searching using feature point
KR20200115018A (en) Image search apparatus and method for collecting image tehreof
CN110913138A (en) Continuous shooting method, device, terminal and computer readable storage medium
WO2008154825A1 (en) A method and device for extracting a background image in a motion image
CN114863364B (en) Security detection method and system based on intelligent video monitoring
US9955162B2 (en) Photo cluster detection and compression
KR101793702B1 (en) Video storage apparatus and method for searching thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21868596

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21868596

Country of ref document: EP

Kind code of ref document: A1