CN102831585B - Image fragment restoration method and image fragment restoration device - Google Patents

Image fragment restoration method and image fragment restoration device Download PDF

Info

Publication number
CN102831585B
CN102831585B CN201210277281.6A CN201210277281A CN102831585B CN 102831585 B CN102831585 B CN 102831585B CN 201210277281 A CN201210277281 A CN 201210277281A CN 102831585 B CN102831585 B CN 102831585B
Authority
CN
China
Prior art keywords
head
fragment
head fragment
patches
fore
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
CN201210277281.6A
Other languages
Chinese (zh)
Other versions
CN102831585A (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.)
Xiamen Meiya Pico Information Co Ltd
Original Assignee
Xiamen Meiya Pico Information Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Meiya Pico Information Co Ltd filed Critical Xiamen Meiya Pico Information Co Ltd
Priority to CN201210277281.6A priority Critical patent/CN102831585B/en
Publication of CN102831585A publication Critical patent/CN102831585A/en
Application granted granted Critical
Publication of CN102831585B publication Critical patent/CN102831585B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an image fragment restoration method. The method includes the steps: 1, acquiring head fragments from a to-be-restored storage medium and forming a head fragment collection according to a head signature corresponding to an image in the format needing to be restored, and simultaneously obtaining a non-head fragment collection of the image from the to-be-restored storage medium; and 2, matching each head fragment in the head fragment collection with a corresponding next non-head fragment in the non-head fragment collection, combining the current head fragment with the next non-head fragment thereof, if a file obtained after combination is a complete image file, outputting the complete image file, and otherwise, adding the file obtained after combination in the head fragment collection to serve as a new head fragment. The image fragment restoration method has the advantages of high restoration accuracy and efficiency, and is applicable to restoration of image fragments in various formats and high in practicality.

Description

A kind of images fragment restoration methods and device
Technical field
The invention belongs to information security and Computer Applied Technology field, relate in particular to a kind of images fragment restoration methods and device based on confidence level.
Background technology
Traditional data recover to depend on the metamessage of file system, as file allocation table, bibliographic structure etc., recover deleted file, but in a lot of situations, these metamessages may be lost because of capped or manual operation, and at this moment recovery is not gone out file by traditional recovery technology.Therefore, there is in recent years a kind of recovery technology file system, that recover that do not rely in file-level, from storage medium, recovered the technology of specific file by resolving specific file layout.At present, data in file-level are recovered popular having " head-afterbody " and are recovered, this recovery technology has well solved the recovery of the file of Coutinuous store, but for the file of discontinuous storage, the recovery effects of " head-afterbody " technology is unsatisfactory.
Along with scientific and technical development, often need to obtain electronic evidence from storage medium the inside, and picture is as it obtain and enjoy attention of one of the strongest electronic evidence.Wherein, JPG picture compression form is as one of most popular picture format, and its fragment recovery technology is the emphasis of studying in the industry naturally.The fragment recovery technology of existing JPG image mainly depends on prediction and the coupling of image edge pixel, main edge pixel matching algorithm has MOD, MED algorithm etc. at present, although these algorithms are simple, but undue the paying close attention to accuracy and cause efficiency and low having, but the higher accuracy of some efficiency is but not high.
In sum, need to provide all fragment recovery technology of higher image of a kind of accuracy and efficiency.
Summary of the invention
The invention provides a kind of images fragment restoration methods and device, for solving all lower problems of existing JPG images fragment recovery technology accuracy and efficiency.Images fragment recovery scheme provided by the invention has the accuracy of recovery height simultaneously and recovers the high feature of efficiency, and rejuvenation is without artificial intervention, automaticity is high, can be applicable to the recovery of the images fragment of multiple format, has very strong practicality.
The invention provides a kind of images fragment restoration methods, comprising:
Step 1: the corresponding head signature of image of the form recovering as required, obtain the head fragment of image and form head set of patches from storage medium to be recovered, obtain the non-head set of patches of image from storage medium described to be recovered simultaneously;
Step 2: to the each head fragment in described head set of patches, it in described non-head set of patches, is the next non-head fragment of its coupling, and next non-head fragment merges with it will to work as fore head fragment, if the file obtaining after merging is a complete image file, export described complete image file, otherwise the file obtaining adds in described head set of patches as a new head fragment after merging.
Preferably, in above-mentioned images fragment restoration methods, described step 2 further comprises:
Step 21: judge that described head set of patches or described non-head set of patches are empty set? if so, process ends; Otherwise, continue execution step 22;
Step 22: appoint and get the head fragment of an image in described head set of patches, and got head fragment is deleted from described head set of patches;
Step 23: judge the non-head fragment having in described non-head set of patches not being selected when fore head fragment? if so, continue execution step 24, otherwise return to execution step 21;
Step 24: in described non-head set of patches, select one for be not selected when fore head fragment and on storage medium described to be recovered with when the nearest non-head fragment of fore head fragment;
Step 25: judge that according to preset judgment method the non-head fragment of current selection is the non-head fragment of the next one when fore head fragment? if so, continue execution step 26, otherwise return to execution step 23;
Step 26: next non-head fragment merges with it will to work as fore head fragment, and the described non-head fragment of the next one when fore head fragment is deleted from described non-head set of patches, do you judge that the file obtaining after merging is a complete image file? if, export this image file, and return to execution step 21; Otherwise the file obtaining adds in described head set of patches as a new head fragment, and return to execution step 21 after merging.
Preferably, in above-mentioned images fragment restoration methods, the method of preset judgment described in step 25 is: the described non-head fragment when fore head fragment and described current selection, in conjunction with decoding, is obtained to the described edge pixel set when the edge pixel set of fore head fragment and the non-head fragment of current selection; Calculate described mathematical expectation U1 and variances sigma when grey scale pixel value in the edge pixel set of fore head fragment 1, and calculate mathematical expectation U2 and the variances sigma of grey scale pixel value in the edge pixel set of non-head fragment of described current selection 2; Described in calculating, work as grey scale pixel value in the edge pixel set of fore head fragment and drop on interval (U1-1.96 σ 1, U1+1.96 σ 1) in probability, and calculate grey scale pixel value in the edge pixel set of non-head fragment of described current selection and drop on interval (U2-1.96 σ 2, U1+1.96 σ 2) in probability; Described in judgement, work as grey scale pixel value in the edge pixel set of fore head fragment and drop on interval (U1-1.96 σ 1, U1+1.96 σ 1) in probability and the edge pixel set of the non-head fragment of current selection in grey scale pixel value drop on interval (U2-1.96 σ 2, U1+1.96 σ 2) in probability whether be more than or equal to 0.95 simultaneously? if, the non-head fragment of described current selection is thought to the non-head fragment of the next one when fore head fragment, otherwise the non-head fragment of current selection is not the non-head fragment of the next one when fore head fragment.
Preferably, in above-mentioned images fragment restoration methods, the described image that needs the form recovering is JPG image.
Preferably, when the image of form recovering when needs is JPG image, described in above-mentioned steps 26, judge merge after the file that obtains whether be a complete image file, comprising: judge whether latter two byte that merges the file that obtains is afterwards 0xFFD9.
Preferably, in above-mentioned images fragment restoration methods, described step 1 comprises:
Step 11: according to the corresponding head signature of JPG image, search N the sector with JPG head signature from storage medium to be recovered; N is more than or equal to 0 integer;
Step 12: judge that N is 0? if so, described head set of patches is empty set, and the flow process of end step 1 continues execution step 2; Otherwise, make i=1, j=1;
Step 13: obtain the segment mark of j section and the size of section in the individual sector with JPG head signature of i;
Step 14: whether the segment mark that judges j section legal? if so, continue execution step 15; Otherwise skip to step 18;
Step 15: according to the size of j section, jump to the reference position of (j+1) individual section, and continue execution step 16;
Step 16: make j=j+1, read the segment mark of j section and the size of section;
Step 17: the segment mark that judges j section is 0xFFDA? if not, return to execution step 14; If, described i the 1st section with the sector of JPG head signature merged residing several sectors respectively in order to current j section, obtain the head fragment of i image, the head fragment of described i image is added in described head set of patches, and continue execution step 18;
Step 18: judge that i equals N? if, the sector that other that obtain from storage medium described to be recovered is had to view data but do not have a JPG head signature is classified as described non-head set of patches, and the flow process of end step 1, continue execution step 2; Otherwise, make i=i+1, and return to execution step 13.
A kind of images fragment recovery device provided by the invention, comprise: fragment acquisition module, be used for the corresponding head signature of image of the form recovering as required, obtain the head fragment of image and form head set of patches from storage medium to be recovered, and obtaining the non-head set of patches of image from storage medium described to be recovered; Matching module, be used for each head fragment of the head set of patches that described fragment acquisition module is obtained, in the non-head set of patches obtaining at described fragment acquisition module, be the next non-head fragment of its coupling, and next non-head fragment merge with it will to work as fore head fragment; If the file obtaining after merging is a complete image file, the described complete image file of described next non-head fragments matching module output, otherwise the file obtaining after merging adds in described head set of patches as a new head fragment.
Preferably, described matching module comprises selection module, decoder module, computing module, judge module and merging module;
Described selection module is for choose a build portion fragment from described head set of patches at every turn, and in described non-head set of patches, select one for be not selected when fore head fragment and on storage medium described to be recovered with when the nearest non-head fragment of fore head fragment, the described non-head fragment when fore head fragment and current selection is offered to described decoder module;
The non-head fragment when fore head fragment and current selection that described decoder module is used for described selection module to provide, in conjunction with decoding, obtains described when offering described computing module after the edge pixel set of the edge pixel set of fore head fragment and the non-head fragment of current selection;
Described computing module is for calculating mathematical expectation U1 and the variances sigma of the edge pixel set grey scale pixel value when fore head fragment that described decoder module provides 1, and calculate mathematical expectation U2 and the variances sigma of grey scale pixel value in the edge pixel set of non-head fragment of the current selection that described decoder module provides 2; And described in calculating, work as grey scale pixel value in the edge pixel set of fore head fragment and drop on interval (U1-1.96 σ 1, U1+1.96 σ 1) in probability, and calculate grey scale pixel value in the edge pixel set of non-head fragment of described current selection and drop on interval (U2-1.96 σ 2, U1+1.96 σ 2) in probability;
Described judge module drops on interval (U1-1.96 σ for judging the edge pixel set grey scale pixel value when fore head fragment that described computing module calculates 1, U1+1.96 σ 1) in probability and the edge pixel set of the non-head fragment of current selection in grey scale pixel value drop on interval (U2 mono-1.96 σ 2, U1+1.96 σ 2) in probability whether be more than or equal to 0.95 simultaneously? if so, using the non-head fragment of described current selection as when the non-head fragment of the next one of fore head fragment, and next non-head fragment offers merging module with it will describedly to work as fore head fragment;
What described merging module was used for judge module to provide works as the next non-head fragment merging with it of fore head fragment, and the complete image file obtaining after output merging, or the incomplete document image file obtaining after merging adds in described head set of patches as a new head fragment.
Probability theory being applied in images fragment rejuvenation of the invention, propose a kind of using the images fragment recovery scheme of degree of confidence pixel matching criterion in edge in images fragment rejuvenation, this scheme has the accuracy of recovery height and recovers the high feature of efficiency, in addition, rejuvenation is without artificial intervention, can obtain automatically head fragment and select to be applicable to next fragment by degree of confidence degree, thereby recovering picture.The method is not only specially adapted to the recovery of the images fragment of JPG form, and the fragment that is also suitable for extended formatting picture simultaneously recovers, and has very strong versatility.
Brief description of the drawings
Fig. 1 is a kind of images fragment restoration methods process flow diagram that the embodiment of the present invention provides;
Fig. 2 is the detail flowchart of step 2 in method shown in Fig. 1;
Fig. 3 is the detailed determination methods process flow diagram of S25 in Fig. 2;
Fig. 4 is when the image that needs to recover detail flowchart of step 1 in Fig. 1 while being the image of JPG form;
Fig. 5 is a kind of images fragment recovery device structural representation that the embodiment of the present invention provides;
Fig. 6 is the detailed structure schematic diagram of matching module 52 in Fig. 5;
The result that Fig. 7 A recovers dfrws2007 images fragment for the images fragment recovery scheme that adopts the embodiment of the present invention to provide;
Fig. 7 B is the result that adopts Recovery pair of same dfrws2007 images fragment adopting with Fig. 7 A of software Adroit to recover.
Embodiment
The embodiment of the present invention provides a kind of images fragment restoration methods, and as shown in Figure 1, the method comprises the following steps:
Step 1: the corresponding head signature of image of the form recovering as required, obtain the head fragment of the image with described head signature and form head set of patches H from storage medium to be recovered, obtaining the non-head set of patches S of image simultaneously from storage medium to be recovered;
Step 2: to the each head fragment H in head set of patches H i, in non-head set of patches S, be the next non-head fragment S of its coupling j, and will work as fore head fragment H inext non-head fragment S with it jmerge, if the file obtaining after merging is a complete image file, export this image file, otherwise the file obtaining after merging adds in described head set of patches as a new head fragment.
Because the head of the view data of nearly all form always has its corresponding head signature, the afterbody of image has the end mark of image, the corresponding head signature of the image of the form that therefore can recover as required in above-mentioned steps 1, gets the head fragment of the image of this kind of form from storage medium to be recovered.Obviously, if the former image that stores multiple this kind of forms on storage medium to be recovered, in step 1, can get the head fragment of the image of multiple this kind of forms, by all head fragment composition head set of patches H that get, other images fragments without the corresponding head signature character of image that needs the form recovering are included in non-head set of patches S simultaneously.According to method described in step 2, for each head fragments matching is to next non-head fragment, finally obtain the corresponding complete image file of each head fragment output subsequently.
Below for convenience of description, with current application the most widely the image of JPG form revert to example, in conjunction with each accompanying drawing, illustrate the specific embodiment of the invention.What deserves to be explained is; those skilled in the art can adopt identical principle; by all technical schemes of recovering extended formatting image that simply replace with for the technical characterictics that recover JPG format-pattern illustrated in embodiment below, within these schemes are also the claimed scope of the present invention.
For convenience of description, first the image file structure of JPG form is carried out to brief description at this: JPG image file major section composition, broadly can be divided into data segment and non-data segment.The main storage pixel information of data segment, non-data segment is mainly stored the more needed information of decoded data segment, and the general sequence of various sections that complete JPG image file mainly comprises is: file header SOI (corresponding segment mark is 0xFFD8), definition Interchange Format and image recognition information APP (corresponding segment mark is 0xFFEn), scan line opening flag SOS (corresponding segment mark is 0xFFDA), packed data, end-of-file EOI (corresponding segment mark is 0xFFD9) etc.Wherein, SOI, APP, EOI etc. are non-data segment, and scheme provided by the invention is to carry out on the complete basis of the non-data segment of image file, because non-data segment is all smaller, in most situation, the non-data of JPG file are to produce fragment.
Fig. 2 is the detail flowchart of step 2 in method shown in Fig. 1, comprising:
S21: judge that head set of patches H or non-head set of patches S are empty set? if so, process ends; Otherwise, continue to carry out S22.
S22: appoint the head fragment H that gets an image in head set of patches H i, and by got head fragment H iin set of patches H, delete from the head.
S23: judge in non-head set of patches S and whether have working as fore head fragment H ithe non-head fragment not being selected? if so, continue to carry out S24, carry out S21 otherwise return.
S24: select one to working as fore head fragment H in non-head set of patches S ithat be not selected and on storage medium to be recovered with as fore head fragment H inearest non-head fragment S k.
S25: the non-head fragment S that judges current selection according to preset judgment method kwhether be as fore head fragment H ithe non-head fragment of next one S jif so, continue to carry out S26, carry out S23 otherwise return.
S26: will work as fore head fragment H inext non-head fragment S with it j(be the S of current selection k) merge, and will work as fore head fragment H ithe non-head fragment of next one S jfrom described non-head set of patches S, delete.
S27: the corresponding afterbody mark of the image judgement of the form recovering is as required as fore head fragment H inext non-head fragment S with it jdoes is the file obtaining after merging a complete image file? if so, carry out S28; Otherwise, skip to and carry out S29.
Preferably, what if desired recover is the image of JPG form, after working as fore head fragment in S26 next non-head fragment merging with it, S27 judge merge after latter two byte of the file that obtains whether be 0xFFD9 (EOI mark), if so, prove that the file obtaining after merging is a complete JPG image file.
S28: output is as fore head fragment H inext non-head fragment S with it jthe image file obtaining after merging, and return and carry out S21.
S29: will work as fore head fragment H inext non-head fragment S with it jthe file obtaining after merging is as a new head fragment H iadd in head set of patches H, and return and carry out S21.
Fig. 3 is the detailed determination methods process flow diagram of S25 in Fig. 2, specifically comprises:
S31: will work as fore head fragment H inon-head fragment S with current selection kin conjunction with decoding, obtain as fore head fragment H iedge pixel set P1 and the non-head fragment S of current selection kedge pixel set P2.Wherein, not belonging to same fragment decoding position gained and on picture is that two adjacent pixels are edge pixel.This step can realize by existing coding/decoding method and existing edge pixel acquisition methods, no longer describe more.
S32: calculate mathematical expectation U1 and variances sigma when grey scale pixel value in the edge pixel set P1 of fore head fragment 1, and calculate mathematical expectation U2 and the variances sigma of grey scale pixel value in the edge pixel set P2 of non-head fragment of current selection 2.
S33: calculating is worked as grey scale pixel value in the edge pixel set P1 of fore head fragment and dropped on interval (U1 mono-1.96 σ 1, U1+1.96 σ 1) in probability F1, and calculate grey scale pixel value in the edge pixel set P2 of non-head fragment of current selection and drop on interval (U2-1.96 σ 2, U1+1.96 σ 2) in probability F2.
S34: judge whether F1 and F2 are more than or equal to 0.95 simultaneously? if so, continue to carry out S26, otherwise, the non-head fragment S of current selection knot as fore head fragment H ithe non-head fragment of next one S j, return and carry out S23.
Because the color model of JPG image adopts YCrCb color space model, and human eye is more responsive for gray scale (Y), and therefore in the matching degree of calculating pixel, the embodiment of the present invention only adopts Y color component to calculate.Shown in Fig. 3 in flow process, when mathematical expectation U (average gray) and the variances sigma of pixel grey scale in the edge pixel set P2 of the edge pixel set P1 of fore head fragment and the non-head fragment of current selection 2computing formula be:
U a = Σ k = 1 k ≤ n Y ak n , a=1,2 (1)
,a=1,2 (2)
In formula (1) and formula (2), n is the each self-contained element number of edge pixel set P1, P2.Due in piece image, difference between adjacent two pixels is very little, and the distribution of edge pixel is similar to stochastic distribution, therefore under this prerequisite, can think that P1, P2 belong to same and distribute, by the known standardized normal distribution of knowledge of theory of probability in interval (1.96, + 1.96) probability of the point among is 95%, therefore the embodiment of the present invention adopts whether the fiducial interval of standardized normal distribution is the evaluation criterion of neighbor as the corresponding pixel of P1, P2, and even P1, P2 meet simultaneously: in P1, grey scale pixel value drops on interval (U1-1.96 σ 1, U1+1.96 σ 1) in probability F1>=0.95, and in P2, grey scale pixel value drops on interval (U2-1.96 σ 2, U1+1.96 σ 2) in probability F2>=0.95, can think the non-head fragment S of current selection kas fore head fragment H inext fragment S j.
What deserves to be explained is, because color space can exchange, therefore Fig. 3 provide for judging the non-head fragment S of current selection kwhether be as fore head fragment H ithe S of the non-head fragment of the next one jdetermination methods be not only applicable to the judgement of adjacent fragment in the rejuvenation of JPG image, be also applicable to for the judgement that adopts neighbor in the rejuvenation of image of other color space models (non-YCrCb color space model).
Preferably, in the time that the image of needs recovery is the image of JPG form, shown in Fig. 1, in method, the embodiment of step 1 as shown in Figure 4, comprising:
S41: according to the corresponding head signature of JPG image, search N the sector with JPG head signature from storage medium to be recovered; N is more than or equal to 0 integer.
Wherein, because the first two byte of the image file of JPG form is fixed as 0xFFD8, three nybbles have 9 kinds of forms to be respectively: 0xFFE0, 0xFFE1, 0xFFE2, 0xFFE8, 0xFFEB, 0xFFEE, 0xFFFE, 0xFFC4, 0XFFDB, therefore, this step is searched for head signature on storage medium to be recovered---and one or two bytes are that 0xFFD8 and three nybbles are 0xFFE0, 0xFFE1, 0xFFE2, 0xFFE8, 0xFFEB, 0xFFEE, 0xFFFE, 0xFFC4, the sector of any form in 0XFFDB, can be on storage medium to be recovered the head of the head fragment of the N that searches a JPG image.
S42: judge that N is 0? if so, carry out S413, otherwise, make i=1, j=1, and continue to carry out S43.
S413: making head set of patches is empty set, the flow process of end step 1.
S43: obtain the segment mark of j section and the size of section in the individual sector with described JPG head signature of i.
For example: if search the sector of the individual JPG of the having picture headers signature of N (N >=1) in S41, in this step, read front 6 bytes of the 1st sector with JPG head signature searching, because 1,2 bytes of JPG image file are JPG SOI code, 3,4 bytes are the segment mark of the 1st section, 5,6 bytes are the section size of the 1st section, therefore, in this step, get segment mark and the section size of the 1st section of the 1st sector.
S44: whether the segment mark that judges current j section legal? if so, continue to carry out S45; Otherwise skip to S49.In this step, the legitimacy of segment mark refers to whether the segment mark of present segment is any form in 0xFFE0,0xFFE1,0xFFE2,0xFFE8,0xFFEB, 0xFFEE, 0xFFFE, 0xFFC4,0XFFDB, if segment mark is legal, represent that present segment is the part in the head fragment of JPG image.
S45: according to the size of j section, jump to the reference position of (j+1) individual section, and continue to carry out S46.
Wherein, the size of reference position+the j section of j the section of reference position=2+ of (j+1) individual section.For example: if the size of the 1st section reading in previous step S44 is 10 (the data length of the 1st section is 10), and the reference position of the 1st section is 3 (because two bytes of current sector are SOI), the reference position of the 2nd section is: 2+3+10=15, the 1st of the 2nd section the byte is positioned at the 15th byte place of current sector, below the 3rd, the 4th, ..., the also similar calculating of position of j section.
S46: make j=j+1, read the segment mark of j section and the size of section.
S47: the segment mark that judges j section is 0xFFDA? if not, return and carry out S44; If so, continue to carry out S48.
S48: i the 1st section with the sector of JPG head signature merged in order to current j residing several sectors of section, obtain the head fragment of i image, the head fragment of described i image is added in described head set of patches.
For example, if while carrying out S47, j=4, and the 1st section that i has in the sector of JPG head signature occupied altogether 3 sectors to current the 4th section: M the sector that i head signed and the 1st section has occupied storage medium to be recovered, 2-3 section has occupied L sector of storage medium to be recovered, the 4th section has occupied K sector of storage medium to be recovered, and the data order of M, the L of storage medium to be recovered, a K sector is merged the head fragment that obtains i JPG image by this step.
S49: judge that i equals N? if so, carry out S410, otherwise, skip to and carry out S411.
S410: other that obtain from storage medium described to be recovered are had to view data but the sector without JPG head signature is classified as described non-head set of patches, and the flow process of end step 1, continue execution step 2.
S411: make i=i+1, and return and carry out S43.
A kind of images fragment restoration methods providing corresponding to the embodiment of the present invention, the embodiment of the present invention also provides a kind of images fragment recovery device, as shown in Figure 5, comprises fragment acquisition module 51 and matching module 52.
Wherein, the image of the form corresponding head signature of fragment acquisition module 51 for recovering as required, obtain the head fragment of image and form head set of patches from storage medium to be recovered, and obtaining the non-head set of patches of image from storage medium described to be recovered.
Matching module 52 is for each head fragment of head set of patches that fragment acquisition module 51 is obtained, in the non-head set of patches obtaining at fragment acquisition module 51, be the next non-head fragment of its coupling, and next non-head fragment merge with it will to work as fore head fragment; If the file obtaining after merging is a complete image file, the described complete image file of described next non-head fragments matching module output, otherwise the file obtaining after merging adds in described head set of patches as a new head fragment.
Figure 6 shows that the detailed structure schematic diagram of matching module 52 in Fig. 5, as shown in Figure 6: matching module 52 comprises to be selected module 521, decoder module 522, computing module 523, judge module 524 and merges module 525.
Wherein, select module 521 to choose a build portion fragment for the head set of patches of obtaining from fragment acquisition module 51 at every turn, and in the non-head set of patches of obtaining at fragment acquisition module 51, select one for be not selected when fore head fragment and on storage medium described to be recovered with when the nearest non-head fragment of fore head fragment, and will offer decoder module 522 when the non-head fragment of fore head fragment and current selection.
Decoder module 522 is for to selecting the non-head fragment when fore head fragment and current selection that module 521 provides in conjunction with decoding, obtains when the edge pixel set of the edge pixel set of fore head fragment and the non-head fragment of current selection and offers computing module 523.
Computing module 523 is for calculating mathematical expectation U1 and the variances sigma of the edge pixel set grey scale pixel value when fore head fragment that decoder module 522 provides 1, and calculate mathematical expectation U2 and the variances sigma of grey scale pixel value in the edge pixel set of non-head fragment of the current selection that decoder module 522 provides 2; And calculate when in the edge pixel set of fore head fragment grey scale pixel value drop on interval (U1-1.96 σ 1, U1+1.96 σ 1) in probability, and calculate grey scale pixel value in the edge pixel set of non-head fragment of current selection and drop on interval (U2-1.96 σ 2, U1+1.96 σ 2) in probability.
Judge module 524 drops on interval (U1-1.96 σ for judging the edge pixel set grey scale pixel value when fore head fragment that computing module 513 calculates 1, U1+1.96 σ 1) in probability and the edge pixel set of the non-head fragment of current selection in grey scale pixel value drop on interval (U2-1.96 σ 2, U1+1.96 σ 2) in probability whether be more than or equal to 0.95 simultaneously? if so, using the non-head fragment of current selection as when the non-head fragment of the next one of fore head fragment, and next non-head fragment offers merging module with it will to work as fore head fragment;
Merge module 525 for judge module 524 is provided when the next non-head fragment merging with it of fore head fragment, and the complete image file obtaining after output merging, or the incomplete document image file obtaining after merging adds in described head set of patches as a new head fragment.
The result that Fig. 7 A recovers dfrws2007 images fragment for the images fragment recovery scheme that adopts the embodiment of the present invention to provide, Fig. 7 B adopts external more famous image to recover software Adroit
The result that Recovery recovers the identical images fragment adopting with Fig. 7 A, in addition, comprehensive Fig. 7 A of analysis and Fig. 7 B experimental data that corresponding images fragment recovery is tested is separately known: unique difference of the result that the images fragment recovery scheme that the embodiment of the present invention provides and Adroit Recovery obtain is in recovering the 18th file, thereby there is the situation of erroneous judgement and caused the image that can pay imperfect in Adroit Recovery, visible, the scheme that adopts the embodiment of the present invention to provide can obtain being equal to the image recovery effects that is even more better than Adroit Recovery.
Probability theory being applied in images fragment rejuvenation of the invention, propose a kind of using the images fragment recovery scheme of degree of confidence pixel matching criterion in edge in images fragment rejuvenation, this scheme has the accuracy of recovery height and recovers the high feature of efficiency, in addition, rejuvenation is without artificial intervention, can obtain automatically head fragment and select to be applicable to next fragment by degree of confidence degree, thereby recovering picture.The method is not only specially adapted to the recovery of the images fragment of JPG form, and the fragment that is also suitable for extended formatting picture simultaneously recovers, and has very strong versatility.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if these amendments of the present invention and within modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.

Claims (7)

1. an images fragment restoration methods, is characterized in that, the method comprises:
Step 1: the corresponding head signature of image of the form recovering as required, obtain the head fragment of image and form head set of patches from storage medium to be recovered, obtain the non-head set of patches of image from storage medium described to be recovered simultaneously;
Step 2: to the each head fragment in described head set of patches, it in described non-head set of patches, is the next non-head fragment of its coupling, and next non-head fragment merges with it will to work as fore head fragment, if the file obtaining after merging is a complete image file, export described complete image file, otherwise the file obtaining adds in described head set of patches as a new head fragment after merging;
Wherein, comprise according to preset judgment method and judge whether the non-head fragment of current selection is the step when the non-head fragment of the next one of fore head fragment in step 2;
Described preset judgment method is:
Non-head fragment when fore head fragment and current selection, in conjunction with decoding, is obtained to the edge pixel set when the edge pixel set of fore head fragment and the non-head fragment of current selection;
Calculate described mathematical expectation U1 and variance when grey scale pixel value in the edge pixel set of fore head fragment , and calculate mathematical expectation U2 and the variance of grey scale pixel value in the edge pixel set of non-head fragment of described current selection ;
Described in calculating, work as grey scale pixel value in the edge pixel set of fore head fragment and drop on interval (U1-1.96 , U1+1.96 ) in probability, and calculate grey scale pixel value in the edge pixel set of non-head fragment of described current selection and drop on interval (U2-1.96 , U1+1.96 ) in probability;
Described in judgement, work as grey scale pixel value in the edge pixel set of fore head fragment and drop on interval (U1-1.96 , U1+1.96 ) in probability and the edge pixel set of the non-head fragment of current selection in grey scale pixel value drop on interval (U2-1.96 , U1+1.96 ) in probability whether be more than or equal to 0.95 simultaneously; If so, the non-head fragment of described current selection is thought to the non-head fragment of the next one when fore head fragment, otherwise the non-head fragment of current selection not the non-head fragment of the next one when fore head fragment.
2. a kind of images fragment restoration methods as claimed in claim 1, is characterized in that, described step 2 comprises:
Step 21: judge whether described head set of patches or described non-head set of patches are empty set, if so, process ends; Otherwise, continue execution step 22;
Step 22: appoint and get the head fragment of an image in described head set of patches, and got head fragment is deleted from described head set of patches;
Step 23: judge in described non-head set of patches whether have the non-head fragment for not being selected when fore head fragment, if so, continue execution step 24, otherwise return to execution step 21;
Step 24: in described non-head set of patches, select one for be not selected when fore head fragment and on storage medium described to be recovered with when the nearest non-head fragment of fore head fragment;
Step 25: whether the non-head fragment that judges current selection according to preset judgment method is the non-head fragment of the next one when fore head fragment, if so, continues execution step 26, otherwise returns to execution step 23;
Step 26: next non-head fragment merges with it will to work as fore head fragment, and the described non-head fragment of the next one when fore head fragment is deleted from described non-head set of patches, judge whether the file obtaining after merging is a complete image file, if, export this image file, and return to execution step 21; Otherwise the file obtaining adds in described head set of patches as a new head fragment, and return to execution step 21 after merging.
3. a kind of images fragment restoration methods as described in claim 1 to 2 any one, is characterized in that, the described image that needs the form recovering is JPG image.
4. a kind of images fragment restoration methods as claimed in claim 2, it is characterized in that, described in step 26, judge merge after the file that obtains whether be a complete image file, comprising: judge whether latter two byte that merges the file that obtains is afterwards 0xFFD9.
5. a kind of images fragment restoration methods as claimed in claim 4, is characterized in that, described step 1 comprises:
Step 11: according to the corresponding head signature of JPG image, search N the sector with JPG head signature from storage medium to be recovered; N is more than or equal to 0 integer;
Step 12: judge whether N is 0, and if so, described head set of patches is empty set, the flow process of end step 1, continues execution step 2; Otherwise, make i=1, j=1;
Step 13: obtain the segment mark of j section and the size of section in the individual sector with JPG head signature of i;
Step 14: whether the segment mark that judges j section is legal, if so, continues execution step 15; Otherwise skip to step 18;
Step 15: according to the size of j section, jump to the reference position of (j+1) individual section, and continue execution step 16;
Step 16: make j=j+1, read the segment mark of j section and the size of section;
Step 17: whether the segment mark that judges j section is 0xFFDA, if not, returns to execution step 14; If, described i the 1st section with the sector of JPG head signature merged residing several sectors respectively in order to current j section, obtain the head fragment of i image, the head fragment of described i image is added in described head set of patches, and continue execution step 18;
Step 18: judge whether i equals N, if so, other that obtain from storage medium described to be recovered are had to view data but the sector without JPG head signature is classified as described non-head set of patches, and the flow process of end step 1, continue execution step 2; Otherwise, make i=i+1, and return to execution step 13.
6. an images fragment recovery device, is characterized in that, comprising:
Fragment acquisition module, be used for the corresponding head signature of image of the form recovering as required, obtain the head fragment of image and form head set of patches from storage medium to be recovered, and obtaining the non-head set of patches of image from storage medium described to be recovered;
Matching module, be used for each head fragment of the head set of patches that described fragment acquisition module is obtained, in the non-head set of patches obtaining at described fragment acquisition module, be the next non-head fragment of its coupling, and next non-head fragment merge with it will to work as fore head fragment; If the file obtaining after merging is a complete image file, the described complete image file of described next non-head fragments matching module output, otherwise the file obtaining after merging adds in described head set of patches as a new head fragment;
Wherein, described matching module comprises decoder module, computing module and judge module;
Described decoder module,, obtains when offering described computing module after the edge pixel set of the edge pixel set of fore head fragment and the non-head fragment of current selection in conjunction with decoding for the non-head fragment to when fore head fragment and current selection;
Described computing module, for calculating mathematical expectation U1 and the variance of the edge pixel set grey scale pixel value when fore head fragment that described decoder module provides , and calculate mathematical expectation U2 and the variance of grey scale pixel value in the edge pixel set of non-head fragment of the current selection that described decoder module provides ; And described in calculating, work as grey scale pixel value in the edge pixel set of fore head fragment and drop on interval (U1-1.96 , U1+1.96 ) in probability, and calculate grey scale pixel value in the edge pixel set of non-head fragment of described current selection and drop on interval (U2-1.96 , U1+1.96 ) in probability;
Described judge module, for judging that the edge pixel set grey scale pixel value when fore head fragment that described computing module calculates drops on interval (U1-1.96 , U1+1.96 ) in probability and the edge pixel set of the non-head fragment of current selection in grey scale pixel value drop on interval (U2-1.96 , U1+1.96 ) in probability whether be more than or equal to 0.95 simultaneously, if so, using the non-head fragment of described current selection as when the non-head fragment of the next one of fore head fragment, and next non-head fragment offers merging module with it will describedly to work as fore head fragment.
7. a kind of images fragment recovery device as claimed in claim 6, is characterized in that, described matching module also comprises to be selected module and merge module;
Described selection module, for choose a build portion fragment from described head set of patches at every turn, and in described non-head set of patches, select one for be not selected when fore head fragment and on storage medium described to be recovered with when the nearest non-head fragment of fore head fragment, the described non-head fragment when fore head fragment and current selection is offered to described decoder module;
Described merging module, next non-head fragment merges the fore head fragment of working as that is used for judge module to provide with it, and the complete image file obtaining after output merging, or the incomplete document image file obtaining after merging adds in described head set of patches as a new head fragment.
CN201210277281.6A 2012-08-06 2012-08-06 Image fragment restoration method and image fragment restoration device Active CN102831585B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210277281.6A CN102831585B (en) 2012-08-06 2012-08-06 Image fragment restoration method and image fragment restoration device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210277281.6A CN102831585B (en) 2012-08-06 2012-08-06 Image fragment restoration method and image fragment restoration device

Publications (2)

Publication Number Publication Date
CN102831585A CN102831585A (en) 2012-12-19
CN102831585B true CN102831585B (en) 2014-12-10

Family

ID=47334702

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210277281.6A Active CN102831585B (en) 2012-08-06 2012-08-06 Image fragment restoration method and image fragment restoration device

Country Status (1)

Country Link
CN (1) CN102831585B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103645974B (en) * 2013-12-31 2017-02-08 厦门市美亚柏科信息股份有限公司 Method and device for recovering portable document format (PDF) file
CN104317670A (en) * 2014-10-22 2015-01-28 四川神琥科技有限公司 Android system trace forensic restorer
EP3093851B1 (en) * 2015-05-11 2017-11-08 Micro Systemation AB Method and device for use when reassembling a fragmented jpeg image
CN105677797B (en) * 2015-12-31 2019-07-12 四川秘无痕科技有限责任公司 A kind of fragment recombination method based on data similarity in JPEG picture file
CN106095808B (en) * 2016-05-30 2019-07-09 厦门市美亚柏科信息股份有限公司 A kind of method and apparatus that MDB file fragmentation restores

Non-Patent Citations (11)

* Cited by examiner, † Cited by third party
Title
Anandabrata Pal et al.Automated reassembling images fragments.《2003 lEEE International Conference on Acoustics, Speech, & Signal Processing》.2003,全文. *
Anandabrata Pal et al.Automated reassembling images fragments.《2003 lEEE International Conference on Acoustics, Speech, &amp *
Anandabrata Pal et al.Detecting file fragmentation point using sequential hypothesis testing.《Digital Investigation》.2008,第5卷全文. *
Automated reassembly of file fragmented images using greedy algorithms;Nasir Memon and Anandabrata Pal;《IEEE Transactions on Image Processing》;20060228;第15卷(第2期);第390页左栏,第392页右栏第2段 *
BMP图像碎片重组中的候选权重方法;王冬平 等;《计算机应用》;20071231;第27卷(第12期);全文 *
Detecting file fragmentation point using sequential hypothesis testing;Anandabrata Pal et al;《Digital Investigation》;20080930;第5卷;全文 *
File Fragment Classification—The Case for Specialized Approaches;Vassil Roussev and Simson L. Garfinkel;《Fourth International IEEE Workshop on Systematic Approaches to Digital Forensic Engineering》;20090531;第4.3节第2-3段 *
Nasir Memon and Anandabrata Pal.Automated reassembly of file fragmented images using greedy algorithms.《IEEE Transactions on Image Processing》.2006,第15卷(第2期),第390页左栏,第392页右栏第2段. *
Signal Processing》.2003,全文. *
Vassil Roussev and Simson L. Garfinkel.File Fragment Classification—The Case for Specialized Approaches.《Fourth International IEEE Workshop on Systematic Approaches to Digital Forensic Engineering》.2009,第4.3节第2-3段. *
王冬平 等.BMP图像碎片重组中的候选权重方法.《计算机应用》.2007,第27卷(第12期),全文. *

Also Published As

Publication number Publication date
CN102831585A (en) 2012-12-19

Similar Documents

Publication Publication Date Title
CN102831585B (en) Image fragment restoration method and image fragment restoration device
Radenović et al. Revisiting oxford and paris: Large-scale image retrieval benchmarking
CN100458773C (en) Information processing apparatus, method, storage medium and program
EP2355472B1 (en) Apparatus and method for transmitting and receiving handwriting animation message
US7481374B2 (en) System and method for placement and retrieval of embedded information within a document
CN106156761A (en) The image form detection of facing moving terminal shooting and recognition methods
CN102131020A (en) Image processing apparatus and image processing method
CN104199922A (en) Large-scale image library retrieval method based on local similarity hash algorithm
CN1979480A (en) Method and apparatus for representing and searching for an object using shape
CN103179424B (en) Method and device for synthesising three-dimensional image
Singh et al. A simple and effective solution for script identification in the wild
CN102375987A (en) Image processing device and image feature vector extracting and image matching method
CN101448054A (en) Information processing device, printing device, information processing system and method
CN106155840B (en) The method and apparatus used when recombinating fragment jpeg image
CN105677797B (en) A kind of fragment recombination method based on data similarity in JPEG picture file
CN113469005A (en) Recognition method of bank receipt, related device and storage medium
CN103870364B (en) A kind of final version restoration methods of YAFFS2 files based on timestamp
CN102890818A (en) Method and device for reassembling joint photographic experts group (JPG) picture fragments based on thumbnail
JP4962335B2 (en) Method for restoring embedded data
JP2005259017A (en) Image processing apparatus, image processing program and storage medium
JP5703898B2 (en) Form management system, form image management method, and program
US9378428B2 (en) Incomplete patterns
CN102378005B (en) Motion picture processing device and motion image processing method
CN113766311B (en) Method and device for determining video segment number in video
CN114202765A (en) Image text recognition method and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant