CN101562694B - Method for realizing functions of character extraction and automatic translation of digital camera - Google Patents

Method for realizing functions of character extraction and automatic translation of digital camera Download PDF

Info

Publication number
CN101562694B
CN101562694B CN2009100690275A CN200910069027A CN101562694B CN 101562694 B CN101562694 B CN 101562694B CN 2009100690275 A CN2009100690275 A CN 2009100690275A CN 200910069027 A CN200910069027 A CN 200910069027A CN 101562694 B CN101562694 B CN 101562694B
Authority
CN
China
Prior art keywords
picture
literal
gray
pixel
value
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.)
Expired - Fee Related
Application number
CN2009100690275A
Other languages
Chinese (zh)
Other versions
CN101562694A (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.)
Tianjin Samsung Electronics Co Ltd
Original Assignee
Tianjin Samsung Electronics 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 Tianjin Samsung Electronics Co Ltd filed Critical Tianjin Samsung Electronics Co Ltd
Priority to CN2009100690275A priority Critical patent/CN101562694B/en
Publication of CN101562694A publication Critical patent/CN101562694A/en
Application granted granted Critical
Publication of CN101562694B publication Critical patent/CN101562694B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to a method for realizing the functions of character extraction and automatic translation of a digital camera. The method generates a picture by taking a picture of characters, extracts the characters through image processing technology, generates a text file, uses a translation algorithm to translate the section of the characters into Chinese, and displays the translated result on an LCD. The method comprises the following steps: firstly, setting the camera into a translation mode according a corresponding item in a menu; secondly, taking the photo of the characters; thirdly, automatically using a character extraction algorithm to extract the characters and generating the text file by the camera; fourthly, automatically utilizing the prior translation algorithm to translate the characters by the camera; and fifthly, displaying the translated result on the LCD. The method can directly utilize the prior hardware resource of the digital camera, does not need to add any hardware cost, makes the digital camera have the functions of character extraction and automatic translation, and can bring convenience for users.

Description

Realize that the digital camera literal extracts and the method for automatic translation function
Technical field
The present invention relates to realize the method for digital camera functionality, particularly a kind of method that realizes extraction of digital camera literal and automatic translation function.
Background technology
At present, along with the continuous development of science and technology, though the function of digital camera, does not still have the digital camera that the band literal extracted and translated automatically additional function on the market in continuous increase.
For example, when seeing foreign language books, or when out on tours, see foreign language information.Just can not know wherein the meaning for the people who is ignorant of foreign language, if look into then too time-consuming with dictionary.If adopt to have literal and extract and the automatic translation function digital camera, just can take pictures to foreign language information literal, and according to specific algorithm clapping to such an extent that extract literal in the picture, utilize translation algorithm Chinese then this section character translation one-tenth.
Therefore, providing a kind of and realize that the digital camera literal extracts and the method for automatic translation function, is one of the problem that need research and solve of this field scientific research technical staff.
Summary of the invention
The objective of the invention is to overcome above-mentioned weak point, a kind of method of developing the new function of digital camera is provided, realize that promptly the digital camera literal extracts and the method for automatic translation function.
Implementation of the present invention is as follows for achieving the above object: a kind of method that realizes extraction of digital camera literal and automatic translation function is characterized in that implementation step is as follows:
Step 1: in menu,, camera is arranged to interpretive scheme by corresponding entry;
Step 2: literal is taken pictures;
Step 3: camera carries out the literal extraction from employing the literal extraction algorithm, and generates text;
Described literal extraction algorithm is as follows:
At first, literal is taken, comprised literal and background dichromatism in the picture usually;
(1) will carry out gray processing to coloured image handles; The human color sense light characteristic that draws according to psychological study, and consider the speed calculated to adopt following formula, to press from left to right, order is from top to bottom carried out the gray processing processing to each pixel:
Y=(29×R+587×G+114×B+500)/1000;
Wherein, R, G, B are respectively R, G, the B values of this pixel; So just coloured image is converted into gray level image;
(2) gray level image that obtains is carried out binary conversion treatment; At first determine a threshold value, gray value all is changed to 255 greater than the some gray value of this threshold value, and gray value all is changed to 0 less than the some gray value of this threshold value; This threshold alpha obtains by following formula:
α=all pixel gray scale sum/pixel numbers;
By from left to right, order from top to bottom scans each pixel of image then, when this gray value Y 〉=α, and Y=255; When Y<α, Y=0;
(3) relatively Y value be 0 and Y value be the number of 255 pixel, what number was many is the background dot set, what number was few is that literal point is gathered; If the background dot gray scale is 255, then putting the background dot gray scale is 0, and literal point gray scale is 255; Guarantee that literal point gray scale is always 255;
(4) the binaryzation picture that obtains being carried out literal extracts; The method of extracting is to adopt following algorithm:
(4.1) establishing an indexed variable i, and be changed to 0, picture is lined by line scan, is 255 point if this delegation does not have gray value, checks indexed variable, and indexed variable is 0, then scans next line; Be 1, then write down this journey h i, and to put indexed variable be 0; If it is 255 point that gray value is arranged, check indexed variable; If 0, row number is noted, putting indexed variable is 1; If being 1, indexed variable continues next line scanning;
(4.2) establish an indexed variable j, and be changed to 0, all are had the row of record, in turn two the row h iAnd h I-1Between carry out column scan; If the row of current scanning number are l kIf the no gray scale of these row is 255 point, check j, if j==0 then scans next column; J=1 writes down two tuple (h i, l k), and make j=0; If it is 255 point that gray value is arranged, check j, if j=0 then writes down two tuple (h I-1, l k), and make j=1; If j==1 then continues the scanning next column;
(4.3) the adjacent in turn two point (h that obtain in the step (4.2) I-1, l m), (h i, l n) rectangular area that surrounded is exactly a letter zone, an alphabetical regional ensemble is just formed in all these zones; Because the time need use the standard alphabet template picture that is stored in advance in the camera in identification, and picture size is 20*20, so will change into each alphabetical geographic norms the zone of a 20*20 size; The method of standard is: establishing the zone for the treatment of standard is the m*n size, and (i j), makes p=round (i/m*20), and q=rounds (j/m*20) for one of them pixel; A newly-built 20*20 picture makes in the newly-built picture that (p, gray value q) treat that (all the other some gray values all are changed to 0 in the newly-built picture for i, gray value j) in the zone of standard; So just the m*n zone is converted to the 20*20 zone;
(4.4) picture and template picture after the conversion are compared, and then identify letter; Rule relatively is with following formula:
L k = Σ i = 1 20 Σ j = 1 20 ( r i , j k - t i , j ) 2
Wherein, r I, j kBe (i, the j) gray value of pixel, the t of k template picture I, j(i, j) gray value of pixel for current picture to be measured; The L of value minimum k, the subscript of its correspondence just is the template picture similar with tested picture number;
(4.5) just can all letters in the picture be identified by step (4.4), be saved as text with the ASCII character form then, so just finished the literal leaching process;
Step 4: camera utilizes existing translation algorithm that literal is translated automatically;
Step 5: the result that will translate is presented on the LCD.
The invention has the beneficial effects as follows: the present invention can directly utilize existing digital camera hardware resource, need not to add any hardware cost, makes digital camera have the function that literal extracts and translates automatically, can bring great benefit to the user.
In a word, reasonable idea of the present invention, effect is remarkable, and is easy to use, is widely used.
Embodiment
Below in conjunction with preferred embodiment, to according to embodiment provided by the invention, details are as follows for feature:
A kind of method that realizes extraction of digital camera literal and automatic translation function is characterized in that implementation step is as follows:
Step 1: in menu (Menu),, camera is arranged to interpretive scheme by corresponding entry;
Step 2: literal is taken pictures;
Step 3: camera carries out the literal extraction from employing the literal extraction algorithm, and generates text;
Described literal extraction algorithm is as follows:
At first, literal is taken, comprised literal and background dichromatism in the picture usually;
(1) will carry out gray processing to coloured image handles; The human color sense light characteristic that draws according to psychological study, and consider the speed calculated to adopt following formula, to press from left to right, order is from top to bottom carried out the gray processing processing to each pixel:
Y=(229×R+587×G+114×B+500)/1000;
Wherein, R, G, B are respectively R, G, the B values of this pixel; So just coloured image is converted into gray level image;
(2) gray level image that obtains is carried out binary conversion treatment; At first determine a threshold value, gray value all is changed to 255 greater than the some gray value of this threshold value, and gray value all is changed to 0 less than the some gray value of this threshold value; This threshold alpha obtains by following formula:
α=all pixel gray scale sum/pixel numbers;
By from left to right, order from top to bottom scans each pixel of image then, when this gray value Y>=α, and Y=255; When Y<α, Y=0;
(3) relatively Y value be 0 and Y value be the number of 255 pixel, what number was many is the background dot set, what number was few is that literal point is gathered; If the background dot gray scale is 255, then putting the background dot gray scale is 0, and literal point gray scale is 255 (being always 255 for guaranteeing literal point gray scale);
(4) the binaryzation picture that obtains being carried out literal extracts; The method of extracting is to adopt following algorithm:
(4.1) establishing an indexed variable i, and be changed to 0, picture is lined by line scan, is 255 point if this delegation does not have gray value, checks indexed variable, and indexed variable is 0, then scans next line; Be 1, then write down this journey h i, and to put indexed variable be 0; If it is 255 point that gray value is arranged, check indexed variable; If 0, row number is noted, putting indexed variable is 1; If being 1, indexed variable continues next line scanning;
(4.2) establish an indexed variable j, and be changed to 0, all are had the row of record, in turn two the row h iAnd h I-1Between (for example, behavior the 3rd, 6,10,13,17,20 row of record being arranged, is exactly between the 3rd row and the 6th row so, between the 10th and the 13rd row, by that analogy) carries out column scan; If the row of current scanning number are l kIf the no gray scale of these row is 255 point, check j, if j=0 then scans next column; J=1 writes down two tuple (h i, l k), and make j=0; If it is 255 point that gray value is arranged, check j, if j=0 then writes down two tuple (h I-1, l k), and make j=1; If j=1 then continues the scanning next column;
(4.3) the adjacent in turn two point (h that obtain in the step (4.2) I-1, l m), (h i, l n) rectangular area that surrounded is exactly a letter zone, an alphabetical regional ensemble is just formed in all these zones; Because the time need use the standard alphabet template picture that is stored in advance in the camera in identification, and picture size is 20*20, so will change into each alphabetical geographic norms the zone of a 20*20 size; The method of standard is: establishing the zone for the treatment of standard is the m*n size, and (i j), makes p=round (i/m*20), and q=rounds (j/m*20) for one of them pixel; A newly-built 20*20 picture makes in the newly-built picture that (p, gray value q) treat that (all the other some gray values all are changed to 0 in the newly-built picture for i, gray value j) in the zone of standard; So just the m*n zone is converted to the 20*20 zone;
(4.4) picture and template picture after the conversion are compared, and then identify letter; Rule relatively is with following formula:
L k = Σ i = 1 20 Σ j = 1 20 ( r i , j k - t i , j ) 2
Wherein, r I, j kBe (i, the j) gray value of pixel, the t of k template picture I, j(i, j) gray value of pixel for current picture to be measured; The L of value minimum k, the subscript of its correspondence just is the template picture similar with tested picture number; For example, all L of trying to achieve of photo current kIn, L 3Minimum, photo current and the 3rd template picture are mated most in other words, if the 3rd template picture is alphabetical c, represent that then the letter in the current alphabetical picture to be measured is c;
(4.5) just can all letters in the picture be identified by step (4.4), be saved as text with the ASCII character form then, so just finished the literal leaching process;
Step 4: camera utilizes existing translation algorithm that literal is translated automatically;
Step 5: the result that will translate is presented on the LCD.
Running environment of the present invention is digital camera, relates to software programming control, image storage technique and the Display Technique of digital camera.
During application, the user should be arranged to interpretive scheme to camera earlier, aims at the content that will take then, takes pictures after focusing on; The phase chance is carried out literal extraction and translation automatically then, and the result after the translation is presented on the liquid crystal display screen (LCD).
Above-mentioned detailed description of the method for this realization digital camera literal extraction and automatic translation function being carried out with reference to embodiment; be illustrative rather than determinate; therefore in the variation and the modification that do not break away under the general plotting of the present invention, should belong within protection scope of the present invention.

Claims (1)

1. realize that the digital camera literal extracts and the method for automatic translation function for one kind, it is characterized in that implementation step is as follows:
Step 1: in menu,, camera is arranged to interpretive scheme by corresponding entry;
Step 2: literal is taken pictures;
Step 3: camera carries out the literal extraction from employing the literal extraction algorithm, and generates text;
Described literal extraction algorithm is as follows:
At first, literal is taken, comprised literal and background dichromatism in the picture;
(1) will carry out gray processing to coloured image handles; The human color sense light characteristic that draws according to psychological study, and consider the speed calculated to adopt following formula, to press from left to right, order is from top to bottom carried out the gray processing processing to each pixel:
Y=(229×R+587×G+114×B+500)/1000;
Wherein, R, G, B are respectively R, G, the B values of this pixel; So just coloured image is converted into gray level image;
(2) gray level image that obtains is carried out binary conversion treatment; At first determine a threshold value, gray value all is changed to 255 greater than the some gray value of this threshold value, and gray value all is changed to 0 less than the some gray value of this threshold value; This threshold alpha obtains by following formula:
α=all pixel gray scale sum/pixel numbers;
By from left to right, order from top to bottom scans each pixel of image then, when this gray value Y 〉=α, and Y=255; When Y<α, Y=0;
(3) relatively Y value be 0 and Y value be the number of 255 pixel, what number was many is the background dot set, what number was few is that literal point is gathered; If the background dot gray scale is 255, then putting the background dot gray scale is 0, and literal point gray scale is 255; Guarantee that literal point gray scale is always 255;
(4) the binaryzation picture that obtains being carried out literal extracts; The method of extracting is to adopt following algorithm:
(4.1) establishing an indexed variable i, and be changed to 0, picture is lined by line scan, is 255 point if this delegation does not have gray value, checks indexed variable, and indexed variable is 0, then scans next line; Be 1, then write down this journey h i, and to put indexed variable be 0; If it is 255 point that gray value is arranged, check indexed variable; If 0, row number is noted, putting indexed variable is 1; If being 1, indexed variable continues next line scanning;
(4.2) establish an indexed variable j, and be changed to 0, all are had the row of record, in turn two the row h iAnd h I-1Between carry out column scan; If the row of current scanning number are l kIf the no gray scale of these row is 255 point, check j, if j=0 then scans next column; J=1 writes down two tuple (h i, l k), and make j=0; If it is 255 point that gray value is arranged, check j, if j=0 then writes down two tuple (h I-1, j k), and make j=1; If j=1 then continues the scanning next column;
(4.3) the adjacent in turn two point (h that obtain in the step (4.2) I-1, l m), (h i, l n) rectangular area that surrounded is exactly a letter zone, an alphabetical regional ensemble is just formed in all these zones; Because the time need use the standard alphabet template picture that is stored in advance in the camera in identification, and picture size is 20*20, so will change into each alphabetical geographic norms the zone of a 20*20 size; The method of standard is: establishing the zone for the treatment of standard is the m*n size, and (i j), makes p=round (i/m*20), and q=rounds (j/m*20) for one of them pixel; A newly-built 20*20 picture makes in the newly-built picture that (p, gray value q) treat that (all the other some gray values all are changed to 0 in the newly-built picture for i, gray value j) in the zone of standard; So just the m*n zone is converted to the 20*20 zone;
(4.4) picture and template picture after the conversion are compared, and then identify letter; Rule relatively is with following formula:
L k = Σ I = 1 20 Σ j = 1 20 ( r i , j k - t i , j ) 2
Wherein,
Figure FSB00000172067000022
Be (i, the j) gray value of pixel, the t of k template picture I, j(i, j) gray value of pixel for current picture to be measured; The L of value minimum k, the subscript of its correspondence just is the template picture similar with tested picture number;
(4.5) just can all letters in the picture be identified by step (4.4), be saved as text with the ASCII character form then;
Step 4: camera utilizes existing translation algorithm that literal is translated automatically;
Step 5: the result that will translate is presented on the LCD.
CN2009100690275A 2009-05-26 2009-05-26 Method for realizing functions of character extraction and automatic translation of digital camera Expired - Fee Related CN101562694B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100690275A CN101562694B (en) 2009-05-26 2009-05-26 Method for realizing functions of character extraction and automatic translation of digital camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100690275A CN101562694B (en) 2009-05-26 2009-05-26 Method for realizing functions of character extraction and automatic translation of digital camera

Publications (2)

Publication Number Publication Date
CN101562694A CN101562694A (en) 2009-10-21
CN101562694B true CN101562694B (en) 2010-12-29

Family

ID=41221289

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100690275A Expired - Fee Related CN101562694B (en) 2009-05-26 2009-05-26 Method for realizing functions of character extraction and automatic translation of digital camera

Country Status (1)

Country Link
CN (1) CN101562694B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101661721B (en) * 2009-07-27 2011-07-20 天马微电子股份有限公司 Liquid crystal display device and image display method
CN103390055A (en) * 2013-07-26 2013-11-13 国家电网公司 File transmission method and system
CN108628858A (en) * 2018-04-20 2018-10-09 广东科学技术职业学院 The operating method and system of textual scan identification translation on line based on mobile terminal
CN108985201A (en) * 2018-06-29 2018-12-11 网易有道信息技术(北京)有限公司 Image processing method, medium, device and calculating equipment
CN110717397A (en) * 2019-09-11 2020-01-21 中国海洋大学 Online translation system based on mobile phone camera
CN113596425B (en) * 2021-06-21 2023-02-07 深圳市沃特沃德信息有限公司 Image processing method and device for ink screen terminal, storage medium and intelligent device

Also Published As

Publication number Publication date
CN101562694A (en) 2009-10-21

Similar Documents

Publication Publication Date Title
CN101562694B (en) Method for realizing functions of character extraction and automatic translation of digital camera
WO2006104322A1 (en) Method for inputting chinese characters using chinese alphabet and system for performing the same
CN109739416A (en) A kind of Text Extraction and device
CN106446885A (en) Paper-based Braille recognition method and system
CN103854019A (en) Method and device for extracting fields in image
Rupanagudi et al. Novel methodology for Kannada Braille to speech translation using image processing on FPGA
CN102929394B (en) A kind of Braille input method based on gesture identification
CN104424166B (en) Text Processing Apparatus And Text Display System
KR20060120244A (en) Character display method
JP2017515218A (en) Computer kanji input device and kanji input method
CN106777061B (en) Information hiding system and method based on webpage text and image and extraction method
CN103870103B (en) Method for information processing and electronic device
CN110244995A (en) The personalized screens word space method of adjustment and device of view-based access control model crowding effect
CN105677718A (en) Character retrieval method and apparatus
CN114120334A (en) Braille processing method, device, storage medium and electronic device
Kuo et al. Mobilizing 3D virtual artifacts exhibition system of National Palace Museum
CN104063069A (en) Character input device convenient to use
EP1758012A2 (en) Succession Chinese character input method
CN106781837B (en) Writing board and method for generating writing board
CN106776489B (en) Electronic document display method and system of display device
Huang et al. Designing infographics/visual icons of social network by referencing to the design concept of ancient oracle bone characters
CN104991657A (en) Chinese and Japanese katakana integrated input method and input method system
JP2019179485A (en) Information providing apparatus, information providing method, and program
JP2014219755A (en) Search method for searching by combining components of kanji with numbers and system associated with the same
KR20110043427A (en) Method of character arrangement for inputting consonent of korean alphabet and method of inputting korean alphabet

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20101229

Termination date: 20130526