CN102890818B - Method and device for reassembling joint photographic experts group (JPG) picture fragments based on thumbnail - Google Patents

Method and device for reassembling joint photographic experts group (JPG) picture fragments based on thumbnail Download PDF

Info

Publication number
CN102890818B
CN102890818B CN201210277280.1A CN201210277280A CN102890818B CN 102890818 B CN102890818 B CN 102890818B CN 201210277280 A CN201210277280 A CN 201210277280A CN 102890818 B CN102890818 B CN 102890818B
Authority
CN
China
Prior art keywords
fragment
head
row
jpg picture
former
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
CN201210277280.1A
Other languages
Chinese (zh)
Other versions
CN102890818A (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 CN201210277280.1A priority Critical patent/CN102890818B/en
Publication of CN102890818A publication Critical patent/CN102890818A/en
Application granted granted Critical
Publication of CN102890818B publication Critical patent/CN102890818B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention provides a method for reassembling joint photographic experts group (JPG) picture fragments based on a thumbnail. The method comprises the following steps of: amplifying the thumbnail of the original JPG picture in the currently acquired head fragment to reach the same size of the original JPG picture; predicting a picture pixel value of the first row of the next fragment of the current head fragment according to a pixel value of an ith row of the original JPG picture, which is recorded by an ending part of a sector where the current head fragment is positioned, and a pixel value of an (i+1)th row of the amplified picture of the thumbnail of the original JPG picture, wherein i is the row number of the original JPG picture row in the original JPG picture, which is recorded by the ending part of the sector where the current head fragment is positioned; and selecting a non-head fragment as the next fragment of the current head fragment from a non-head fragment set, wherein the difference between the pixel value of the first row of the non-head fragment and the pixel value of the first row of the next fragment of the current head fragment, which is predicted in the previous step, is the smallest. By the method for reassembling the JPG picture fragments, reassembly accuracy and reassembly speed are high.

Description

A kind of JPG picture fragment recombination method based on thumbnail and device
Technical field
The present invention relates to information security and Computer Applied Technology field, particularly relate to a kind of JPG picture fragment recombination method based on thumbnail and device.
Background technology
Traditional data recovery technique depends on the metamessage of file system, as file allocation table, bibliographic structure etc., but under many circumstances, these metamessages may be lost because of capped or manual operation, and recovery is not gone out file by this moment traditional data recovery technique.File recombinant technique, as further developing of recovering traditional data, obtains and pays close attention to widely in recent years.
Picture as one of the strongest electronic evidence, the primary study object of its recombinant technique date restoring expert often, and JPG picture compression form is as one of most popular picture format, the emphasis that its recombinant technique is studied especially.Inside JPG picture recombinant technique, the most difficult problem is fragment recombination problem.The fragment restructuring of JPG picture, if just by enumerating all composite types, that will be a difficult especially problem.
At present, the recombinant technique of JPG picture fragment is mainly realized by the edge pixels coupling of picture and decoding checking, but the edge pixels matching process due to picture is the start edge pixel removing to predict next block fragment by the edge pixels of known picture fragment, therefore there is error.So, the limitation of existing edge pixels matching algorithm cause adopting existing JPG picture fragment recombinant technique recombinate JPG picture fragment time, even if having found all JPG picture fragments but often restructuring does not go out correct picture.Such as; external more famous JPG picture fragment restructuring software Adroit Recovery restructuring JPG picture is adopted often to there will be such situation: when checking picture restructuring result with thumbnail; picture is correct; but when opening this picture, picture is but wrong (is not one complete former picture).
In view of this, need a kind of JPG picture fragment recombination method that can judge next block fragment of photo current fragment more accurately, to improve the accuracy rate of JPG picture fragment restructuring.
Summary of the invention
The invention provides a kind of JPG picture fragment recombination method based on thumbnail and device, for the problem that the restructuring accuracy rate solving existing JPG picture fragment recombinant technique is low, the restructuring accuracy of the JPG picture fragment recombinant technique based on thumbnail provided by the invention is high, speed is fast, and regrouping process is without the need to manpower intervention, automaticity is high.
A kind of JPG picture fragment recombination method based on thumbnail provided by the invention, comprising:
Step 1: the head according to JPG picture is signed, obtain the head fragment of JPG picture from storage medium to be restored and form head set of patches, obtain the non-head fragment of JPG picture from described storage medium to be restored simultaneously and form non-head set of patches;
Step 2: judge that described head set of patches or described non-head set of patches are empty set? if then process ends, otherwise continue to perform step 3;
Step 3: appoint from described head set of patches and get a head fragment and got head fragment is deleted from described head set of patches; The thumbnail of former JPG picture is obtained from current head fragment, and according to the size information of the former JPG picture recorded in current head fragment, the thumbnail of described former JPG picture is zoomed into the picture with described former JPG picture formed objects, obtain the enlarged drawing of the thumbnail of former JPG picture;
Step 4: the picture pixels value of next fragment the 1st row of the pixel value prediction current head fragment of (i+1) row of the pixel value of former JPG picture i-th row recorded according to ending, sector, current head fragment place and the enlarged drawing of the thumbnail of former JPG picture; Wherein, the capable line number in described former JPG picture of former JPG picture that described i records for ending, sector, current head fragment place, 1≤i≤H, i is positive integer, the height of the former JPG picture of H corresponding to current head fragment;
Step 5: the minimum non-head fragment of the difference of the pixel value of next fragment the 1st row of the current head fragment selecting the pixel value of the 1st row and previous step to predict in described non-head set of patches is as the next fragment of current head fragment;
Step 6: the next fragment of current head fragment and current head fragment is merged, and the next fragment of described current head fragment is deleted from described non-head set of patches; Judge the next fragment of current head fragment and current head fragment merge after the file that obtains be a complete JPG picture file? if so, then export described complete JPG picture file, and return execution step 2; Otherwise, adopt the file obtained after merging to replace current head fragment and return and perform step 4.
Preferably, the picture pixels value of next fragment the 1st row of the pixel value prediction current head fragment of (i+1) row of the pixel value of former JPG picture i-th row recorded according to ending, sector, current head fragment place described in step 4 and the enlarged drawing of the thumbnail of former JPG picture, comprise: the pixel value P (i of the i-th row jth row of the former JPG picture adopting ending, sector, current head fragment place to record, j) pixel value the P ' (i+1 arranged with (i+1) row jth of the enlarged drawing of the thumbnail of former JPG picture, j) the pixel value P (i+1 that weighted mean value arranges as next fragment the 1st row jth of current head fragment, j), wherein, 1≤j≤W, j is positive integer, the width of the former JPG picture of W corresponding to current head fragment, the weight of pixel value P (i, j) is α i, the weight of pixel value P ' (i+1, j) is β i, α iand β icomputing method be:
α i = Σ j = 1 W f ( j ) W , i = 2,3 , . . . , H 0 , i = 1 ,
β i = Σ j = 1 W g ( j ) W , i = 1,2 , . . . , H ,
Wherein, f ( j ) = 1 , P ( i , j ) = P ( i - 1 , j ) 0 , P ( i , j ) ≠ P ( i - 1 , j ) , g ( j ) = 1 , P ( i , j ) = P ′ ( i , j ) 0 , P ( i , j ) ≠ P ′ ( i , j ) ; And work as α i+ β iwhen=0, P (i+1, j)=0.
When there is no the 1st row Pixel Information of former JPG picture in described current head fragment, be the pixel of former JPG picture the 1st row by the pixel prediction of enlarged drawing the 1st row of the thumbnail of the former JPG picture corresponding to current head fragment.
Preferably, the minimum non-head fragment of the difference of the pixel value of next fragment the 1st row of the current head fragment selecting the pixel value of the 1st row and previous step to predict described in step 5 in described non-head set of patches, as the next fragment of current head fragment, comprising: the difference C calculating the pixel value of next fragment the 1st row of the current head fragment predicted in the pixel value of the 1st row of the n-th non-head fragment in described non-head set of patches and step 4 n: wherein, n=0,1 ..., N, N are the number of the non-head fragment in described non-head set of patches, Q n(1, j) be the pixel value of the n-th non-head fragment the 1st row jth row in described non-head set of patches, the pixel value of next fragment the 1st row jth row that P (i+1, j) is described current head fragment; By C 1, C 2..., C nin the minimum non-head fragment corresponding to as the next fragment of current head fragment.
Preferably, judge described in step 6 the next fragment of current head fragment and current head fragment merge after the file that obtains be whether a complete JPG picture file, comprise: latter two byte judging the file obtained after merging is 0xFFD9? if, the file then obtained after described merging is a complete JPG picture file, otherwise the file obtained after described merging is not a complete JPG picture file.
The present invention also provides a kind of JPG picture fragment reconstruction unit based on thumbnail, comprises fragment and obtains and memory module, judge module, selection module, prediction module, matching module and merging module;
Described fragment obtains and memory module, sign for the head according to JPG picture, obtain the head fragment of JPG picture from storage medium to be restored and form the storage of head set of patches, obtain the non-head fragment of JPG picture from described storage medium to be restored simultaneously and form the storage of non-head set of patches; Also for providing described head set of patches and non-head set of patches to described judge module and matching module, and provide described head set of patches to described selection module; In addition, described fragment acquisition and memory module are also for the removal request according to described merging module, the next fragment of current head fragment is deleted from described non-head set of patches, and new non-head set of patches is resend to described judge module and matching module;
Described judge module, for judging whether the head set of patches that the acquisition of described fragment and memory module provide or described non-head set of patches are empty set, time if not, notify that described selection module carries out the selection of head fragment;
Described selection module, head fragment for sending according to described judge module selects notice, appoints and get a head fragment and deleted from described head set of patches by got head fragment from the head set of patches that described fragment obtains and memory module provides; And from current head fragment, obtain the thumbnail of former JPG picture, according to the size information of the former JPG picture recorded in current head fragment, the thumbnail of described former JPG picture is zoomed into the picture with described former JPG picture formed objects, and the enlarged drawing of the thumbnail of current head fragment and former JPG picture is supplied to described prediction module;
Described prediction module, for receiving described selection module or merging the enlarged drawing of thumbnail of the former JPG picture that the current head fragment that provides of module and described selection module provide, the picture pixels value of next fragment the 1st row of the pixel value prediction current head fragment of (i+1) row of the pixel value of former JPG picture i-th row recorded according to ending, sector, current head fragment place and the enlarged drawing of the thumbnail of former JPG picture, and the picture pixels value of next fragment the 1st row of described current head fragment and current head fragment is supplied to described matching module, wherein, the capable line number in described former JPG picture of former JPG picture that described i records for ending, sector, described current head fragment place, i is positive integer, the height of the former JPG picture of 1≤i≤H, H corresponding to current head fragment,
Described matching module, the current head fragment that the next fragment of described current head fragment and described prediction module are sent as the next fragment of current head fragment, and is supplied to described merging module by the difference of the pixel value of next fragment the 1st row of the current head fragment predicted for selecting the pixel value of the 1st row and described prediction module from the non-head set of patches that described fragment obtains and memory module provides minimum non-head fragment together;
Described merging module, next fragment for the current head fragment that provided by described matching module and current head fragment merges, and obtains to described fragment and memory module sends the removal request of being deleted from described non-head set of patches by the next fragment of described current head fragment; In addition, also merge the rear complete JPG picture file obtained for exporting, or the incomplete JPG picture file obtained after adopting merging is replaced current head fragment and the current head fragment after replacement is supplied to described prediction module.
Preferably, pixel value P (the i of the i-th row jth row of the former JPG picture that described prediction module adopts ending, sector, current head fragment place to record, j) pixel value the P ' (i+1 arranged with (i+1) row jth of the enlarged drawing of the thumbnail of former JPG picture, j) the pixel value P (i+1, j) that weighted mean value arranges as next fragment the 1st row jth of current head fragment; Wherein, 1≤j≤W, j is positive integer, the width of the former JPG picture of W corresponding to current head fragment; The weight of pixel value P (i, j) is α i, the weight of pixel value P ' (i+1, j) is β i:
α i = Σ j = 1 W f ( j ) W , i = 2,3 , . . . , H 0 , i = 1 ,
β i = Σ j = 1 W g ( j ) W , i = 1,2 , . . . , H ,
Wherein, f ( j ) = 1 , P ( i , j ) = P ( i - 1 , j ) 0 , P ( i , j ) ≠ P ( i - 1 , j ) , g ( j ) = 1 , P ( i , j ) = P ′ ( i , j ) 0 , P ( i , j ) ≠ P ′ ( i , j ) ; And work as α i+ β iwhen=0, P (i+1, j)=0, and when not having the 1st row Pixel Information of former JPG picture in current head fragment, described prediction module adopts the 1st row pixel of pixel as former JPG picture of enlarged drawing the 1st row of the thumbnail of former JPG picture.
Preferably, described matching module calculates the difference C of the pixel value of next fragment the 1st row of the current head fragment that the pixel value of the 1st row of the n-th non-head fragment in described non-head set of patches and described prediction module are predicted n, and by C 1, C 2..., C nin the minimum non-head fragment corresponding to as the next fragment of current head fragment;
Wherein, n=0,1 ..., N, N are the number of the non-head fragment in described non-head set of patches, Q n(1, j) be the pixel value of the n-th non-head fragment the 1st row jth row in described non-head set of patches, the pixel value of next fragment the 1st row jth row that P (i+1, j) is described current head fragment.
The property that JPG picture fragment reorganization scheme based on thumbnail provided by the invention is created the thumbnail of the Pixel Information of former JPG picture known in head fragment and former JPG picture is combined, utilize existing pictorial information to predict the edge pixels of photo current fragment to the full extent, it is high that the program has accuracy, to recombinate fireballing feature, and regrouping process is without the need to manpower intervention, automaticity is high, solve more existing recombinant techniques due to only with head fragment or only predict edge pixels with thumbnail time, predict the erroneous judgement problem in the JPG picture fragment regrouping process that the error of existence causes in some cases.In addition, provided by the inventionly not only may be used for, in picture fragment recombinant technique, equally also can be used in picture recovery technique based on JPG picture edge pixels Forecasting Methodology involved in the JPG picture fragment reorganization scheme of thumbnail.
Accompanying drawing explanation
Fig. 1 is a kind of JPG picture fragment recombination method process flow diagram based on thumbnail that the embodiment of the present invention provides;
Fig. 2 is a kind of JPG picture fragment reconstruction unit structural representation based on thumbnail that the embodiment of the present invention provides.
Embodiment
For solving the low problem of the JPG picture fragment restructuring accuracy rate that causes due to the limitation of edge pixels matching algorithm in prior art, the embodiment of the present invention provides a kind of new JPG picture fragment reorganization scheme, comprehensively adopts the Pixel Information in the local pixel information of the current former JPG picture got and the thumbnail of former JPG picture to predict the edge pixel (that is: predicting next block fragment of photo current fragment) of photo current fragment in the program.Below in conjunction with accompanying drawing, illustrate the specific embodiment of the invention.
A kind of JPG picture fragment recombination method process flow diagram based on thumbnail that Fig. 1 provides for the embodiment of the present invention, the method comprises the following steps:
S1: the head according to JPG picture is signed, and obtains the head fragment of JPG picture and form head set of patches from storage medium to be restored, obtains the non-head fragment of JPG picture from storage medium to be restored simultaneously and forms non-head set of patches.
Wherein, because the first two byte of JPG picture file 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 searches for head signature on storage medium to be restored---and one or two bytes are 0xFFD8 and three nybbles are 0xFFE0, 0xFFE1, 0xFFE2, 0xFFE8, 0xFFEB, 0xFFEE, 0xFFFE, 0xFFC4, the fragment of any one form in 0XFFDB, it can be used as JPG picture header fragment and form head set of patches, and storage medium to be restored will not have the head signature fragment of JPG picture as non-head fragment, composition non-head set of patches.
S2: judge that head set of patches or non-head set of patches are empty set? if then process ends, otherwise continue to perform S3.
S3: appoint from described head set of patches and get a head fragment and got head fragment is deleted from head set of patches; The thumbnail of the former JPG picture corresponding to current head fragment is obtained from current head fragment, and according to the size information of the former JPG picture recorded in current head fragment, the thumbnail of the former JPG picture corresponding to current head fragment is zoomed into the picture with former JPG picture formed objects, obtain the enlarged drawing of the thumbnail of the former JPG picture corresponding to current head fragment.
S4: the picture pixels value of next fragment the 1st row of the pixel value prediction current head fragment of (i+1) row of the pixel value of former JPG picture i-th row recorded according to ending, sector, current head fragment place and the enlarged drawing of the thumbnail of former JPG picture.Wherein, the capable line number in described former JPG picture of former JPG picture that i records for ending, sector, current head fragment place, i is positive integer, the height of the former JPG picture of 1≤i≤H, H corresponding to current head fragment.In this step, when there is no the Pixel Information of the 1st row of former JPG picture in current head fragment, with the pixel value of enlarged drawing the 1st row of the thumbnail of the former JPG picture pixel value as former JPG picture the 1st row.
S5: the minimum non-head fragment of the difference of the pixel value of next fragment the 1st row of the current head fragment selecting the pixel value of the 1st row and previous step to predict in non-head set of patches is as the next fragment of current head fragment.
S6: the next fragment of current head fragment and current head fragment is merged, and the next fragment of current head fragment is deleted from non-head set of patches.Particularly, the merging in this step refers to and the next fragment of current head fragment is connected to current head fragment end.
S7: judge the next fragment of current head fragment and current head fragment merge after the file that obtains be a complete JPG picture file? if so, then S8 is performed; Otherwise, skip to and perform S9.
In step S7, particularly, whether latter two byte judging the file obtained after the next fragment of current head fragment and current head fragment merges is 0xFFD9 (end-of-file of JPG picture identifies), if so, the file obtained after then proving merging is a complete JPG picture file.
S8: export complete JPG picture file, and return execution S2.
S9: adopt the file obtained after merging to replace current head fragment and return and perform S4.That is: using the file that obtains after merging as current head fragment, adopt above-mentioned flow process to continue as it and mate next fragment till obtaining the complete former JPG picture file corresponding to current head fragment.
Preferably, in flow process shown in Fig. 1, the embodiment of S4 is: definition P (i, the pixel value of the i-th row jth row of the former JPG picture j) recorded for ending, sector, current head fragment place, the pixel value of the i-th row jth row of the enlarged drawing that P ' (i, j) is the thumbnail of former JPG picture, wherein, j is positive integer, the width of the former JPG picture of 1≤j≤W, W corresponding to current head fragment.Because current head fragment is known, the capable line number in described former JPG picture of former JPG picture that i records for ending, sector, current head fragment place, namely in the former JPG picture that current head fragment is corresponding, the i-th row and former image data recover, to predict now the pixel value of (i+1) in former JPG picture row next fragment the 1st row of current head fragment (i.e.), pixel value P (the i of the i-th row jth row of the former JPG picture adopting ending, sector, current head fragment place to record in the embodiment of the present invention, j) pixel value the P ' (i+1 arranged with (i+1) row jth of the enlarged drawing of the thumbnail of former JPG picture, j) the pixel value P (i+1 that weighted mean value arranges as next fragment the 1st row jth of current head fragment, j):
P ( i + , j ) = α i × P ( i , j ) + β i × P ′ ( i + 1 , j ) α i + β i , α i + β i ≠ 0 0 , α i + β i = 0 - - - ( 1 )
In formula (1), the weight of pixel value P (i, j) is α i, for representing the confidence level of removing the pixel value predicting former JPG picture (i+1) row with the pixel value of former JPG picture i-th row; The weight of pixel value P ' (i+1, j) is β i, for representing the confidence level α going the pixel predicting former figure (i+1) row by the pixel that the enlarged drawing (i+1) of the thumbnail of former JPG picture is gone iand β ifollowing formula (2) and (3) are adopted to calculate respectively:
α i = Σ j = 1 W f ( j ) W , i = 2,3 , . . . , H 0 , i = 1 - - - ( 2 )
β i = Σ j = 1 W g ( j ) W , i = 1,2 , . . . , H - - - ( 3 )
In formula (2) and (3):
f ( j ) = 1 , P ( i , j ) = P ( i - 1 , j ) 0 , P ( i , j ) ≠ P ( i - 1 , j ) - - - ( 4 )
g ( j ) = 1 , P ( i , j ) = P ′ ( i , j ) 0 , P ( i , j ) ≠ P ′ ( i , j ) - - - ( 5 )
What deserves to be explained is, as previously mentioned: when there is no the 1st row Pixel Information of former JPG picture in current head fragment, make P (1, j)=P ' (1, j), namely now adopt the pixel of enlarged drawing the 1st row of the thumbnail of former JPG picture as the 1st row pixel of the former JPG picture of prediction.In addition, due to P (0, j) do not exist, therefore make α in formula (2) 1=0, that is: calculate P (2, time j), still adopt the pixel of enlarged drawing the 2nd row of the thumbnail of former JPG picture as the 2nd row pixel of former JPG picture of prediction.
Preferably, the embodiment of above-mentioned steps S5 is:
(1) the difference C of the pixel value of next fragment the 1st row of the current head fragment predicted in the pixel value of each non-head fragment the 1st row in non-head set of patches and step 4 is first calculated n:
C n = Σ j = 1 L | Q n ( 1 , j ) - P ( i + 1 , j ) | - - - ( 6 )
Wherein, n=0,1 ..., N, N are the number of the non-head fragment in described non-head set of patches;
(2) by C 1, C 2..., C nin the minimum non-head fragment corresponding to as the next fragment of current head fragment.
Wherein, P (i+1, j) is calculated by formula (1), is the pixel value of next fragment the 1st row jth row of the current head fragment predicted in step 4, Q n(1, j) be the pixel value of the n-th non-head fragment the 1st row jth row in non-head set of patches.C nvalue less explanation non-head set of patches in the difference of the pixel of next fragment the 1st row of current head fragment predicted of the pixel of the n-th non-head fragment the 1st row and step 4 less, namely next fragment of current head fragment is that the probability of the n-th non-head fragment in non-head set of patches is larger.
Corresponding to the JPG picture fragment recombination method based on thumbnail that the embodiment of the present invention provides, the embodiment of the present invention also provides a kind of JPG picture fragment reconstruction unit based on thumbnail, as shown in Figure 2, this device comprises fragment acquisition and memory module 21, judge module 22, selects module 23, prediction module 24, matching module 25 and merge module 26.
Fragment obtains and memory module 21, sign for the head according to JPG picture, obtain the head fragment of JPG picture from storage medium to be restored and form the storage of head set of patches, obtain the non-head fragment of JPG picture from storage medium to be restored simultaneously and form the storage of non-head set of patches; Fragment acquisition and memory module 21 also for providing described head set of patches and non-head set of patches to judge module 22 and matching module 25, and provide head set of patches to selection module 23; In addition, fragment obtains and the removal request of memory module 21 also for sending according to merging module 26, the next fragment of current head fragment is deleted from non-head set of patches, and new non-head set of patches is resend to judge module 22 and matching module 25.
Judge module 22, for judging whether the head set of patches that fragment acquisition and memory module 21 provide or non-head set of patches are empty set, time if not, notice selects module 23 to carry out the selection of head fragment.
Select module 23, select notice for the head fragment sent according to judge module 22, appoint from the head set of patches that fragment obtains and memory module 21 provides and get a head fragment and got head fragment is deleted from described head set of patches; And from current head fragment, obtain the thumbnail of former JPG picture, according to the size information of the former JPG picture recorded in current head fragment, the thumbnail of former JPG picture is zoomed into the picture with former JPG picture formed objects, and the enlarged drawing of the thumbnail of current head fragment and former JPG picture is supplied to prediction module 24.
Prediction module 24, for receiving the enlarged drawing of the thumbnail of the current head fragment selecting module 23 or merging module 26 to provide and the former JPG picture selecting module 23 to provide, the picture pixels value of next fragment the 1st row of the pixel value prediction current head fragment of (i+1) row of the pixel value of former JPG picture i-th row recorded according to ending, sector, current head fragment place and the enlarged drawing of the thumbnail of former JPG picture, and the picture pixels value of next fragment the 1st row of current head fragment and current head fragment is supplied to coupling mould 25; Wherein, the capable line number in described former JPG picture of former JPG picture that described i records for ending, sector, current head fragment place, 1≤i≤H, i is positive integer, the height of the former JPG picture of H corresponding to current head fragment.
Matching module 25, for the next fragment of the minimum non-head fragment of the difference of the pixel value obtaining and select in the non-head set of patches that provides of memory module 21 next fragment the 1st row of the current head fragment that the pixel value of the 1st row and prediction module 24 are predicted from fragment as current head fragment, and the current head fragment that the next fragment of current head fragment and prediction module 24 are sent is supplied to together merging module 26.
Merge module 26, next fragment for the current head fragment that provided by matching module 25 and current head fragment merges, and obtains to fragment and memory module 21 sends the removal request of being deleted from non-head set of patches by the next fragment of current head fragment; In addition, merge module 26 and also merge the rear complete JPG picture file obtained for exporting, or the incomplete JPG picture file obtained after adopting merging is replaced current head fragment and the current head fragment after replacement is supplied to prediction module 24.
Preferably, pixel value P (the i of the i-th row jth row of the former JPG picture that prediction module 24 adopts ending, sector, current head fragment place to record, j) pixel value the P ' (i+1 arranged with (i+1) row jth of the enlarged drawing of the thumbnail of former JPG picture, j) the pixel value P (i+1, j) that weighted mean value arranges as next fragment the 1st row jth of current head fragment; Wherein, 1≤j≤W, j is positive integer, the width of the former JPG picture of W corresponding to current head fragment; The weight of pixel value P (i, j) is α i, the weight of pixel value P ' (i+1, j) is β i, α iand β iadopt described formula (2) and (3) above to calculate respectively, much more no longer to explain herein.
Preferably, matching module 25 calculates the difference C of the pixel value of next fragment the 1st row of the current head fragment that the pixel value of the 1st row of the n-th non-head fragment in non-head set of patches and prediction module 24 are predicted n, and by C 1, C 2..., C nin the minimum non-head fragment corresponding to as the next fragment of current head fragment; Wherein, C nthered is provided formula (6) is adopted to calculate above.
The property that picture fragment reorganization scheme based on thumbnail provided by the invention is created the thumbnail of the Pixel Information of former JPG picture known in head fragment and former JPG picture is combined, utilize existing pictorial information to predict the edge pixels of photo current fragment to the full extent, it is high that the program has accuracy, to recombinate fireballing feature, and regrouping process is without the need to manpower intervention, automaticity is high, solve more existing recombinant techniques due to only with head fragment or only predict edge pixels with thumbnail time, predict the erroneous judgement problem in the JPG picture fragment regrouping process that the error of existence causes in some cases.In addition, provided by the inventionly not only may be used for, in picture fragment recombinant technique, equally also can be used in picture recovery technique based on picture edge pixels Forecasting Methodology involved in the picture fragment reorganization scheme of thumbnail.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (8)

1., based on a JPG picture fragment recombination method for thumbnail, it is characterized in that, comprising:
Step 1: the head according to JPG picture is signed, obtain the head fragment of JPG picture from storage medium to be restored and form head set of patches, obtain the non-head fragment of JPG picture from described storage medium to be restored simultaneously and form non-head set of patches;
Step 2: judge that described head set of patches or described non-head set of patches are empty set? if then process ends, otherwise continue to perform step 3;
Step 3: appoint from described head set of patches and get a head fragment and got head fragment is deleted from described head set of patches; The thumbnail of former JPG picture is obtained from current head fragment, and according to the size information of the former JPG picture recorded in current head fragment, the thumbnail of described former JPG picture is zoomed into the picture with described former JPG picture formed objects, obtain the enlarged drawing of the thumbnail of former JPG picture;
Step 4: the picture pixels value of next fragment the 1st row of the pixel value prediction current head fragment of (i+1) row of the pixel value of former JPG picture i-th row recorded according to ending, sector, current head fragment place and the enlarged drawing of the thumbnail of former JPG picture; Wherein, the capable line number in described former JPG picture of former JPG picture that described i records for ending, sector, current head fragment place, 1≤i≤H, i is positive integer, the height of the former JPG picture of H corresponding to current head fragment;
Step 5: the minimum non-head fragment of the difference of the pixel value of next fragment the 1st row of the current head fragment selecting the pixel value of the 1st row and previous step to predict in described non-head set of patches is as the next fragment of current head fragment;
Step 6: the next fragment of current head fragment and current head fragment is merged, and the next fragment of described current head fragment is deleted from described non-head set of patches; Judge the next fragment of current head fragment and current head fragment merge after the file that obtains be a complete JPG picture file? if so, then export described complete JPG picture file, and return execution step 2; Otherwise, adopt the file obtained after merging to replace current head fragment and return and perform step 4.
2. a kind of JPG picture fragment recombination method based on thumbnail as claimed in claim 1, it is characterized in that, the picture pixels value of next fragment the 1st row of the pixel value prediction current head fragment of (i+1) row of the pixel value of former JPG picture i-th row recorded according to ending, sector, current head fragment place described in step 4 and the enlarged drawing of the thumbnail of former JPG picture, comprising:
Pixel value P (the i of the i-th row jth row of the former JPG picture adopting ending, sector, current head fragment place to record, j) pixel value the P ' (i+1 arranged with (i+1) row jth of the enlarged drawing of the thumbnail of former JPG picture, j) the pixel value P (i+1, j) that weighted mean value arranges as next fragment the 1st row jth of current head fragment;
Wherein, 1≤j≤W, j is positive integer, the width of the former JPG picture of W corresponding to current head fragment; The weight of pixel value P (i, j) is α i, the weight of pixel value P ' (i+1, j) is β i, α iand β icomputing method be:
α i = Σ j = 1 W f ( j ) W , i = 2,3 , . . . , H 0 , i = 1 ,
β i = Σ j = 1 W g ( j ) W , i = 1,2 , . . . , H ,
Wherein, f ( j ) = 1 , P ( i , j ) = P ( i - 1 , j ) 0 , P ( i , j ) ≠ P ( i - 1 , j ) , g ( j ) = 1 , P ( i , j ) = P ′ ( i , j ) 0 , P ( i , j ) ≠ P ′ ( i , j ) ; And work as α i+ β iwhen=0, P (i+1, j)=0.
3. a kind of JPG picture fragment recombination method based on thumbnail as claimed in claim 2, it is characterized in that, when there is no the 1st row Pixel Information of former JPG picture in described current head fragment, be the pixel of former JPG picture the 1st row by the pixel prediction of enlarged drawing the 1st row of the thumbnail of the former JPG picture corresponding to current head fragment.
4. a kind of JPG picture fragment recombination method based on thumbnail as claimed in claim 3, it is characterized in that, the minimum non-head fragment of the difference of the pixel value of next fragment the 1st row of the current head fragment selecting the pixel value of the 1st row and previous step to predict described in step 5 in described non-head set of patches, as the next fragment of current head fragment, comprising:
Calculate the difference C of the pixel value of next fragment the 1st row of the current head fragment predicted in the pixel value of the 1st row of the n-th non-head fragment in described non-head set of patches and step 4 n: wherein, n=0,1 ..., N, N are the number of the non-head fragment in described non-head set of patches, Q n(1, j) be the pixel value of the n-th non-head fragment the 1st row jth row in described non-head set of patches, the pixel value of next fragment the 1st row jth row that P (i+1, j) is described current head fragment;
By C 1, C 2..., C nin the minimum non-head fragment corresponding to as the next fragment of current head fragment.
5. a kind of JPG picture fragment recombination method based on thumbnail as described in any one of Claims 1-4, it is characterized in that, judge described in step 6 the next fragment of current head fragment and current head fragment merge after the file that obtains be whether a complete JPG picture file, comprising:
Does is latter two byte judging the file obtained after merging 0xFFD9? if so, the file then obtained after described merging is a complete JPG picture file, otherwise the file obtained after described merging is not a complete JPG picture file.
6. based on a JPG picture fragment reconstruction unit for thumbnail, it is characterized in that, comprise fragment and obtain and memory module, judge module, selection module, prediction module, matching module and merging module;
Described fragment obtains and memory module, sign for the head according to JPG picture, obtain the head fragment of JPG picture from storage medium to be restored and form the storage of head set of patches, obtain the non-head fragment of JPG picture from described storage medium to be restored simultaneously and form the storage of non-head set of patches; Also for providing described head set of patches and non-head set of patches to described judge module and matching module, and provide described head set of patches to described selection module; In addition, described fragment acquisition and memory module are also for the removal request according to described merging module, the next fragment of current head fragment is deleted from described non-head set of patches, and new non-head set of patches is resend to described judge module and matching module;
Described judge module, for judging whether the head set of patches that the acquisition of described fragment and memory module provide or described non-head set of patches are empty set, time if not, notify that described selection module carries out the selection of head fragment;
Described selection module, head fragment for sending according to described judge module selects notice, appoints and get a head fragment and deleted from described head set of patches by got head fragment from the head set of patches that described fragment obtains and memory module provides; And from current head fragment, obtain the thumbnail of former JPG picture, according to the size information of the former JPG picture recorded in current head fragment, the thumbnail of described former JPG picture is zoomed into the picture with described former JPG picture formed objects, and the enlarged drawing of the thumbnail of current head fragment and former JPG picture is supplied to described prediction module;
Described prediction module, for receiving described selection module or merging the enlarged drawing of thumbnail of the former JPG picture that the current head fragment that provides of module and described selection module provide, the picture pixels value of next fragment the 1st row of the pixel value prediction current head fragment of (i+1) row of the pixel value of former JPG picture i-th row recorded according to ending, sector, current head fragment place and the enlarged drawing of the thumbnail of former JPG picture, and the picture pixels value of next fragment the 1st row of described current head fragment and current head fragment is supplied to described matching module, wherein, the capable line number in described former JPG picture of former JPG picture that described i records for ending, sector, described current head fragment place, i is positive integer, the height of the former JPG picture of 1≤i≤H, H corresponding to current head fragment,
Described matching module, the current head fragment that the next fragment of described current head fragment and described prediction module are sent as the next fragment of current head fragment, and is supplied to described merging module by the difference of the pixel value of next fragment the 1st row of the current head fragment predicted for selecting the pixel value of the 1st row and described prediction module from the non-head set of patches that described fragment obtains and memory module provides minimum non-head fragment together;
Described merging module, next fragment for the current head fragment that provided by described matching module and current head fragment merges, and obtains to described fragment and memory module sends the removal request of being deleted from described non-head set of patches by the next fragment of described current head fragment; In addition, also merge the rear complete JPG picture file obtained for exporting, or the incomplete JPG picture file obtained after adopting merging is replaced current head fragment and the current head fragment after replacement is supplied to described prediction module.
7. a kind of JPG picture fragment reconstruction unit based on thumbnail as claimed in claim 6, it is characterized in that, pixel value P (the i of the i-th row jth row of the former JPG picture that described prediction module adopts ending, sector, current head fragment place to record, j) pixel value the P ' (i+1 arranged with (i+1) row jth of the enlarged drawing of the thumbnail of former JPG picture, j) the pixel value P (i+1, j) that weighted mean value arranges as next fragment the 1st row jth of current head fragment; Wherein, 1≤j≤W, j is positive integer, the width of the former JPG picture of W corresponding to current head fragment; The weight of pixel value P (i, j) is α i, the weight of pixel value P ' (i+1, j) is β i:
α i = Σ j = 1 W f ( j ) W , i = 2,3 , . . . , H 0 , i = 1 ,
β i = Σ j = 1 W g ( j ) W , i = 1,2 , . . . , H ,
Wherein, f ( j ) = 1 , P ( i , j ) = P ( i - 1 , j ) 0 , P ( i , j ) ≠ P ( i - 1 , j ) , g ( j ) = 1 , P ( i , j ) = P ′ ( i , j ) 0 , P ( i , j ) ≠ P ′ ( i , j ) ; And work as α i+ β iwhen=0, P (i+1, j)=0, and when not having the 1st row Pixel Information of former JPG picture in current head fragment, described prediction module adopts the 1st row pixel of pixel as former JPG picture of enlarged drawing the 1st row of the thumbnail of former JPG picture.
8. a kind of JPG picture fragment reconstruction unit based on thumbnail as claimed in claim 7, it is characterized in that, described matching module calculates the difference C of the pixel value of next fragment the 1st row of the current head fragment that the pixel value of the 1st row of the n-th non-head fragment in described non-head set of patches and described prediction module are predicted n, and by C 1, C 2..., C nin the minimum non-head fragment corresponding to as the next fragment of current head fragment;
Wherein, n=0,1 ..., N, N are the number of the non-head fragment in described non-head set of patches, Q n(1, j) be the pixel value of the n-th non-head fragment the 1st row jth row in described non-head set of patches, the pixel value of next fragment the 1st row jth row that P (i+1, j) is described current head fragment.
CN201210277280.1A 2012-08-06 2012-08-06 Method and device for reassembling joint photographic experts group (JPG) picture fragments based on thumbnail Active CN102890818B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210277280.1A CN102890818B (en) 2012-08-06 2012-08-06 Method and device for reassembling joint photographic experts group (JPG) picture fragments based on thumbnail

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210277280.1A CN102890818B (en) 2012-08-06 2012-08-06 Method and device for reassembling joint photographic experts group (JPG) picture fragments based on thumbnail

Publications (2)

Publication Number Publication Date
CN102890818A CN102890818A (en) 2013-01-23
CN102890818B true CN102890818B (en) 2015-06-17

Family

ID=47534312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210277280.1A Active CN102890818B (en) 2012-08-06 2012-08-06 Method and device for reassembling joint photographic experts group (JPG) picture fragments based on thumbnail

Country Status (1)

Country Link
CN (1) CN102890818B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3093851B1 (en) * 2015-05-11 2017-11-08 Micro Systemation AB Method and device for use when reassembling a fragmented jpeg image
CN105068885B (en) * 2015-07-27 2018-02-27 四川效率源信息安全技术股份有限公司 A kind of JPG fragments file access pattern and the method for restructuring
CN107132959A (en) * 2016-02-29 2017-09-05 四川效率源信息安全技术股份有限公司 A kind of wrong method of quick amendment fragment picture restructuring result
CN109584163B (en) * 2018-12-17 2020-12-08 深圳市华星光电半导体显示技术有限公司 Method for restoring original file of paper scrap
CN111223154B (en) * 2019-11-20 2022-12-06 厦门市美亚柏科信息股份有限公司 JPG picture fragment recombination method, terminal equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1617568A (en) * 1999-12-20 2005-05-18 宾杰·威布股份株式会社 Compressing and restoring method of image data

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1617568A (en) * 1999-12-20 2005-05-18 宾杰·威布股份株式会社 Compressing and restoring method of image data

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Automated Reassembly of File Fragmented Images Using Greedy Algorithms;Nasir Memon;《IEEE TRANSACTIONS ON IMAGE PROCESSING》;20060228;第15卷(第2期);385-393 *
File Fragment Classification—The Case for Specialized Approaches;Vassil Roussev;《2009 Fourth IEEE International Workshop on Systematic Approaches to Digital Forensic Engineering》;20090531;3-14 *
基于差异度的JPEG碎片重组方法;肖 腾;《计算机工程》;20110531;第37卷(第10期);263-265 *

Also Published As

Publication number Publication date
CN102890818A (en) 2013-01-23

Similar Documents

Publication Publication Date Title
CN102890818B (en) Method and device for reassembling joint photographic experts group (JPG) picture fragments based on thumbnail
AU2016332947B2 (en) Semi-automatic labelling of datasets
KR102169242B1 (en) Machine Learning Method for Restoring Super-Resolution Image
CN102682024B (en) Method for recombining incomplete JPEG file fragmentation
US20110270851A1 (en) Method, device, and program for determining similarity between documents
CN102695040B (en) Parallel high definition video vehicle detection method based on GPU
CN105975939A (en) Video detection method and device
CN102750689A (en) Image processing apparatus and control method thereof
CN104484886A (en) Segmentation method and device for MR image
CN114999637B (en) Pathological image diagnosis method and system based on multi-angle coding and embedded mutual learning
CN102831585B (en) Image fragment restoration method and image fragment restoration device
CN112036265A (en) Road construction progress tracking method, device, equipment and storage medium
CN102509257B (en) Human visual characteristic compressive sensing-based grayscale image tampering and detection method
Miao et al. Deep learning‐based evaluation for mechanical property degradation of seismically damaged RC columns
CN102622302B (en) Recognition method for fragment data type
CN117056863B (en) Big data processing method based on multi-mode data fusion
CN116309459A (en) Improved network-based lung nodule detection method, apparatus, device and storage medium
CN115147426B (en) Model training and image segmentation method and system based on semi-supervised learning
JP5884597B2 (en) Form image management system, form image management method, and program
CN110768864A (en) Method and device for generating images in batches through network traffic
CN115909241A (en) Lane line detection method, system, electronic device and storage medium
CN115546274A (en) Image depth judgment model, and construction method, device and application thereof
CN108965906A (en) A kind of video storage method based on cloud storage service device
CN104394412A (en) Conversion compression based maximum error image compression method
JP2012095231A (en) Form image management system, form image management method, and program

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