CN114637870B - Image data processing method, device, equipment and storage medium - Google Patents

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

Info

Publication number
CN114637870B
CN114637870B CN202210246863.1A CN202210246863A CN114637870B CN 114637870 B CN114637870 B CN 114637870B CN 202210246863 A CN202210246863 A CN 202210246863A CN 114637870 B CN114637870 B CN 114637870B
Authority
CN
China
Prior art keywords
image
block
original
detected
redundant
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210246863.1A
Other languages
Chinese (zh)
Other versions
CN114637870A (en
Inventor
谭玉娟
肖丹
晏志超
江泓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing University
Original Assignee
Chongqing University
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 Chongqing University filed Critical Chongqing University
Priority to CN202210246863.1A priority Critical patent/CN114637870B/en
Publication of CN114637870A publication Critical patent/CN114637870A/en
Application granted granted Critical
Publication of CN114637870B publication Critical patent/CN114637870B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0007Image acquisition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses an image data processing method, device, equipment and storage medium, comprising: acquiring an image to be detected and an original image; the original image is composed of a plurality of original blocks; based on an image alignment algorithm, partitioning the image to be detected according to the original image to obtain a plurality of blocks to be detected, and establishing a mapping relation between the blocks to be detected and the original block; respectively calculating hash values of the block to be detected and an original block corresponding to the block to be detected, and comparing the hash values; and when the comparison result of the hash value meets a preset redundancy condition, deleting the redundant block if the block to be tested is the redundant block. According to the embodiment of the invention, the image to be detected is blocked, the mapping relation between the block to be detected and the original block of the original image is established, and the redundant block is determined and deleted according to the hash value comparison result of the block to be detected and the corresponding original block, so that the deletion of the sensing redundant content is realized, and the storage of the image data is optimized.

Description

Image data processing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing image data.
Background
With the development of computer technology, ubiquitous intelligent mobile devices can capture electronic images anytime and anywhere and spread the images widely on social media applications. In the process of image spreading and sharing, a large number of similar images are easily derived from a single original image, firstly, users always tend to modify the images to achieve the expectations of the users or express the feelings of the users, secondly, one image can be compressed by dozens of popular compression algorithms according to different compression levels, so that a large number of compressed copies with the same perception content but completely different code stream content are generated, and in addition, a mainstream picture editing tool driven by image processing or artificial intelligence algorithms can also generate a large number of highly similar images which share a large number of redundant perception content but completely different bit streams. Existing deduplication tools, however, are bitstream based and are not able to efficiently identify perceptually redundant images with different bitstreams.
Disclosure of Invention
Embodiments of the present invention provide an image data processing method, an image data processing apparatus, an image data processing device, and a storage medium, which are capable of determining and deleting redundant blocks according to hash value comparison results of a block to be detected and a corresponding original block by blocking an image to be detected and establishing a mapping relationship between the block to be detected and the original block of the original image, thereby implementing deletion of perceptual redundant content and optimizing storage of image data.
In order to achieve the above object, an embodiment of the present invention provides an image data processing method, including:
acquiring an image to be detected and an original image; the original image is composed of a plurality of original blocks;
based on an image alignment algorithm, partitioning the image to be detected according to the original image to obtain a plurality of blocks to be detected, and establishing a mapping relation between the blocks to be detected and the original block;
respectively calculating hash values of the block to be detected and the original block corresponding to the block to be detected, and comparing the hash values;
and when the comparison result of the hash value meets a preset redundancy condition, the block to be detected is a redundant block, and the redundant block is deleted.
As an improvement of the above scheme, the method further comprises the following steps:
when the comparison result of the hash value does not meet the redundancy condition, the block to be tested is a non-redundant block, and the non-redundant block is stored in an image memory; wherein the redundancy condition is:
and the Hamming distance between the hash value of the block to be detected and the hash value of the original block corresponding to the block to be detected is smaller than a preset distance threshold value.
As an improvement of the above solution, the original image is obtained by:
extracting identification information of the image to be detected;
and selecting an image with the identification information same as that of the image to be detected from an image memory as an original image.
As an improvement of the above solution, before the original image is stored in the image memory, the method further includes:
based on a preset image blocking rule, blocking the original image to obtain a plurality of original blocks;
acquiring original identification information;
adding the original identification information to each of the original blocks.
As an improvement of the above solution, the original identification information is generated by: obtaining description information of the original image, and generating original identification information according to the description information; wherein the description information includes at least one of a user, a device, an application, a date, a location, or a resolution associated with the original image generation.
As an improvement of the above scheme, before the deleting the redundant block, the method further includes:
extracting the image information of the redundant block and extracting the image information of an original block corresponding to the redundant block;
obtaining the image operation information of the redundant block according to the image information of the redundant block and the image information of the original block corresponding to the redundant block, and storing the image operation information in an image description memory;
the saving the non-redundant block to the image memory specifically includes:
adding the image content near the non-redundant block into the non-redundant block, and storing the non-redundant block added with the image content into the image memory.
As an improvement of the above scheme, after the deleting the redundant block, the method further includes:
responding to an image recovery instruction, and generating a redundant image according to the image operation information and the original image;
and recovering the image to be detected according to the redundant image and the non-redundant block.
In order to achieve the above object, an embodiment of the present invention further provides an image data processing apparatus, including:
the image acquisition module is used for acquiring an image to be detected and an original image; the original image is composed of a plurality of original blocks;
the image blocking module is used for blocking the image to be detected according to the original image based on an image alignment algorithm to obtain a plurality of blocks to be detected and establishing a mapping relation between the blocks to be detected and the original image;
the image comparison module is used for respectively calculating the hash values of the block to be detected and the original block corresponding to the block to be detected and comparing the hash values;
and the image deleting module is used for deleting the redundant block when the comparison result of the hash value meets the preset redundant condition and the block to be detected is the redundant block.
To achieve the above object, an embodiment of the present invention further provides an image data processing apparatus, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor executes the computer program to implement the image data processing method according to any one of the above embodiments.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor implements the image data processing method according to any one of the above embodiments when executing the computer program.
Compared with the prior art, the image data processing method, the device, the equipment and the computer readable storage medium disclosed by the embodiment of the invention have the advantages that firstly, an image to be detected and an original image are obtained; the original image is composed of a plurality of original blocks; secondly, based on an image alignment algorithm, partitioning the image to be detected according to the original image to obtain a plurality of blocks to be detected, and establishing a mapping relation between the blocks to be detected and the original block; then, respectively calculating hash values of the block to be detected and an original block corresponding to the block to be detected, and comparing the hash values; and finally, when the comparison result of the hash value meets a preset redundancy condition, the block to be tested is a redundant block, and the redundant block is deleted. According to the embodiment of the invention, the redundant blocks can be determined and deleted according to the hash value comparison result of the block to be detected and the corresponding original block by partitioning the image to be detected, establishing the mapping relation between the block to be detected and the original block of the original image, so that the deletion of the sensing redundant content is realized, and the storage of image data is optimized.
Drawings
FIG. 1 is a flowchart of an image data processing method according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of an original image and an image to be measured according to an embodiment of the present invention;
FIG. 3 is a histogram of image memory requirement provided by an embodiment of the present invention;
fig. 4 is a block diagram of an image data processing according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
Referring to fig. 1, it is a flowchart of an image data processing method according to an embodiment of the present invention, where the image data processing method includes steps S1 to S4:
s1, acquiring an image to be detected and an original image; the original image is composed of a plurality of original blocks;
s2, based on an image alignment algorithm, partitioning the image to be detected according to the original image to obtain a plurality of blocks to be detected, and establishing a mapping relation between the blocks to be detected and the original block;
s3, respectively calculating hash values of the block to be detected and the original block corresponding to the block to be detected, and comparing the hash values;
and S4, when the comparison result of the hash value meets a preset redundancy condition, the block to be detected is a redundant block, and the redundant block is deleted.
It should be noted that the image data processing method may be executed by a user side, and the user side may be a user terminal device such as a computer, a mobile phone, a tablet, and the like.
In step S1, for example, the image to be measured and the original image may be acquired by responding to the image deduplication instruction; the image deduplication instruction can be input by a user, and the input mode can be keyboard input, mouse input and touch screen input, which is not limited herein; the image deduplication instruction may be stored in the user terminal in advance, may be a deduplication instruction triggered when new image generation is detected or a new image is received, or may be a startup cycle of a deduplication program set in advance, and deduplication operation is performed every preset time.
In step S1, it is worth to be noted that the image to be measured is obtained by performing image modification operation on an original image, and the original image is composed of a plurality of original blocks; therefore, in step S2, for example, based on an image alignment algorithm, such as RANSAC (random sample consensus) algorithm, the image to be measured and the original image are respectively subjected to feature extraction and feature matching to solve an alignment matrix, and the feature of the original image composed of a plurality of original blocks is combined to realize the blocking of the image to be measured so as to obtain a plurality of blocks to be measured, so as to further establish a mapping relationship between the blocks to be measured and the original blocks.
In step S3, since the image is processed by blocking, the whole image does not need to be used as the analysis of the repeated data object, but a smaller analysis unit, i.e., the block to be detected, is used as the repeated data object to be analyzed, the perceptual hash algorithm is used to calculate the hash values of the block to be detected and the original block, and the block to be detected and the original block corresponding to the block to be detected are compared with each other based on the mapping relationship between the block to be detected and the original block. Illustratively, the hash values of the blocks to be measured and the original blocks are calculated by using cosine-aware hashing (pHash), and the Hamming distance between the hash value of each block to be measured and the hash value of the original block corresponding to the block to be measured is calculated.
In step S4, specifically, the comparison result of the hash value of each block to be detected and the corresponding original block is analyzed, and whether each comparison result meets the preset redundancy condition is determined, and when the comparison result meets the preset redundancy condition, it is determined that the block to be detected and the corresponding original block are similar blocks, that is, the block to be detected is a redundant block, so that the redundant block is deleted, thereby achieving the purpose of optimizing the storage space.
Compared with the prior art, the embodiment of the invention can align the acquired image to be detected and the original image based on the image alignment algorithm; combining the blocking condition of the original image, carrying out blocking processing on the image to be detected to obtain a block to be detected, and establishing a one-to-one corresponding mapping relation between the original block of the original image and the block to be detected of the image to be detected; the hash value comparison between the block to be detected and the original block is carried out based on the mapping relation, and then the redundant block is determined according to the comparison result of the hash value for deleting the redundant block, so that the deletion of the sensing redundant content at the block level is realized, the calculation amount and the calculation delay for directly detecting the redundancy by taking the image to be detected as a redundancy detection object are reduced, meanwhile, the redundant parts in two images with small overall similarity can be effectively deleted, the waste of storage space is reduced, and the data storage of the images is optimized.
In one embodiment, the method further comprises step S5:
s5, when the comparison result of the hash value does not meet the redundancy condition, the block to be detected is a non-redundant block, and the non-redundant block is stored in an image memory; wherein the redundancy condition is:
and the Hamming distance between the hash value of the block to be detected and the hash value of the original block corresponding to the block to be detected is smaller than a preset distance threshold value.
Exemplarily, assuming that the preset distance threshold is 5, the image to be measured includes n blocks to be measured, the original image includes n original blocks, the blocks to be measured correspond to the original blocks one to one, assuming that the hamming distance between the ith block to be measured and the hash value of the corresponding original block is 4 and is less than the preset distance threshold 5, and satisfying the redundancy condition, it indicates that the ith block to be measured is similar to the corresponding original block, the ith block to be measured is a redundant block, and the ith block to be measured is deleted; if the hamming distance between the jth block to be tested and the hash value of the corresponding original block is 10 and is greater than the preset distance threshold 5, the redundancy condition is not satisfied, the jth block to be tested is not similar to the corresponding original block, the jth block to be tested is a non-redundant block, and the jth block to be tested is stored in the image memory at this moment. Through the redundancy detection of the block to be detected, the deletion of a redundant block and the storage of a non-redundant block are realized, and the data storage of the image is optimized.
In one embodiment, the raw image is obtained by:
s11, extracting identification information of the image to be detected;
and S12, selecting an image with the identification information identical to that of the image to be detected from the image memory as an original image.
Specifically, since the image to be measured is obtained by modifying the original image, when the original image has the identification information, the image to be measured must have the same identification information. In order to accurately and quickly acquire an original image corresponding to an image to be measured from an image memory, an image having the same identification information is found from the memory as the original image by querying the image memory with the identification information extracted from the image to be measured.
In one embodiment, before the original image is stored in the image memory, the method further includes steps S01 to S03:
s01, based on a preset image blocking rule, blocking the original image to obtain a plurality of original blocks;
s02, acquiring original identification information;
and S03, adding the original identification information into each original block.
For example, it is assumed that the identification information is a robust digital watermark, and the original identification information is steganographic watermark metadata "User id @ deviceid @ san Jose, CA, US 1. Considering factors such as complexity of blocking, calculation overhead and the like, when an original image is generated, the original image is divided into a plurality of blocks with fixed sizes, due to the conjugate symmetry characteristic of Fourier transform, a frequency spectrum is centrosymmetric in a frequency domain, therefore, metadata is coded into a mirror bitmap image, then the metadata image and the original block are converted into a specific feature space, such as a cosine transform domain, a Fourier transform domain or a wavelet transform domain, then the signals are added into the specific feature space, and finally, the result is converted back to an original time domain, so that the original image with the steganographic watermark is obtained. Further, in order to prevent malicious software from forging watermark information to forge an image, metadata is encrypted before a mirror bitmap image is generated, and the watermark is extracted and then decrypted. The encryption scheme may be a cassar encryption scheme that hides plain text image description information by replacing each character of the metadata with another printable character. The overhead of this encryption scheme is negligible, because only a few shuffle instructions are added, it should be noted that the encryption scheme may also be other encryption manners, and is not limited herein.
Preferably, the process of blocking the original image and embedding the identification information is combined with the generation of the image, for example, by adding this function to the firmware of the digital camera or to a specific application program, so that the blocking and identification information addition can be performed at the time of the generation of the original image.
In one embodiment, the original identification information is generated by: acquiring description information of the original image, and generating original identification information according to the description information; wherein the description information includes at least one of a user, a device, an application, a date, a location, or a resolution associated with the original image generation.
Illustratively, the original identification information is a steganographic watermark, and is a bitmap image composed of description information such as User, device/application, date, location, resolution, etc. related to image generation, and the metadata of the steganographic watermark is "User ID @ device ID @ san Jose, CA, US 1.
In one embodiment, before deleting the redundant block in step S4, the method further includes S41 to S42:
s41, extracting the image information of the redundant block, and extracting the image information of the original block corresponding to the redundant block;
s42, obtaining image operation information of the redundant block according to the image information of the redundant block and the image information of the original block corresponding to the redundant block, and storing the image operation information in an image description memory;
the storing the non-redundant block to the image memory in step S5 specifically includes:
adding the image content near the non-redundant block into the non-redundant block, and storing the non-redundant block added with the image content into the image memory.
Illustratively, referring to fig. 2, an image B to be measured is an original image a which is obtained by cropping, a is composed of original blocks A1 to a24, and is subjected to image alignment, B is composed of blocks B1 to B24 to be measured, redundant blocks B6, B7, B10, B11, B14, B15, B18, and B19 are obtained by hash value comparison, non-redundant blocks B1, B2, B3, B4, B5, B8, B12, B13, B16, B17, B20, B21, B22, B23, B24, and B25 are calculated in combination with the original blocks to obtain image operation information of A6 → B6, A7 → B7, a10 → B10, a11 → B11, a14 → B14, a15 → B15, a18 → B18, and a19 → B19, and since B is obtained by a, these redundant blocks are completely the same as the corresponding original blocks, the image operation information is obtained by simple image operation, and the image operation information can be recovered by a replacement operation, which is stored in a memory. In order to facilitate subsequent image recovery, when the non-redundant blocks are stored, redundant contents near the non-redundant blocks are stored together to help the blocks to be reassembled into corresponding images in the image recovery process.
It is worth noting that the number of redundant contents added to the non-redundant block can be set according to actual requirements; the modification method of the original image is not limited to cropping, and may also be scaling, rotating, adding a filter, adding a text, changing a color, and the like, and is not limited herein, the image operation information at this time is not a simple replacement operation, and the image operation information may be divided into block-level description information and file-level description information, for example, assuming that the brightness of the redundant block x is 10, and the brightness of the original block y corresponding to the redundant block is 50, the corresponding image operation information includes "reducing the brightness of the original block y by 40 to obtain the redundant block x", and the image operation information is block-level description information; assuming that an image to be measured includes three blocks a1, b1, and c1 to be measured, brightness is 1, 2, and 3, all blocks to be measured of the image to be measured are redundant blocks (that is, a1, b1, and c1 are redundant blocks), an original image includes three original blocks a2, b2, and c2, brightness is 4, 5, and 6, a1 corresponds to a2, b1 corresponds to b2, and c1 corresponds to c2, it can be known through calculation that brightness of the original block a2 is reduced by 3 to obtain a redundant block a1, brightness of the original block b2 is reduced by 3 to obtain a redundant block b1, brightness of the original block c2 is reduced by 3 to obtain a redundant block c1, that is, it can be inferred that the image to be measured is obtained by reducing brightness of the original image by 3, and corresponding image operation information includes "brightness of the original image is reduced by 3 to obtain the image to be measured", and the image operation information is file-level description information.
In one embodiment, after the deleting the redundant block in step S4, steps S6 to S7 are further included:
s6, responding to an image recovery instruction, and generating a redundant image according to the image operation information and the original image;
and S7, recovering the image to be detected according to the redundant image and the non-redundant block.
In particular, image restoration refers to the process of restoring a perceptually equivalent image to an image that was replaced by a redundant copy during the image deduplication phase. Deploying corresponding operations to restore an image according to information in an image memory and an image description memory generally comprises three steps: conversion, splicing and enhancement. The conversion stage mainly adopts a series of operations to recover the blocks, and if the image is subjected to repeated data deletion at the file level, the image can bypass the stage to be directly spliced. In the splicing process, all the blocks can be quickly spliced to generate a candidate image according to extra redundant content around each non-redundant block boundary, finally, the image is further optimized in an enhancement stage by using a super-resolution recovery model, the quality of the candidate image, particularly the block boundary, the reason of the image quality loss comes from the embedded steganography watermark, but the quality loss caused by the operation is not obvious in perception, an optimal interpolation is generated by adopting a super-resolution optimization method to reduce the mean square error, and the PSNR value (peak signal-to-noise ratio) of the recovered image is almost the same as that of the image embedded with the steganography watermark.
Compared with the prior art, the embodiment of the invention realizes deletion of the sensing redundancy content at the block level, reduces the calculation amount and calculation delay for directly detecting the redundancy by taking the image to be detected as a redundancy detection object, and can effectively delete the redundancy parts in two images with smaller overall similarity, thereby reducing the waste of storage space and optimizing the data storage of the images.
In order to better illustrate the advantages of the image processing method according to the embodiment of the present invention, the following compares the image processing results of the practical application examples.
In an actual application example, the original image in the image database has a data set of 1.3GB and 362.5GB copies, where the repeated copies have 114.2GB, 22.8GB remaining after distinguishable copies are filtered out by a similarity-based duplicate removal method (SIM-dedup), whereas the image data processing method of the embodiment of the present invention can further reduce the data to 6.7GB, saving 70.6% of storage space compared to SIM-dedup, reducing the redundant image magnification factor by 17.5 (22.8 = 1.3= 17.5) of SIM-dedup to 5.2 (6.7 = 1.3) compared to SIM-dedup, where the redundant image magnification factor is defined as the size of the actual image data divided by the size of the original image data, which can be referred to the image storage space requirement histogram shown in fig. 3, the vertical axis is the size of storage space, the horizontal axis is the size of the storage space, and the redundant image magnification factor is defined by the original image storage space requirement, and the embodiment of the invention can reduce the redundant image data processing requirements after the repeated copies, the redundant image data processing method is performed, and the redundant image data processing method can reduce the redundant image data waste.
In terms of execution time, the SIM-dead uses most of the time to extract the VGG16 based high-dimensional feature vectors, while WM-dead takes much less time in terms of feature extraction (watermark extraction). The scheme spends most of the time on the restored image, recombines the image by using perceptually equivalent blocks, and applies super-resolution optimization on all boundaries between any two adjacent blocks to restore the de-duplicated image as much as possible. The SIM-dedup operation for recovering the image is very simple, and the delay mainly comes from selecting and loading a nearly repeated image, but the image recovery effect is poor. Specifically, the speed of extracting the features is 5.7 times that of the SIM-dedup, the speed of deleting the repeated data is 4.5 times that of the SIM-dedup, and although the block-level repeated data deleting mode used by the WM-dedup can increase the query times, the time required by the query operation is microsecond level, so that the system performance cannot be obviously influenced. Although the method takes much more time than the SIM-dedup in the image recovery stage, the overall execution time of the method is still nearly 60% shorter than that of the SIM-dedup, and the detailed execution time comparison data in each stage is shown in the following table.
Feature extraction Image hashing Inquiry (searching original image) De-weighting Recovery of
SIM-dedup 482ms 4ms 25 us/file 502ms 8ms
Method for producing a composite material 84ms 4ms 12 us/block 112ms 195ms
Referring to fig. 4, an embodiment of the present invention further provides an image data processing apparatus, including:
the image acquisition module 11 is used for acquiring an image to be detected and an original image; the original image is composed of a plurality of original blocks;
an image blocking module 12, configured to block the image to be detected according to the original image based on an image alignment algorithm to obtain a plurality of blocks to be detected, and establish a mapping relationship between the blocks to be detected and the original block;
an image comparison module 13, configured to calculate hash values of the block to be detected and an original block corresponding to the block to be detected, respectively, and compare the hash values;
and the image deleting module 14 is configured to delete the redundant block when the comparison result of the hash value meets a preset redundant condition, where the block to be detected is the redundant block.
It should be noted that, for a specific working process of the image data processing apparatus, reference may be made to the working process of the image data processing method in the foregoing embodiment, and details are not repeated here.
Compared with the prior art, the device provided by the embodiment of the invention can align the acquired image to be detected and the original image based on the image alignment algorithm; combining the blocking condition of the original image, carrying out blocking processing on the image to be detected to obtain a block to be detected, and establishing a one-to-one mapping relation between the original block of the original image and the block to be detected of the image to be detected; the hash value comparison between the block to be detected and the original block is carried out based on the mapping relation, and then the redundant block is determined according to the comparison result of the hash value for deleting the redundant block, so that the deletion of the sensing redundant content at the block level is realized, the calculation amount and the calculation delay for directly detecting the redundancy by taking the image to be detected as a redundancy detection object are reduced, meanwhile, the redundant parts in two images with small overall similarity can be effectively deleted, the waste of storage space is reduced, and the data storage of the images is optimized.
An embodiment of the present invention further provides an image data processing apparatus, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor, when executing the computer program, implements steps in the above image data processing method embodiment, such as steps S1 to S4 described in fig. 1; alternatively, the processor, when executing the computer program, implements the functions of the modules in the above device embodiments, for example, the reference factor obtaining module.
Illustratively, the computer program may be partitioned into one or more modules that are stored in the memory and executed by the processor to implement the invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the image data processing apparatus. For example, the computer program may be divided into a plurality of modules, each module having the following specific functions:
the image acquisition module 11 is used for acquiring an image to be detected and an original image; the original image is composed of a plurality of original blocks;
an image blocking module 12, configured to block the image to be detected according to the original image based on an image alignment algorithm to obtain a plurality of blocks to be detected, and establish a mapping relationship between the blocks to be detected and the original block;
an image comparison module 13, configured to calculate hash values of the block to be detected and an original block corresponding to the block to be detected, respectively, and compare the hash values;
and the image deleting module 14 is configured to delete the redundant block when the comparison result of the hash value meets a preset redundant condition, where the block to be detected is the redundant block.
For the specific working process of each module, reference may be made to the working process of the image data processing apparatus described in the foregoing embodiment, which is not described herein again.
The image data processing device can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing devices. The image data processing apparatus may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that the schematic diagram is merely an example of an image data processing apparatus, and does not constitute a limitation of the image data processing apparatus, and may include more or less components than those shown, or some components may be combined, or different components, for example, the image data processing apparatus may further include an input-output device, a network access device, a bus, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is the control center of the image data processing apparatus, and various interfaces and lines are used to connect the respective parts of the entire image data processing apparatus.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the image data processing apparatus by executing or executing the computer programs and/or modules stored in the memory and calling data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the mobile phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Wherein, the module integrated with the image data processing device can be stored in a computer readable storage medium if it is implemented in the form of software functional unit and sold or used as a stand-alone product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. An image data processing method characterized by comprising:
acquiring an image to be detected and an original image; the original image is composed of a plurality of original blocks;
based on an image alignment algorithm, partitioning the image to be detected according to the original image to obtain a plurality of blocks to be detected, and establishing a mapping relation between the blocks to be detected and the original image;
respectively calculating hash values of the block to be detected and an original block corresponding to the block to be detected, and comparing the hash values;
when the comparison result of the hash values meets a preset redundancy condition, the block to be tested is a redundant block, and the redundant block is deleted;
before deleting the redundant block, extracting image information of the redundant block, and extracting image information of an original block corresponding to the redundant block;
and obtaining the image operation information of the redundant block according to the image information of the redundant block and the image information of the original block corresponding to the redundant block, and storing the image operation information in an image description memory.
2. The image data processing method according to claim 1, further comprising:
when the comparison result of the hash value does not meet the redundancy condition, the block to be tested is a non-redundant block, and the non-redundant block is stored in an image memory; wherein the redundancy condition is:
and the Hamming distance between the hash value of the block to be detected and the hash value of the original block corresponding to the block to be detected is smaller than a preset distance threshold value.
3. The image data processing method according to claim 1, wherein the original image is obtained by:
extracting identification information of the image to be detected;
and selecting an image with the identification information same as that of the image to be detected from an image memory as an original image.
4. The image data processing method of claim 3, before the storing of the original image in the image memory, further comprising:
based on a preset image blocking rule, blocking the original image to obtain a plurality of original blocks;
acquiring original identification information;
adding the original identification information to each of the original blocks.
5. The image data processing method according to claim 4, wherein the original identification information is generated by: acquiring description information of the original image, and generating original identification information according to the description information; wherein the description information includes at least one of a user, a device, an application, a date, a location, or a resolution associated with the original image generation.
6. The method for processing image data according to claim 2, wherein said saving the non-redundant block to the image memory specifically comprises:
adding the image content near the non-redundant block into the non-redundant block, and storing the non-redundant block added with the image content into the image memory.
7. The image data processing method according to claim 6, further comprising, after said deleting said redundant block:
responding to an image recovery instruction, and generating a redundant image according to the image operation information and the original image;
and recovering the image to be detected according to the redundant image and the non-redundant block.
8. An image data processing apparatus characterized by comprising:
the image acquisition module is used for acquiring an image to be detected and an original image; the original image is composed of a plurality of original blocks;
the image blocking module is used for blocking the image to be detected according to the original image based on an image alignment algorithm to obtain a plurality of blocks to be detected and establishing a mapping relation between the blocks to be detected and the original blocks;
the image comparison module is used for respectively calculating the hash values of the block to be detected and the original block corresponding to the block to be detected and comparing the hash values;
the image deleting module is used for deleting the redundant block when the comparison result of the hash value meets the preset redundant condition and the block to be detected is the redundant block;
the image deleting module is further configured to extract image information of the redundant block, and extract image information of an original block corresponding to the redundant block;
and obtaining the image operation information of the redundant block according to the image information of the redundant block and the image information of the original block corresponding to the redundant block, and storing the image operation information in an image description memory.
9. An image data processing apparatus comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the image data processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the image data processing method according to any one of claims 1 to 7 when executing the computer program.
CN202210246863.1A 2022-03-14 2022-03-14 Image data processing method, device, equipment and storage medium Active CN114637870B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210246863.1A CN114637870B (en) 2022-03-14 2022-03-14 Image data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210246863.1A CN114637870B (en) 2022-03-14 2022-03-14 Image data processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114637870A CN114637870A (en) 2022-06-17
CN114637870B true CN114637870B (en) 2023-03-24

Family

ID=81948867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210246863.1A Active CN114637870B (en) 2022-03-14 2022-03-14 Image data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114637870B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114817230A (en) * 2022-06-29 2022-07-29 深圳市乐易网络股份有限公司 Data stream filtering method and system
CN117372933B (en) * 2023-12-06 2024-02-20 南京智绘星图信息科技有限公司 Image redundancy removing method and device and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095903A (en) * 2015-07-16 2015-11-25 努比亚技术有限公司 Electronic equipment and image processing method
CN106155592A (en) * 2016-07-26 2016-11-23 深圳天珑无线科技有限公司 A kind of photo processing method and terminal

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104809732B (en) * 2015-05-07 2017-06-20 山东鲁能智能技术有限公司 A kind of power equipment appearance method for detecting abnormality compared based on image
US10210180B2 (en) * 2015-12-04 2019-02-19 Intel Corporation Hybrid nearest neighbor search tree with hashing table
CN107566826B (en) * 2017-01-12 2019-06-14 北京大学 The test method and device of grating image processor
CN110297680B (en) * 2019-06-03 2023-02-17 北京星网锐捷网络技术有限公司 Method and device for transmitting virtual desktop image
CN112261388B (en) * 2020-09-07 2023-08-01 中国电影器材有限责任公司 Redundancy recovery method, device and system for satellite transmission digital film package
CN112200740B (en) * 2020-10-08 2022-05-31 华中科技大学 Image blocking and de-duplication method and system based on image edge detection
CN113516601B (en) * 2021-06-17 2022-10-14 西南大学 Image recovery method based on deep convolutional neural network and compressed sensing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095903A (en) * 2015-07-16 2015-11-25 努比亚技术有限公司 Electronic equipment and image processing method
CN106155592A (en) * 2016-07-26 2016-11-23 深圳天珑无线科技有限公司 A kind of photo processing method and terminal

Also Published As

Publication number Publication date
CN114637870A (en) 2022-06-17

Similar Documents

Publication Publication Date Title
US10438000B1 (en) Using recognized backup images for recovery after a ransomware attack
CN114637870B (en) Image data processing method, device, equipment and storage medium
Babu et al. Efficient detection of copy-move forgery using polar complex exponential transform and gradient direction pattern
Almeer Cloud hadoop map reduce for remote sensing image analysis
Yang et al. A copy-move forgery detection method based on CMFD-SIFT
US20170344433A1 (en) Apparatus and method for data migration
d'Angelo et al. From bits to images: Inversion of local binary descriptors
Chihaoui et al. Copy-move image forgery detection based on SIFT descriptors and SVD-matching
Ouyang et al. Robust hashing based on quaternion Zernike moments for image authentication
EP2742442A1 (en) Detecting video copies
Yuan et al. Feature extraction and local Zernike moments based geometric invariant watermarking
Samanta et al. Analysis of perceptual hashing algorithms in image manipulation detection
US20160182224A1 (en) Method and apparatus for deriving a perceptual hash value from an image
US20190311744A1 (en) Comparing frame data to generate a textless version of a multimedia production
Pun et al. Robust image hashing using progressive feature selection for tampering detection
Sadeghi et al. Keypoint based authentication and localization of copy-move forgery in digital image
Novozámský et al. Detection of copy-move image modification using JPEG compression model
Hashim et al. An extensive analysis and conduct comparative based on statistical attach of LSB substitution and LSB matching
CN112651953A (en) Image similarity calculation method and device, computer equipment and storage medium
Chen et al. Multi-granularity geometrically robust video hashing for tampering detection
Nie et al. Robust video hashing based on representative-dispersive frames
CN110262925B (en) Remote backup method, device, terminal equipment and medium for pictures
Ravi et al. Forensic analysis of linear and nonlinear image filtering using quantization noise
Zhang et al. Real-time reversible data hiding in encrypted images based on hybrid embedding mechanism
GB2557417A (en) Image alignment for burst mode images

Legal Events

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