CN104915332B - A kind of method and device for generating layout template - Google Patents

A kind of method and device for generating layout template Download PDF

Info

Publication number
CN104915332B
CN104915332B CN201510331098.3A CN201510331098A CN104915332B CN 104915332 B CN104915332 B CN 104915332B CN 201510331098 A CN201510331098 A CN 201510331098A CN 104915332 B CN104915332 B CN 104915332B
Authority
CN
China
Prior art keywords
character
line
rectangle frame
template
pixel
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
CN201510331098.3A
Other languages
Chinese (zh)
Other versions
CN104915332A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201510331098.3A priority Critical patent/CN104915332B/en
Publication of CN104915332A publication Critical patent/CN104915332A/en
Application granted granted Critical
Publication of CN104915332B publication Critical patent/CN104915332B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of method and device for generating layout template.Methods described includes:Using the character in Text region algorithm extraction source picture;Rectangle frame according to corresponding to the pixel on the border of each line character of extraction determines each line character respectively;For each rectangle frame of determination, the number of characters according to included by the position coordinates of current rectangle frame and the rectangle frame determines the font size and word spacing of the character in current rectangle frame;Font size and word spacing the generation layout template of character in each rectangle frame.The present invention solves the problem of type-setting mode admired can not being transplanted into the mobile terminal of oneself, realize the purpose of the quick mobile terminal that the typesetting effect that user sees is copied to user itself, the demand for meeting different user to text composition has been reached, the effect of the reading experience of user is lifted.

Description

A kind of method and device for generating layout template
Technical field
The present invention relates to character display technique field, especially a kind of method and device for generating layout template.
Background technology
With the development of wireless network, wireless network speed is constantly speeded, and rate also constantly decline, and pass through mobile terminal The data service that (such as mobile phone, tablet personal computer) is carried out also increasingly increases.Mobile media is as New Media, with carrying side Just, can getting online at any moment acquisition information, the advantage that can be read whenever and wherever possible.
At present, user spends the time in mobile phone reading increasingly longer, and the good typesetting of reading content can be carried effectively Rise reading experience.Regrettably, the reading content in current mobile phone is distributed in each application module, and the quality of its typesetting is also joined Difference is uneven.Meanwhile, user is different to the demand of typesetting, and simple adjustment function (example can generally be provided by reading the software of class The function of such as being adjusted to font size and line-spacing), but need user to go adjustment manually, it is cumbersome.Many times, user is in hair , but can not be this typesetting during the type-setting mode now liked (such as the display content on books, magazine or other people electronic equipments) Mode is transplanted on the mobile phone of oneself.
The content of the invention
It is an object of the invention to provide a kind of method and device for generating layout template, with the row for quickly seeing user Version effect copies to the mobile terminal of user itself, provides the user the layout template of personalization, meets different user to word The demand of typesetting, improves the reading experience of user.
In a first aspect, the present invention provides a kind of method for generating layout template, including:
Using the character in Text region algorithm extraction source picture;
Rectangle frame according to corresponding to the pixel on the border of each line character of extraction determines each line character respectively;
For each rectangle frame of determination, the character according to included by the position coordinates of current rectangle frame and the rectangle frame Number, determines the font size and word spacing of the character in current rectangle frame;
Font size and word spacing the generation layout template of character in each rectangle frame.
Second aspect, the present invention provides a kind of device for generating layout template, including:
Character extraction unit, for using the character in Text region algorithm extraction source picture;
Rectangle frame determining unit, the pixel for the border of each line character according to extraction determines each line character institute respectively Corresponding rectangle frame;
Form determining unit, for each rectangle frame for determination, according to the position coordinates of current rectangle frame and described Number of characters included by rectangle frame, determines the font size and word spacing of the character in current rectangle frame;
Template generation unit, font size and word spacing for the character in each rectangle frame generate typesetting mould Plate.
The method and device for the generation layout template that the present invention is provided, by extracting the word in the source picture that user chooses Symbol, and the rectangle frame according to corresponding to the pixel on the border of each line character determines each line character respectively, for each square of determination Shape frame, the number of characters according to included by the position coordinates of current rectangle frame and the rectangle frame, is determined in current rectangle frame The font size and word spacing of character, and font size and word spacing the generation typesetting mould of character in each rectangle frame Plate.The present invention realizes the purpose that the type-setting mode liked is implanted into the mobile terminal of oneself by user, meets different user pair The demand of text composition, improves the reading experience of user.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, institute in being described below to the embodiment of the present invention The accompanying drawing needed to use is briefly described, it should be apparent that, drawings in the following description are only some implementations of the present invention Example, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to present invention implementation The content and these accompanying drawings of example obtain other accompanying drawings.
Fig. 1 is a kind of flow chart of the method for generation layout template in the embodiment of the present invention one;
Fig. 2 is a kind of flow chart of the method for generation layout template in the embodiment of the present invention two;
Fig. 3 is a kind of structural representation of the device of generation layout template in the embodiment of the present invention three.
Embodiment
For make present invention solves the technical problem that, the technical scheme that uses and the technique effect that reaches it is clearer, below The technical scheme of the embodiment of the present invention will be described in further detail with reference to accompanying drawing, it is clear that described embodiment is only It is a part of embodiment of the invention, rather than whole embodiments.Based on the embodiment in the present invention, those skilled in the art exist The every other embodiment obtained under the premise of creative work is not made, the scope of protection of the invention is belonged to.
Further illustrate technical scheme below in conjunction with the accompanying drawings and by embodiment.
Embodiment one
Fig. 1 is a kind of flow chart of the method for generation layout template that the embodiment of the present invention one is provided, the side of the present embodiment Method can be performed by the device of generation layout template, and the device can be realized by way of hardware and/or software, and typically may be used To be integrated in the terminals such as smart mobile phone, PAD or personal computer.
Shown in Figure 1, the method for the generation layout template specifically includes following steps:
Step 101, using the character in Text region algorithm extraction source picture.
Wherein, the source picture is the picture for including the comparatively ideal text composition requirement of user.It can be wrapped by obtaining The screenshotss of terminal containing the preferable text composition page shoot the books text comprising the preferable text composition page The modes such as word obtain the source picture.The Text region algorithm is the calculation that character is recognized and extracted from the source picture extracted Method, can include algorithm, the algorithm of feature extraction, sorting algorithm and the instruction that image preprocessing is carried out to acquired source picture Practice algorithm etc..
Step 102, the rectangle according to corresponding to the pixel on the border of each line character of extraction determines each line character respectively Frame.
Wherein, the pixel on the border of each line character is current line character leftmost picture in the X-axis direction respectively The pixel of vegetarian refreshments and rightmost, and, current line character top pixel point and the pixel of bottom in the Y-axis direction.
For each line character extracted, according to current line character leftmost pixel and rightmost in the X-axis direction Pixel, and, top pixel point and the pixel of bottom determine that current line character institute is right to current line character in the Y-axis direction The Origin And Destination of the rectangle frame answered respectively in X-axis and Y direction.
Step 103, each rectangle frame for determination, are wrapped according to the position coordinates of current rectangle frame and the rectangle frame The number of characters included, determines the font size and word spacing of the character in current rectangle frame.
For each line character extracted, a line therein is sequentially obtained as target line.By corresponding to the target line Rectangle frame Far Left pixel in the X-axis direction and rightmost pixel coordinate difference as the target line row It is wide.
By the coordinate difference of the top pixel point of the rectangle frame corresponding to the target line in the Y-axis direction and bottom pixel point It is worth high as the row of the target line.The row height of the target line is defined as font height.It is preferred that, according to centimetre, inch Conversion relation between pixel, it may be determined that the top pixel point of rectangle frame in the Y-axis direction corresponding to the target line Pixel corresponding with the coordinate difference of bottom pixel point.
Order obtains a character in the target line, determines the leftmost pixel of current character in the X-axis direction With the pixel of rightmost, and, top pixel point and bottom pixel point in the Y-axis direction, according to four pixels It is determined that rectangular block corresponding with current character.By current character leftmost pixel in the X-axis direction and the picture of rightmost Coordinate difference between vegetarian refreshments as rectangular block corresponding with current character width.Preferably, according to centimetre, inch and pixel Between conversion relation, it may be determined that the pixel corresponding to the width of current rectangle block.
Each character in the target line is determined according to rectangular block width corresponding with each character in the target line Mean breadth.Wherein, each character correspondence that the mean breadth of each character is included by the target line in the target line Rectangular block width sum divided by the target line number of characters that is included determine.
According to the font height and the mean breadth, the font size of character in the target line is determined.
Number of characters according to included by the line width of the target line, the mean breadth and the target line, determines institute State the word spacing between the two neighboring character of target line.Specifically include:Count number of characters that the target line includes (including Punctuation mark), N is designated as, the line width of the target line is designated as A, each character that the target line is included (including punctuate is accorded with Number) the width sum of corresponding rectangular block is designated as B, then, the calculation formula of the word spacing is:Word spacing=(A-B)/ (N-1)。
Step 104, the font size of character in each rectangle frame and word spacing generation layout template.
The font size and word spacing data of character in each acquired rectangle frame are saved as into layout template.Root It is that can determine that layout template according to font size and word spacing, and is stored in user terminal.The typesetting mould is used in user When plate shows word content, layout template needed for need to only calling.It is preferred that, the template is applied in the word to be shown Rong Shi, because the source picture that user inputs may have differences with the size of current display terminal display screen, so that so that pass through The template and the size of current display terminal display screen that the source picture is extracted are inconsistent, then set what equal proportion was zoomed in or out Function, the best visual effect is adjusted to for user by the template generated.
The technical scheme of the present embodiment, by the character in extraction source picture, and the border of each line character according to extraction Pixel determine rectangle frame corresponding to each line character respectively, determine character in each described rectangle frame font size and Word spacing, font size and word spacing the generation layout template of the character in each rectangle frame, solving user can not The problem of type-setting mode admired is transplanted into the mobile terminal of oneself, realizes the quick typesetting effect duplication for seeing user To the purpose of the mobile terminal of user itself, the demand for meeting different user to text composition has been reached, the reading of user is lifted The effect of experience.
Embodiment two
Fig. 2 is a kind of flow chart of the method for generation layout template in the embodiment of the present invention two.What the present embodiment was provided Method adds the technical characteristic for determining line space, font type and template background on the basis of above-mentioned technical proposal.
Shown in Figure 2, the method for the generation layout template specifically includes following steps:
Step 201, the rectangle according to corresponding to the pixel on the border of each line character of extraction determines each line character respectively Frame.
Whether the line number of the extracted character of step 202, judgement is more than 1, if so, step 203 is then performed, if it is not, then holding Row step 204.
A line in the extracted character of step 203, order acquisition determines the target line and adjacent as target line Line space between lastrow, is used as template line space.
When the line number of the character extracted is more than 1, a line since order the second row obtains extracted character It is used as target line.The coordinate value of the top pixel point of character that the target line included in the Y-axis direction is determined, and determines institute The coordinate value of the bottom pixel point of character that the adjacent lastrow of target line included in the Y-axis direction is stated, by the top picture The difference of vegetarian refreshments and the coordinate of the bottom pixel point, is defined as the line space between the target line and adjacent lastrow. Preferably, according to the conversion relation between centimetre, inch and pixel, it may be determined that the pixel corresponding to the line space.
After completing to determine the line space for each line character that the source picture is included, step 205 is performed.
Step 204, it regard default line space as template line space.
When the line number of the character extracted is equal to 1, default line space is regard as template line space.Wherein, it is described pre- If line space can be obtained by way of being manually entered, or given tacit consent to by terminal system and generated, or by terminal System is obtained by way of download.
Step 205, the font size of character in each rectangle frame and word spacing and template line space life Into the layout template.
Identified font size, word spacing and template line space data are saved as into layout template, and are stored in use In the terminal of family.When user shows word content using the layout template, required layout template only need to be called.It is described Layout template can enter Mobile state scaling according to the actual size of terminal display screen.
The technical scheme of the present embodiment, by the way that when the character extracted is more than a line, order obtains extracted character In a line as target line, the line space between the target line and adjacent lastrow is determined, to be used as template line space; If the character extracted only a line, regard default line space as template line space;And the character in each rectangle frame Font size and word spacing and the template line space generate the layout template.The present embodiment, which is realized, quickly to be obtained The typesetting effects such as the font size seen at family, word spacing and line space are taken, and the typesetting effect is copied into user certainly The purpose of the mobile terminal of body, has reached the demand for meeting different user to text composition, lifts the effect of the reading experience of user Really.
Further, before generation layout template, in addition to:
The font type of the character included by the source picture is recognized using Text region algorithm, to be used as template font class Type;When the Text region algorithm cannot recognize that the font type of the character included by the source picture, according to default The font type that font type substitutes the character included by the source picture turns into template font type.Pass through the side being manually entered Formula, or the mode that terminal system is given tacit consent to, or the mode that terminal system is downloaded in advance pre-set template font type, with Ensure when Text region algorithm None- identified goes out the font type included by the source picture, show default font type. Avoid because None- identified goes out the font type included by the source picture, cause the font type of the layout template of generation unclear The problem of Chu.For example, when Text region algorithm None- identified goes out the font type included by the source picture, determining template Font type is the Song typeface.The font size and word spacing and the template font type of character in each rectangle frame Generate the layout template.
Further, after font size and word spacing the generation layout template of the character in each rectangle frame, also Including:Around the multiple pixels of non-character regional choice of the rectangle frame, and the pixel value of the pixel is obtained, to calculate Average pixel value.For example, a line character can be obtained as target line character, it is contemplated that the target line has adjacent upper A line and adjacent next line, so, the target line can not be the first row and last column.Selected pixel is in Y-axis Coordinate on direction is located on the center line of the target line character and adjacent next line character, and, the target line character With on the center line of adjacent lastrow character.The coordinate of pixel in selected pixel left side in the X-axis direction is described Difference between the high order end pixel of the corresponding rectangle frame of target line coordinate in the X-axis direction and word spacing.It is selected The coordinate of the pixel pixel on right side in the X-axis direction be that the low order end pixel of the corresponding rectangle frame of the target line exists Coordinate in X-direction adds word spacing.Calculate the average pixel value of selected pixel.It is preferred that, pass through a most young waiter in a wineshop or an inn Multiplication determines the average pixel value of selected pixel.It is that the layout template adds background face according to the average pixel value Color.
Embodiment three
Fig. 3 is a kind of structural representation of the device of generation layout template in the embodiment of the present invention three.Referring to Fig. 3 institutes Show, the device of the generation layout template, including:
Character extraction unit 301, for using the character in Text region algorithm extraction source picture;
Rectangle frame determining unit 302, the pixel for the border of each line character according to extraction determines each row word respectively The corresponding rectangle frame of symbol;
Form determining unit 303, for each rectangle frame for determination, according to the position coordinates of current rectangle frame and institute The number of characters included by rectangle frame is stated, the font size and word spacing of the character in current rectangle frame is determined;
Template generation unit 304, font size and word spacing for the character in each rectangle frame generate typesetting Template.
The technical scheme of the present embodiment, by character extraction unit 301, using in Text region algorithm extraction source picture Character;By rectangle frame determining unit 302, each line character institute is determined according to the pixel on the border of each line character of extraction respectively Corresponding rectangle frame;For each rectangle frame of determination, by form determining unit 303 according to the position coordinates of current rectangle frame with And the number of characters included by the rectangle frame, determine the font size and word spacing of the character in current rectangle frame;Pass through mould Plate generation unit 304, font size and word spacing the generation layout template of the character in each rectangle frame.The present embodiment Technical scheme solves the problem of type-setting mode admired can not being transplanted into the mobile terminal of oneself, realizes quick by user The typesetting effect seen copies to the purpose of the mobile terminal of user itself, has reached the need for meeting different user to text composition Ask, lift the effect of the reading experience of user.
Further, the rectangle frame determining unit 302 specifically for:
For each line character of extraction, it is determined that current line character leftmost pixel and rightmost in the X-axis direction Origin And Destination of the pixel as the rectangle frame corresponding to current line character in the X-axis direction;
It is determined that current line character in the Y-axis direction top pixel point and the pixel of bottom as corresponding to current line character Rectangle frame Origin And Destination in the Y-axis direction.
Further, the template generation unit 304 includes:
The high determination subelement of row, a line in extracted character is obtained for order as target line, according to the mesh The Origin And Destination of rectangle frame in the Y-axis direction corresponding to row is marked, the height of the rectangle frame is calculated, to be used as the target Capable row is high;
Mean breadth determination subelement, described in being determined according to the pixel on the border of each character in the target line Rectangular block corresponding to each character, the average width of each character in the target line is determined according to the width of the rectangular block Degree;
Font size determination subelement, for the row according to the target line to be high and the mean breadth, it is determined that described The font size of character in target line;
Word spacing determination subelement, for the line width according to the target line, the mean breadth and the target The included number of characters of row, determines the word spacing between the two neighboring character of the target line.
Further, described device also includes:
Line space determining unit, for when the character extracted is more than a line, order to be obtained in extracted character The top pixel point and the target line of the character that a line is included as target line, according to the target line in the Y-axis direction The difference of the coordinate of the bottom pixel point of the character that adjacent lastrow is included in the Y-axis direction, determine the target line with Line space between adjacent lastrow, to be used as template line space;
When the character extracted only has a line, default line space is regard as template line space;
The template generation unit specifically for:
The font size and word spacing of character in each rectangle frame and the template line space generate the row Version template.
Further, described device also includes:
Font type determining unit, for before generation layout template, being recognized using the Text region algorithm described The font type of character included by the picture of source, to be used as template font type;
When the Text region algorithm cannot recognize that font type, the source figure is substituted according to default font type The font type of character included by piece turns into template font type;
The template generation unit specifically for:
Described in the font size and word spacing of character in each rectangle frame and template font type generation Layout template.
Further, described device also includes:
Background adding device, font size and word spacing for the character in each rectangle frame generate layout template Afterwards, around the multiple pixels of non-character regional choice of the rectangle frame, and the pixel value of the pixel is obtained, to calculate Average pixel value;
It is that the layout template adds background color according to the average pixel value.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art it is various it is obvious change, Readjust and substitute without departing from protection scope of the present invention.Therefore, although the present invention is carried out by above example It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also Other more equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.

Claims (10)

1. a kind of method for generating layout template, it is characterised in that including:
Using the character in Text region algorithm extraction source picture;
Rectangle frame according to corresponding to the pixel on the border of each line character of extraction determines each line character respectively;
For each rectangle frame of determination, the number of characters according to included by the position coordinates of current rectangle frame and the rectangle frame, Determine the font size and word spacing of the character in current rectangle frame;
Font size and word spacing the generation layout template of character in each rectangle frame, the layout template can equal proportion Zoom in or out consistent with the display size of present terminal;
Around the multiple pixels of non-character regional choice of the rectangle frame, and the pixel value of the pixel is obtained, to calculate Average pixel value;
It is that the layout template adds background color according to the average pixel value.
2. according to the method described in claim 1, it is characterised in that the pixel on the border of each line character according to extraction The rectangle frame corresponding to each line character is determined respectively, including:
For each line character of extraction, it is determined that the pixel of current line character leftmost pixel and rightmost in the X-axis direction Origin And Destination of the point as the rectangle frame corresponding to current line character in the X-axis direction;It is determined that current line character is in Y direction Upper top pixel and the pixel of bottom are used as the starting point in the Y-axis direction of the rectangle frame corresponding to current line character and end Point.
3. according to the method described in claim 1, it is characterised in that for each rectangle frame of determination, according to current rectangle frame Number of characters included by position coordinates and the rectangle frame, between the font size and word that determine character in current rectangle frame Away from, including:
A line in the extracted character of order acquisition is as target line, and the rectangle frame according to corresponding to the target line is in Y-axis Origin And Destination on direction, calculates the height of the rectangle frame, high using the row as the target line;
Rectangular block according to being determined the pixel on the border of each character in the target line corresponding to each character, according to The width of the rectangular block determines the mean breadth of each character in the target line;
According to the row of the target line is high and the mean breadth, the font size of character in the target line is determined;
Number of characters according to included by the line width of the target line, the mean breadth and the target line, determines the mesh Word spacing between the two neighboring character of mark row.
4. according to the method described in claim 1, it is characterised in that the pixel point on the border of each line character according to extraction After not determining the rectangle frame corresponding to each line character, before generation layout template, in addition to:
When the character extracted is more than a line, a line in the extracted character of order acquisition is as target line, according to described The character that the top pixel point of the character that target line the is included in the Y-axis direction lastrow adjacent with the target line is included The difference of the coordinate of bottom pixel point in the Y-axis direction, determines the line space between the target line and adjacent lastrow, To be used as template line space;
When the character extracted only has a line, default line space is regard as template line space;
Font size and word spacing the generation layout template of character in each rectangle frame, including:
The font size and word spacing of character in each rectangle frame and the template line space generate the typesetting mould Plate.
5. according to the method described in claim 1, it is characterised in that before generation layout template, in addition to:
The font type of the character included by the source picture is recognized using Text region algorithm, to be used as template font type;
When the Text region algorithm cannot recognize that the font type of the character included by the source picture, according to default The font type that font type substitutes the character included by the source picture turns into template font type;
Font size and word spacing the generation layout template of character in each rectangle frame, including:
The font size and word spacing of character in each rectangle frame and the template font type generate the typesetting Template.
6. a kind of device for generating layout template, it is characterised in that including:
Character extraction unit, for using the character in Text region algorithm extraction source picture;
Rectangle frame determining unit, corresponding to the pixel for the border of each line character according to extraction determines each line character respectively Rectangle frame;
Form determining unit, for each rectangle frame for determination, according to the position coordinates of current rectangle frame and the rectangle Number of characters included by frame, determines the font size and word spacing of the character in current rectangle frame;
Template generation unit, font size and word spacing for the character in each rectangle frame generate layout template, institute Layout template is stated to can be enlarged or reduced in proportion to consistent with the display size of present terminal;
Background adding device, for the character in each rectangle frame font size and word spacing generation layout template it Afterwards, around the multiple pixels of non-character regional choice of the rectangle frame, and the pixel value of the pixel is obtained, it is flat to calculate Equal pixel value;
It is that the layout template adds background color according to the average pixel value.
7. device according to claim 6, it is characterised in that the rectangle frame determining unit specifically for:
For each line character of extraction, it is determined that the pixel of current line character leftmost pixel and rightmost in the X-axis direction Origin And Destination of the point as the rectangle frame corresponding to current line character in the X-axis direction;
It is determined that top pixel point and the pixel of bottom are used as the square corresponding to current line character to current line character in the Y-axis direction The Origin And Destination of shape frame in the Y-axis direction.
8. device according to claim 6, it is characterised in that the template generation unit includes:
The high determination subelement of row, a line in extracted character is obtained for order as target line, according to the target line The Origin And Destination of corresponding rectangle frame in the Y-axis direction, calculates the height of the rectangle frame, to be used as the target line Row is high;
Mean breadth determination subelement, for according in the target line border of each character pixel determine described in each Rectangular block corresponding to character, the mean breadth of each character in the target line is determined according to the width of the rectangular block;
Font size determination subelement, for the row according to the target line to be high and the mean breadth, determines the target The font size of character in row;
Word spacing determination subelement, for the line width according to the target line, the mean breadth and target line institute Including number of characters, determine the word spacing between the two neighboring character of the target line.
9. device according to claim 6, it is characterised in that described device also includes:
Line space determining unit, for when the character extracted is more than a line, order to obtain a line in extracted character As target line, the top pixel point of the character included according to the target line in the Y-axis direction is adjacent with the target line The character that is included of lastrow bottom pixel point in the Y-axis direction coordinate difference, determine the target line with it is adjacent Lastrow between line space, to be used as template line space;
When the character extracted only has a line, default line space is regard as template line space;
The template generation unit specifically for:
The font size and word spacing of character in each rectangle frame and the template line space generate the typesetting mould Plate.
10. device according to claim 6, it is characterised in that described device also includes:
Font type determining unit, for before generation layout template, the source figure to be recognized using the Text region algorithm The font type of character included by piece, to be used as template font type;
When the Text region algorithm cannot recognize that font type, the source picture institute is substituted according to default font type Including character font type turn into template font type;
The template generation unit specifically for:
The font size and word spacing of character in each rectangle frame and the template font type generate the typesetting Template.
CN201510331098.3A 2015-06-15 2015-06-15 A kind of method and device for generating layout template Expired - Fee Related CN104915332B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510331098.3A CN104915332B (en) 2015-06-15 2015-06-15 A kind of method and device for generating layout template

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510331098.3A CN104915332B (en) 2015-06-15 2015-06-15 A kind of method and device for generating layout template

Publications (2)

Publication Number Publication Date
CN104915332A CN104915332A (en) 2015-09-16
CN104915332B true CN104915332B (en) 2017-09-15

Family

ID=54084404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510331098.3A Expired - Fee Related CN104915332B (en) 2015-06-15 2015-06-15 A kind of method and device for generating layout template

Country Status (1)

Country Link
CN (1) CN104915332B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106997292A (en) * 2016-01-26 2017-08-01 北京国双科技有限公司 The method and apparatus for handling rectangle tree graph
CN106997264B (en) * 2016-01-26 2020-11-24 百度在线网络技术(北京)有限公司 Method and device for changing picture typesetting
CN106776527B (en) * 2016-12-14 2020-03-17 掌阅科技股份有限公司 Electronic book data display method and device and terminal equipment
CN107038153A (en) * 2017-05-03 2017-08-11 王养性 A kind of character typesetting method for being conducive to improving reading rate
CN107291342B (en) * 2017-05-03 2020-01-31 广东小天才科技有限公司 read-on-demand data copying and outlining method and device
CN111401021A (en) * 2018-12-17 2020-07-10 北大方正集团有限公司 Publication template construction method, device, equipment and computer-readable storage medium
CN110728129B (en) * 2019-09-03 2023-06-23 北京字节跳动网络技术有限公司 Method, device, medium and equipment for typesetting text content in picture
CN110929496B (en) * 2019-11-15 2023-06-16 北京乐蜜科技有限责任公司 Text template generation method and device
CN113435161A (en) * 2020-03-23 2021-09-24 株式会社理光 Italic character generation module and generation method
CN112307713A (en) * 2020-10-27 2021-02-02 广州朗国电子科技有限公司 Automatic text typesetting method and system based on Android system
CN113298741B (en) * 2020-11-13 2024-01-12 阿里巴巴集团控股有限公司 Picture synthesis method and device and electronic equipment
CN112631491A (en) * 2020-12-31 2021-04-09 咪咕文化科技有限公司 Screen character adjusting method and device, network equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1750016A (en) * 2004-09-15 2006-03-22 北京中星微电子有限公司 Optical character identifying treating method for mobile terminal with camera
CN101251892A (en) * 2008-03-07 2008-08-27 北大方正集团有限公司 Method and apparatus for cutting character
CN103455814A (en) * 2012-05-31 2013-12-18 佳能株式会社 Text line segmenting method and text line segmenting system for document images

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004145072A (en) * 2002-10-25 2004-05-20 Riso Kagaku Corp Handwritten-character font preparing device and handwritten-character font preparing program
CN1317881C (en) * 2004-12-30 2007-05-23 北京中星微电子有限公司 Method for identifying multiple name cards by once photo taking by mobile terminal
JP4881605B2 (en) * 2005-10-28 2012-02-22 株式会社リコー Character recognition device, storage medium, and character recognition method
CN101226596B (en) * 2007-01-15 2012-02-01 夏普株式会社 Document image processing apparatus and document image processing process
CN101419661B (en) * 2007-10-26 2011-08-24 国际商业机器公司 Method for displaying image based on text in image and system
JP5826081B2 (en) * 2012-03-19 2015-12-02 株式会社Pfu Image processing apparatus, character recognition method, and computer program
CN103810485A (en) * 2014-01-22 2014-05-21 深圳市东信时代信息技术有限公司 Recognition device, character recognition system and method
CN104598901A (en) * 2015-03-04 2015-05-06 陈佩珊 Method and system for identifying picture characters and typesetting and displaying picture characteristics according to original style by mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1750016A (en) * 2004-09-15 2006-03-22 北京中星微电子有限公司 Optical character identifying treating method for mobile terminal with camera
CN101251892A (en) * 2008-03-07 2008-08-27 北大方正集团有限公司 Method and apparatus for cutting character
CN103455814A (en) * 2012-05-31 2013-12-18 佳能株式会社 Text line segmenting method and text line segmenting system for document images

Also Published As

Publication number Publication date
CN104915332A (en) 2015-09-16

Similar Documents

Publication Publication Date Title
CN104915332B (en) A kind of method and device for generating layout template
KR102107887B1 (en) Method and apparatus for generating a composite image
CN110100251B (en) Apparatus, method, and computer-readable storage medium for processing document
CN106844302B (en) Electronic book page display method and device and terminal equipment
CN102439559B (en) Character display method and device
JP2023531867A (en) Unique identifier based on signature
US10395155B2 (en) Billboard containing encoded information
JP2011166217A (en) Image processing device and image processing program
US10013784B2 (en) Generating an assembled group image from subject images
JP5811416B2 (en) Image processing apparatus, image processing method, and program
CN108205415B (en) Text selection method and device
CN107256259A (en) Page display method, device, electronic equipment and storage medium
CN109902687B (en) Image identification method and user terminal
CN104615587B (en) A kind of electronic data composition method and device
CN114332895A (en) Text image synthesis method, text image synthesis device, text image synthesis equipment, storage medium and program product
CN102339469B (en) Image processing method and device
US20170262141A1 (en) Information processing apparatus, information processing method and non-transitory computer readable medium
KR20120035360A (en) Apparatus for recognizing character and method thereof
JP7027043B2 (en) Information processing equipment, information processing methods and programs
CN108510424B (en) Image processing method and device
CN110996026B (en) OSD display method, device, equipment and storage medium
JP2016122367A (en) Image processor, image processing method and program
CN107066435B (en) Typesetting method and typesetting device
CN106598934A (en) Electronic book data display method and device, and terminal equipment
CN109032749B (en) Method and device for adapting resolution of terminal equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170915