CN101562694A - 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 PDFInfo
- Publication number
- CN101562694A CN101562694A CNA2009100690275A CN200910069027A CN101562694A CN 101562694 A CN101562694 A CN 101562694A CN A2009100690275 A CNA2009100690275 A CN A2009100690275A CN 200910069027 A CN200910069027 A CN 200910069027A CN 101562694 A CN101562694 A CN 101562694A
- 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.)
- Granted
Links
Landscapes
- Image Processing (AREA)
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
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=(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, 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:
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:
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, 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=(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, 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:
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;
Step 4: camera utilizes existing translation algorithm that literal is translated automatically;
Step 5: the result that will translate is presented on the LCD.
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 true CN101562694A (en) | 2009-10-21 |
CN101562694B 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) |
Cited By (6)
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 |
CN113596425A (en) * | 2021-06-21 | 2021-11-02 | 深圳市沃特沃德信息有限公司 | Image processing method and device for ink screen terminal, storage medium and intelligent device |
-
2009
- 2009-05-26 CN CN2009100690275A patent/CN101562694B/en not_active Expired - Fee Related
Cited By (7)
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 |
CN113596425A (en) * | 2021-06-21 | 2021-11-02 | 深圳市沃特沃德信息有限公司 | Image processing method and device for ink screen terminal, storage medium and intelligent device |
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 |
---|---|
CN101562694B (en) | 2010-12-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101562694A (en) | Method for realizing functions of character extraction and automatic translation of digital camera | |
WO2001010112A3 (en) | Methods and apparatus for filtering and caching data representing images | |
KR101846238B1 (en) | Chinese character input apparatus and controlling method thereof | |
WO2006104322A1 (en) | Method for inputting chinese characters using chinese alphabet and system for performing the same | |
Zheng et al. | A stroke-based textual password authentication scheme | |
CN109739416A (en) | A kind of Text Extraction and device | |
KR20140010756A (en) | Mobile device for visual-handicapped persons with text/image/video presentation | |
CN106446885A (en) | Paper-based Braille recognition method and system | |
CN109816743A (en) | Generate the method and terminal device of identification pattern | |
CN103854019A (en) | Method and device for extracting fields in image | |
CN102929394B (en) | A kind of Braille input method based on gesture identification | |
KR101242210B1 (en) | A letter input method of chinese with function of intonation choice for touch screen | |
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 | |
CN102063193A (en) | Method and device for displaying input results | |
CN103870103B (en) | Method for information processing and electronic device | |
EP1758012A2 (en) | Succession Chinese character input method | |
CN110244995A (en) | The personalized screens word space method of adjustment and device of view-based access control model crowding effect | |
Kuo et al. | Mobilizing 3D virtual artifacts exhibition system of National Palace Museum | |
CN1510554B (en) | Embedded applied Chinese character inputting method | |
CN114120334A (en) | Braille processing method, device, storage medium and electronic device | |
CN104063069A (en) | Character input device convenient to use | |
Huang et al. | Designing infographics/visual icons of social network by referencing to the design concept of ancient oracle bone characters | |
CN106781837B (en) | Writing board and method for generating writing board | |
JPS5471937A (en) | Hand-written character input system |
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 |