Summary of the invention
The invention provides a kind of method and terminal of automatically filling in document with fixed format, in order to the very inconvenient problem of mode that solves existing filling in document with fixed format.
Method of the present invention comprises the following steps: obtaining step: the image file that obtains document with fixed format; Identification step: identification and the relative position of recording key in image file; Coupling step: will wait that the information of inserting and described key word mate; Scheme the stacked step that adds:, information to be inserted is write the relative position of key word in image file that is complementary with it by scheming stacked adding.
Further, also comprise before the identification step: according to default form input information to be inserted, every information to be inserted comprises key word and the content corresponding with this key word.
Also comprise in the obtaining step: after obtaining the image file of document with fixed format, it is schemed layer as a setting; Also comprise before the identification step after the obtaining step: duplicate Background From Layer as the foreground picture layer, in order to identification; Also comprise before mating step after the identification step: be made as the foreground picture layer transparent.
Scheming the stacked step that adds specifically comprises: according to the relative position of key word in image file that is complementary with information to be inserted, information editing to be inserted is gone into the foreground picture layer; Foreground picture layer behind the editor and Background From Layer stack are synthesized an image file.
Scheming the stacked step that adds also comprises afterwards: export described through scheming the stacked synthetic image file that adds.
Terminal of the present invention comprises: acquiring unit is used to obtain the image file of document with fixed format; Recognition unit, be used for discerning and recording key at the relative position of image file; Matching unit is used for and will waits that the information of inserting and described key word mate; Graphics processing unit is used for information to be inserted being write the relative position of key word in image file that is complementary with it by scheming stacked adding.
Further, also comprise: input block, be used for according to default form input information to be inserted, every information to be inserted comprises key word and the content corresponding with this key word.
Graphics processing unit also is used for after acquiring unit obtains the image file of document with fixed format it being treated to Background From Layer; Duplicate Background From Layer as the foreground picture layer, in order to recognition unit identification; And behind the recognition unit complete operation, be made as the foreground picture layer transparent.
The graphics processing unit concrete operations are as follows: according to the relative position of key word in image file that is complementary with information to be inserted, information editing to be inserted is gone into the foreground picture layer; And the stack of the foreground picture layer after will editing and Background From Layer synthesizes an image file.
Also comprise: output unit is used to export described through scheming the stacked synthetic image file that adds.
Beneficial effect of the present invention is as follows:
Because the inventive method comprises obtaining step, identification step, coupling step and schemes the stacked step that adds, corresponding terminal of the present invention comprises acquiring unit, recognition unit, matching unit and graphics processing unit, therefore based on Flame Image Process, literal identification, the stacked technology that adds of figure, can realize automatically filling in document with fixed format, thereby solve the very inconvenient problem of mode of existing filling in document with fixed format.
Embodiment
In order to make the file of filling in set form more convenient, main thought of the present invention is to utilize image processing techniques, character recognition technology and scheme the stacked technology that adds, and realizes filling in automatically of document with fixed format.Below further specifically describe by some embodiment.
Embodiment 1, referring to shown in Figure 1, present embodiment comprises the following steps:
S1, obtain the image file of document with fixed format.
S2, identification and the relative position of recording key in image file.
S3, will wait to insert information and key word mates.
S4, by scheming stacked adding, information to be inserted is write the relative position of key word in image file that is complementary with it.
Embodiment 2, referring to shown in Figure 2, present embodiment comprises: acquiring unit, recognition unit, matching unit and graphics processing unit.Wherein,
Acquiring unit is used to obtain the image file of document with fixed format.
Recognition unit, be used for discerning and recording key at the relative position of image file.
Matching unit is used for inserting information with waiting and key word mates.
Graphics processing unit is used for information to be inserted being write the relative position of key word in image file that is complementary with it by scheming stacked adding.
Embodiment 3, the present invention are preferably applied to the communications field, particularly utilize shooting mobile phone to realize automatically filling in document with fixed format.
Along with the renewal day by day of mobile phone technique, camera has become a standard configuration of mobile phone, and the camera of high pixel is slowly universal in mobile phone, and this also makes the user be more prone to obtain a clear and legible picture.Present stage, chip technology was ripe day by day, had the life that mobile phone that more high processing rate and figure association handle has also slowly entered people, and these The Application of Technology have improved people's work efficiency, have made things convenient for people's learning life.The mobile phone of present stage has all been realized camera function, and camera develops into 2,000,000,3,000,000 even 5,000,000 pixels by 300,000 initial pixels, and the realization of high pixel can show scenery fully.The mobile phone main flow adopts 2,000,000 or 3,000,000 pixel camera heads at present, 2,000,000 can take the picture of 1600*1200 size, 3,000,000 then can take the picture of 2048*1536 size, the camera of these pixels can show A4 size even littler picture or the details of form fully clearly, and the adding of macro function simultaneously more literal identification, the Flame Image Process of mobile phone cam provides technical guarantee.Present embodiment is an example with the mobile phone of 3,000,000 cameras (being acquiring unit) that have macro function, this mobile phone inside also should have recognition unit, matching unit, graphics processing unit, input block and output unit simultaneously, and wherein graphics processing unit can be realized by hardware graphics coprocessor or software approach.
At first, the input block of use mobile phone will be used Back ground Information always and preserve by the certain format input handset, preserve as information such as general information name, sex, age, work unit, phone being entered into mobile phone according to pre-set form, form can be " key word: content ", wherein key word is used for mating with true form data, content will be gone in the picture by the coupling postedit, for example according to the following name of importing: Li Ming, age: 25, sex: man etc.
Secondly, use mobile phone driving camera is with maximum pixel and adopt macro mode that blank form is taken pictures, thereby obtains the image file of document with fixed format.Whether the concrete handset displays equipment that passes through is observed with the complete shooting of form, require form to be in the picture center simultaneously, and occupy the space of picture 50%-90% at least, be stored in the mobile phone EMS memory with picture JPG (referring to Fig. 3) form taking good photo, this picture comprises literal and form image information.
Once more, utilize graphics processing unit that the picture after preserving is handled, adopt the picture after graphics processing unit will be preserved to be treated to Background From Layer (referring to Fig. 4), be temporary in the mobile phone, information in the Background From Layer is consistent with the actual table fileinfo, comprises blank form intrinsic literal 1 and tabular drawing as 2 information.
Afterwards, utilizing graphics processing unit is that foreground picture layer (referring to Fig. 5) is duplicated on the basis with the Background From Layer, and foreground picture layer size is consistent with Background From Layer.Simultaneously, utilize recognition unit to adopt recognition technology that foreground picture layer Chinese words and Figure recognition are handled, be partitioned into form Chinese words and image information, for example, calculate the relative position of this type of Word message at view picture figure layer with storage separately after the information Recognition such as name, sex in the form.After the relative position storage, by the Word message deletion of graphics processing unit, only keep image information, and other information except that the form image information all are compiled as Transparent color (RGB 0:0:0) the foreground picture layer, be temporary in the mobile phone.
Thereafter, utilize matching unit to mate by the key word of character recognition technology to literal in the picture and input information, the content 3 with input information after the coupling is a reference position with the relative position, is offset 3-5 character lattice number backward and enrolls the foreground picture layer.Foreground picture layer (Fig. 5) after utilizing that graphics processing unit employing figure is stacked again and adding technology and will edit is synthetic with Background From Layer (Fig. 4), image after the stack is stored in mobile phone with picture JPG form (Fig. 6), and this picture promptly is by original table lattice information and the synthetic complete form Image of preset information.
At last, can utilize output unit, for example by output print, with complete form Image on request size print promptly to get and fill in complete form made of paper.
Implementation column 4, this example are that example is handled with the lertter of introduction file.Mobile phone still adopts the software and hardware configuration among the embodiment 3.
At first use the keyboard of mobile phone or touch-screen with name, information typing mobile phones such as sex and date are preserved, and adopt pre-set form to carry out, and form can be key word: content.As be input as name: Li Ming, time: on August 8th, 2009.
Use mobile phone driving camera is with maximum pixel and adopt macro mode that blank lertter of introduction file is taken pictures, whether observe with the complete shooting of lertter of introduction file by handset displays equipment, the whole space of a whole page of demand file is in the picture center simultaneously, and occupy the space of picture 50%-90% at least, be stored in the mobile phone EMS memory with picture JPG (referring to Fig. 7) form taking good photo, this picture comprises literal and fixed layout image information.
Utilize graphics processing unit that the picture after preserving is handled, adopt the picture after graphics processing unit will be preserved to be treated to Background From Layer (referring to Fig. 8), be temporary in the mobile phone, the information in the Background From Layer is consistent with actual file information, comprises literal and fixed layout image information.
Utilizing graphics processing unit is that the foreground picture layer is duplicated on the basis with the Background From Layer, foreground picture layer size is consistent with Background From Layer, adopt recognition technology that key word in the foreground picture layer is discerned simultaneously, for example to comrade in the file, similar speech such as Xian Sheng Mrs are discerned, calculate the relative position of this type of Word message simultaneously at view picture figure layer, relative position storage back is compiled as Transparent color (RGB 0:0:0) by graphics processing unit with the foreground picture layer, be temporary in the mobile phone, in this example " comrade " reached and discern and calculate relative position by " year " " moon " " day ".
Mate by the key word of character recognition technology to literal in the picture and input information, the content with input information is reference position with the relative position then, is offset 2-4 character lattice number forward and enrolls the foreground picture layer.The key word that need mate in the present embodiment is respectively " comrade " and " name " of entry information in the picture, and " year " " moon " " day " of " year " " moon " " day " in the picture and entry information, after the coupling content information " Li Ming " is offset 2 characters forward with respect to " comrade " and inserts the foreground picture layer, foreground picture layer (referring to Fig. 9) is inserted with respect to 2 characters of " year " " moon " " day " skew in " 2009 " " 8 " " 8 "; The foreground picture layer (referring to Fig. 9) that employing figure is stacked after adding technology and will editing is synthetic with Background From Layer (referring to Fig. 8), image after the stack is stored in mobile phone with picture JPG form (referring to Figure 10), and this picture promptly is by original file information and the synthetic complete file picture of preset information.
Afterwards, can be by output print, with the big or small on request printout of complete lertter of introduction file.
To sum up, because the inventive method comprises obtaining step, identification step, coupling step and schemes the stacked step that adds, corresponding terminal of the present invention comprises acquiring unit, recognition unit, matching unit and graphics processing unit, therefore based on Flame Image Process, literal identification, the stacked technology that adds of figure, can realize automatically filling in document with fixed format, thereby solve the very inconvenient problem of mode of existing filling in document with fixed format.
Particularly be applied to the communications field, can take pictures to blank document with fixed format by mobile phone cam and handle the also complete picture format that saves as, by the character recognition function extract fill substance key word and with preset the content key word and mate, preset content and can be Back ground Informations such as name, sex, age, coupling back will be preset content and write the picture relevant position and obtain filling in the complete document with fixed format in back by being schemed the stacked technology that adds, with this picture on request output print get final product to such an extent that fill in complete file made of paper.