CN107944449A - The method and terminal of a kind of scale characters - Google Patents

The method and terminal of a kind of scale characters Download PDF

Info

Publication number
CN107944449A
CN107944449A CN201711017192.7A CN201711017192A CN107944449A CN 107944449 A CN107944449 A CN 107944449A CN 201711017192 A CN201711017192 A CN 201711017192A CN 107944449 A CN107944449 A CN 107944449A
Authority
CN
China
Prior art keywords
pixel
character
picture
gray value
average gray
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
Application number
CN201711017192.7A
Other languages
Chinese (zh)
Other versions
CN107944449B (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.)
Fujian Netdragon Websoft Co Ltd
Original Assignee
Fujian Netdragon Websoft 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 Fujian Netdragon Websoft Co Ltd filed Critical Fujian Netdragon Websoft Co Ltd
Priority to CN201711017192.7A priority Critical patent/CN107944449B/en
Publication of CN107944449A publication Critical patent/CN107944449A/en
Application granted granted Critical
Publication of CN107944449B publication Critical patent/CN107944449B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The present invention relates to the method and terminal of data processing field, more particularly to a kind of scale characters.The present invention obtains the first average gray value by S1, the average gray value of calculating picture;S2, identify the Minimum Area that a character is covered in the picture according to first average gray value;S3, in the size range of the picture, scale the region.Realize the word in scaling pictures in the case that dimension of picture is constant.

Description

The method and terminal of a kind of scale characters
Technical field
The present invention relates to the method and terminal of data processing field, more particularly to a kind of scale characters.
Background technology
The method of character is in existing scaling pictures, scaling pictures resource.Although scaling pictures resource can reach contracting The purpose of character in picture is put, still, after picture is amplified, easily leads to the part that small screen device is only able to display picture, without Can easily, the intuitively full text in browsing pictures.
The content of the invention
The technical problems to be solved by the invention are:How the text in scaling pictures in the case that dimension of picture is constant Word.
In order to solve the above-mentioned technical problem, the technical solution adopted by the present invention is:
The present invention provides a kind of method of scale characters, including:
S1, the average gray value for calculating picture, obtain the first average gray value;
S2, identify the Minimum Area that a character is covered in the picture according to first average gray value;
S3, the scaling region.
The present invention also provides a kind of terminal of scale characters, including one or more processors and memory, the storage Device has program stored therein, and is configured to perform following steps by one or more of processors:
S1, the average gray value for calculating picture, obtain the first average gray value;
S2, identify the Minimum Area that a character is covered in the picture according to first average gray value;
S3, in the size range of the picture, scale the region.
The beneficial effects of the present invention are:Pixel in picture is divided into by the present invention by the average gray value of picture Background parts and character portion, the Minimum Area of one character of covering is identified according to the pixel for belonging to character portion, and is being schemed The size range of piece inside contracts the Minimum Area that exoergic enough covers a character, is scaled so as to fulfill in the case where dimension of picture is constant Word in picture, improves the compatibility with different resolution equipment, improves user experience.
Brief description of the drawings
Fig. 1 is a kind of FB(flow block) of the embodiment of the method for scale characters provided by the invention;
Fig. 2 is a kind of structure diagram of the embodiment of the terminal of scale characters provided by the invention;
Label declaration:
1st, processor;2nd, memory.
Embodiment
For the technology contents that the present invention will be described in detail, the objects and the effects, below in conjunction with embodiment and coordinate attached Figure is explained.
Fig. 1 and Fig. 2 is refer to,
As shown in Figure 1, the present invention provides a kind of method of scale characters, including:
S1, the average gray value for calculating picture, obtain the first average gray value;
S2, identify the Minimum Area that a character is covered in the picture according to first average gray value;
S3, in the size range of the picture, scale the region.
Further, the S2 is specially:
The pixel that gray value in the picture is less than first average gray value is obtained, obtains character pixels point set Close;
The Minimum Area that a character is covered in the picture is identified according to the character pixels point set.
Seen from the above description, under normal circumstances, in order to highlight character portion, the gray value of background color is higher than character Gray value, for example, it is 255 that the background of picture, which is the corresponding gray value of white, character color is that the corresponding gray value of black is 0. Pixel in picture is divided into character portion and background parts by the present invention by the average gray value of picture, can be reduced and be made an uproar The interference of sound, improves the accuracy for recognizing the Minimum Area that can cover a character.
Further, the Minimum Area that a character is covered in the picture, tool are identified according to the character pixels point set Body is:
S21, preset the initial length of side;
The color of each pixel is black in S22, the setting character pixels point set;
The color of other pixels in S23, the setting picture in addition to the character pixels point set is white;
A pixel in S24, the acquisition character pixels point set, obtains vertex pixel;
S25, the top left corner apex using the vertex pixel as square are drawn and the initial length of side corresponding first Square;
S26, obtain the point for being less than pre-determined distance with the distance of the vertex pixel, obtains the second pixel point set;
S27, when including black pixel point in the second pixel point set, and the abscissa of the black pixel point is less than During the abscissa of one pixel, it is vertex pixel to update the black pixel point, and using the black pixel point as just Square top left corner apex draws the second square corresponding with the initially length of side;Included when in the second pixel point set Black pixel point, and the ordinate of the black pixel point be less than a pixel ordinate when, update the black picture Vegetarian refreshments is vertex pixel, and corresponding with the initial length of side as the top left corner apex drafting of square using the black pixel point Second square;
S28, repeat step S26 to S27, until black pixel point is not present in the second pixel point set;
Region where S29, setting second square is the Minimum Area that a character is covered in the picture.
Seen from the above description, by the way that the pixel for belonging to character portion is arranged to black, background parts will be belonged to Pixel is arranged to white so that directly whether can judge the pixel according to the color of pixel during scanned picture Belong to character portion, the efficiency of Minimum Area of a character can be covered by improving identification.
Further, before the S29, further include:
Preset initial value and end value;
The average gray value in the described second square region is calculated, obtains the second average gray value;
The central pixel point of second square is obtained, obtains central point;
Default first length of side, first length of side are more than the initial length of side;
Sa, draw the 3rd square corresponding with first length of side centered on the central point;
Average gray value in Sb, the described 3rd square region of calculating, obtains the 3rd average gray value;
When the 3rd average gray value is less than second average gray value, first length of side is increased into default side Long value;The initial value adds one;If the initial value is less than the end value, step Sa to Sb is repeated;Otherwise, perform Step S29;
When the 3rd average gray value is more than second average gray value, step S24 to S29 is performed.
Seen from the above description, the average gray value of the 3rd square of the second square is more than by area to be learnt Whether the second square border nearby also has the pixel for belonging to character portion, if in the presence of, character portion is continued to scan on, if It is not present, then the second square is the Minimum Area that can cover a character, and the minimum of a character can be covered by improving identification The accuracy in region.
Further, the S24 is specially:
The one-row pixels point not being scanned in the picture is obtained according to order from top to bottom;
The pixel not being scanned in the one-row pixels point is obtained according to order from left to right;
It is vertex pixel to set a pixel.
Seen from the above description, effectively avoid omitting the pixel for belonging to character portion.
Further, the S3 is specially:
The corresponding region of all characters in the picture is recognized according to step S1 to S2, obtains the first character zone collection Close;
In the size range of the picture, equal proportion scales all areas in the first character zone set, obtains To the second character zone set.
Seen from the above description, the character portion in a scaling pictures is realized, without changing background parts in picture.
Further, equal proportion scales all areas in the first character zone set, obtains the second character zone After set, further include:
The width in region in the second character zone set is obtained, obtains character duration;
The number of characters of every a line is obtained according to the character duration and picture width calculation;
Character is shown according to the number of characters per a line.
Seen from the above description, self-adaption typesetting during scaling, improves compatibility.
As shown in Fig. 2, the present invention also provides a kind of terminal of scale characters, including one or more processors 1 and storage Device 2, the memory 2 have program stored therein, and are configured to perform following steps by one or more of processors 1:
S1, the average gray value for calculating picture, obtain the first average gray value;
S2, identify the Minimum Area that a character is covered in the picture according to first average gray value;
S3, in the size range of the picture, scale the region.
Further, the S2 is specially:
The pixel that gray value in the picture is less than first average gray value is obtained, obtains character pixels point set Close;
The Minimum Area that a character is covered in the picture is identified according to the character pixels point set.
Further, the Minimum Area that a character is covered in the picture, tool are identified according to the character pixels point set Body is:
S21, preset the initial length of side;
The color of each pixel is black in S22, the setting character pixels point set;
The color of other pixels in S23, the setting picture in addition to the character pixels point set is white;
A pixel in S24, the acquisition character pixels point set, obtains vertex pixel;Specially:According to from upper Order under obtains the one-row pixels point not being scanned in the picture;Described a line is obtained according to order from left to right The pixel not being scanned in pixel;It is vertex pixel to set a pixel;
S25, the top left corner apex using the vertex pixel as square are drawn and the initial length of side corresponding first Square;
S26, obtain the point for being less than pre-determined distance with the distance of the vertex pixel, obtains the second pixel point set;
S27, when including black pixel point in the second pixel point set, and the abscissa of the black pixel point is less than During the abscissa of one pixel, it is vertex pixel to update the black pixel point, and using the black pixel point as just Square top left corner apex draws the second square corresponding with the initially length of side;Included when in the second pixel point set Black pixel point, and the ordinate of the black pixel point be less than a pixel ordinate when, update the black picture Vegetarian refreshments is vertex pixel, and corresponding with the initial length of side as the top left corner apex drafting of square using the black pixel point Second square;
S28, repeat step S26 to S27, until black pixel point is not present in the second pixel point set;
Region where S29, setting second square is the Minimum Area that a character is covered in the picture.
Further, before the S29, further include:
Preset initial value and end value;
The average gray value in the described second square region is calculated, obtains the second average gray value;
The central pixel point of second square is obtained, obtains central point;
Default first length of side, first length of side are more than the initial length of side;
Sa, draw the 3rd square corresponding with first length of side centered on the central point;
Average gray value in Sb, the described 3rd square region of calculating, obtains the 3rd average gray value;
When the 3rd average gray value is less than second average gray value, first length of side is increased into default side Long value;The initial value adds one;If the initial value is less than the end value, step Sa to Sb is repeated;Otherwise, perform Step S29;
When the 3rd average gray value is more than second average gray value, step S24 to S29 is performed.
Further, the S3 is specially:
The corresponding region of all characters in the picture is recognized according to step S1 to S2, obtains the first character zone collection Close;
In the size range of the picture, equal proportion scales all areas in the first character zone set, obtains To the second character zone set;
The width in region in the second character zone set is obtained, obtains character duration;
The number of characters of every a line is obtained according to the character duration and picture width calculation;
Character is shown according to the number of characters per a line.
The embodiment of the present invention one is:
The present embodiment provides a kind of method of scale characters, including:
S1, the average gray value for calculating picture, obtain the first average gray value;
S2, identify the Minimum Area that a character is covered in the picture according to first average gray value;Specially:
S21, obtain the pixel that gray value in the picture is less than first average gray value, obtains character pixels point Set;
S22, identify the Minimum Area that a character is covered in the picture according to the character pixels point set;Specially:
S221, preset the initial length of side;
Alternatively, a length of 16 pixel of initial edge, because Chinese character minimum needs the pixel of 16x16 to represent;
The color of each pixel is black in S222, the setting character pixels point set;
The color of other pixels in S223, the setting picture in addition to the character pixels point set is white;
A pixel in S224, the acquisition character pixels point set, obtains vertex pixel;
Alternatively, the one-row pixels point not being scanned in the picture is obtained according to order from top to bottom;According to from Left-to-right order obtains the pixel not being scanned in the one-row pixels point;It is vertex picture to set a pixel Vegetarian refreshments;
S225, the top left corner apex using the vertex pixel as square are drawn and the initial length of side corresponding first Square;
S226, obtain the point for being less than pre-determined distance with the distance of the vertex pixel, obtains the second pixel point set;
S227, when including black pixel point in the second pixel point set, and the abscissa of the black pixel point is small When the abscissa of a pixel, it is vertex pixel to update the black pixel point, and using the black pixel point as The top left corner apex of square draws the second square corresponding with the initially length of side;Wrapped when in the second pixel point set Containing black pixel point, and when the ordinate of the black pixel point is less than the ordinate of a pixel, the black is updated Pixel is vertex pixel, and the top left corner apex using the black pixel point as square is drawn and the initial length of side pair The second square answered;
S228, repeat step S226 to S227, until black pixel point is not present in the second pixel point set;
S229, preset initial value and end value;
Average gray value in S230, the described second square region of calculating, obtains the second average gray value;
S231, the central pixel point for obtaining second square, obtain central point;
S232, default first length of side, first length of side are more than the initial length of side;
S233, draw the 3rd square corresponding with first length of side centered on the central point;
Average gray value in S234, the described 3rd square region of calculating, obtains the 3rd average gray value;
S235, when the 3rd average gray value is less than second average gray value, by first length of side increase Default length of side value;The initial value adds one;If the initial value is less than the end value, step S233 is repeated extremely S234;Otherwise, step S237 is performed;
S236, when the 3rd average gray value is more than second average gray value, perform step S224 to S236;
Region where S237, setting second square is the Minimum Area that a character is covered in the picture;
S3, in the size range of the picture, scale the region;Specially:
S31, recognize the corresponding region of all characters in the picture according to step S1 to S2, obtains the first character zone Set;
S32, in the size range of the picture, equal proportion scales all areas in the first character zone set Domain, obtains the second character zone set;
S33, the width for obtaining region in the second character zone set, obtain character duration;
S34, according to the character duration and picture width calculation obtain the number of characters of every a line;
S35, the number of characters display character according to described every a line.
For example, the coordinate of the high order end horizontal stroke of " text " arrives (110,100) for (100,100).The coordinate of radical " Dian " for (103, 98) (104,99), (105,100);Black pixel point in search pictures from top to bottom from left to right, searches (100,100), then With (100,100) for starting point, the square area of (116,116) is arrived in tiling (100,100).It is then detected that (100,100) are arrived Whether there is black on two line segments of (116,100) and (100,100) to (100,116), detect that (105,100) have black picture Vegetarian refreshments;Point (105,100) lower-left, left, upper left, upper, upper right point are detected, detect that there is black in upper left (104,99) Pixel, then be moved upward to (100,99) by square area and arrive (100,115) region, and so on, until square region Domain moves on to the top (100,98) of " Dian " to the square area of (100,114).
The embodiment of the present invention two is:
The present embodiment provides a kind of terminal of scale characters, including one or more processors and memory, the storage Device has program stored therein, and is configured to perform following steps by one or more of processors:
S1, the average gray value for calculating picture, obtain the first average gray value;
S2, identify the Minimum Area that a character is covered in the picture according to first average gray value;Specially:
S21, obtain the pixel that gray value in the picture is less than first average gray value, obtains character pixels point Set;
S22, identify the Minimum Area that a character is covered in the picture according to the character pixels point set;Specially:
S221, preset the initial length of side;
Alternatively, a length of 16 pixel of initial edge, because Chinese character minimum needs the pixel of 16x16 to represent;
The color of each pixel is black in S222, the setting character pixels point set;
The color of other pixels in S223, the setting picture in addition to the character pixels point set is white;
A pixel in S224, the acquisition character pixels point set, obtains vertex pixel;
Alternatively, the one-row pixels point not being scanned in the picture is obtained according to order from top to bottom;According to from Left-to-right order obtains the pixel not being scanned in the one-row pixels point;It is vertex picture to set a pixel Vegetarian refreshments;
S225, the top left corner apex using the vertex pixel as square are drawn and the initial length of side corresponding first Square;
S226, obtain the point for being less than pre-determined distance with the distance of the vertex pixel, obtains the second pixel point set;
S227, when including black pixel point in the second pixel point set, and the abscissa of the black pixel point is small When the abscissa of a pixel, it is vertex pixel to update the black pixel point, and using the black pixel point as The top left corner apex of square draws the second square corresponding with the initially length of side;Wrapped when in the second pixel point set Containing black pixel point, and when the ordinate of the black pixel point is less than the ordinate of a pixel, the black is updated Pixel is vertex pixel, and the top left corner apex using the black pixel point as square is drawn and the initial length of side pair The second square answered;
S228, repeat step S226 to S227, until black pixel point is not present in the second pixel point set;
S229, preset initial value and end value;
Average gray value in S230, the described second square region of calculating, obtains the second average gray value;
S231, the central pixel point for obtaining second square, obtain central point;
S232, default first length of side, first length of side are more than the initial length of side;
S233, draw the 3rd square corresponding with first length of side centered on the central point;
Average gray value in S234, the described 3rd square region of calculating, obtains the 3rd average gray value;
S235, when the 3rd average gray value is less than second average gray value, by first length of side increase Default length of side value;The initial value adds one;If the initial value is less than the end value, step S233 is repeated extremely S234;Otherwise, step S237 is performed;
S236, when the 3rd average gray value is more than second average gray value, perform step S224 to S236;
Region where S237, setting second square is the Minimum Area that a character is covered in the picture;
S3, in the size range of the picture, scale the region;Specially:
S31, recognize the corresponding region of all characters in the picture according to step S1 to S2, obtains the first character zone Set;
S32, in the size range of the picture, equal proportion scales all areas in the first character zone set Domain, obtains the second character zone set;
S33, the width for obtaining region in the second character zone set, obtain character duration;
S34, according to the character duration and picture width calculation obtain the number of characters of every a line;
S35, the number of characters display character according to described every a line.
In conclusion the method and terminal of a kind of scale characters provided by the invention, will by the average gray value of picture Pixel in picture is divided into background parts and character portion, and one word of covering is identified according to the pixel for belonging to character portion The Minimum Area of symbol, and the Minimum Area that exoergic enough covers a character is inside contracted in the size range of picture, so as to fulfill in picture Word in the case of size constancy in scaling pictures, improves the compatibility with different resolution equipment, improves user experience. Further, the pixel in picture is divided into by character portion and background parts by the average gray value of picture, can dropped The interference of low noise, improves the accuracy for recognizing the Minimum Area that can cover a character.Further, by the way that word will be belonged to The pixel of symbol part is arranged to black, the pixel for belonging to background parts is arranged to white so that in the mistake of scanned picture Cheng Zhongke directly judges whether the pixel belongs to character portion according to the color of pixel, and a character can be covered by improving identification Minimum Area efficiency.Further, the average gray value of the 3rd square of the second square is more than by area to be obtained The pixel for whether also existing near the second square border and belonging to character portion is known, if in the presence of continuing to scan on character portion Point, if being not present, the second square is the Minimum Area that can cover a character, and a character can be covered by improving identification The accuracy of Minimum Area.Further, effectively avoid omitting the pixel for belonging to character portion.Further, realize and only contract The character portion in picture is put, without changing background parts in picture.Further, self-adaption typesetting during scaling, is improved Compatibility.
The foregoing is merely the embodiment of the present invention, is not intended to limit the scope of the invention, every to utilize this hair The equivalents that bright specification and accompanying drawing content are made, are directly or indirectly used in relevant technical field, similarly include In the scope of patent protection of the present invention.

Claims (12)

  1. A kind of 1. method of scale characters, it is characterised in that including:
    S1, the average gray value for calculating picture, obtain the first average gray value;
    S2, identify the Minimum Area that a character is covered in the picture according to first average gray value;
    S3, in the size range of the picture, scale the region.
  2. 2. the method for scale characters according to claim 1, it is characterised in that the S2 is specially:
    The pixel that gray value in the picture is less than first average gray value is obtained, obtains character pixels point set;
    The Minimum Area that a character is covered in the picture is identified according to the character pixels point set.
  3. 3. the method for scale characters according to claim 2, it is characterised in that identified according to the character pixels point set The Minimum Area of a character is covered in the picture, is specially:
    S21, preset the initial length of side;
    The color of each pixel is black in S22, the setting character pixels point set;
    The color of other pixels in S23, the setting picture in addition to the character pixels point set is white;
    A pixel in S24, the acquisition character pixels point set, obtains vertex pixel;
    It is square that S25, the top left corner apex using the vertex pixel as square draw corresponding with the initially length of side first Shape;
    S26, obtain the point for being less than pre-determined distance with the distance of the vertex pixel, obtains the second pixel point set;
    S27, when including black pixel point in the second pixel point set, and the abscissa of the black pixel point be less than it is described During the abscissa of one pixel, it is vertex pixel to update the black pixel point, and using the black pixel point as square Top left corner apex to draw corresponding with the initial length of side second square;When including black in the second pixel point set Pixel, and the ordinate of the black pixel point be less than a pixel ordinate when, update the black pixel point For vertex pixel, and the top left corner apex using the black pixel point as square draws corresponding with the initially length of side the Two squares;
    S28, repeat step S26 to S27, until black pixel point is not present in the second pixel point set;
    Region where S29, setting second square is the Minimum Area that a character is covered in the picture.
  4. 4. the method for scale characters according to claim 3, it is characterised in that before the S29, further include:
    Preset initial value and end value;
    The average gray value in the described second square region is calculated, obtains the second average gray value;
    The central pixel point of second square is obtained, obtains central point;
    Default first length of side, first length of side are more than the initial length of side;
    Sa, draw the 3rd square corresponding with first length of side centered on the central point;
    Average gray value in Sb, the described 3rd square region of calculating, obtains the 3rd average gray value;
    When the 3rd average gray value is less than second average gray value, first length of side is increased into the default length of side Value;The initial value adds one;If the initial value is less than the end value, step Sa to Sb is repeated;Otherwise, step is performed Rapid S29;
    When the 3rd average gray value is more than second average gray value, step S24 to S29 is performed.
  5. 5. the method for scale characters according to claim 3, it is characterised in that the S24 is specially:
    The one-row pixels point not being scanned in the picture is obtained according to order from top to bottom;
    The pixel not being scanned in the one-row pixels point is obtained according to order from left to right;
    It is vertex pixel to set a pixel.
  6. 6. the method for scale characters according to claim 1, it is characterised in that the S3 is specially:
    The corresponding region of all characters in the picture is recognized according to step S1 to S2, obtains the first character zone set;
    In the size range of the picture, equal proportion scales all areas in the first character zone set, obtains the Two character zone set.
  7. 7. the method for scale characters according to claim 6, it is characterised in that equal proportion scales first character zone All areas in set, after obtaining the second character zone set, further include:
    The width in region in the second character zone set is obtained, obtains character duration;
    The number of characters of every a line is obtained according to the character duration and picture width calculation;
    Character is shown according to the number of characters per a line.
  8. 8. a kind of terminal of scale characters, it is characterised in that including one or more processors and memory, the memory is deposited Program is contained, and is configured to perform following steps by one or more of processors:
    S1, the average gray value for calculating picture, obtain the first average gray value;
    S2, identify the Minimum Area that a character is covered in the picture according to first average gray value;
    S3, in the size range of the picture, scale the region.
  9. 9. the terminal of scale characters according to claim 8, it is characterised in that the S2 is specially:
    The pixel that gray value in the picture is less than first average gray value is obtained, obtains character pixels point set;
    The Minimum Area that a character is covered in the picture is identified according to the character pixels point set.
  10. 10. the terminal of scale characters according to claim 9, it is characterised in that known according to the character pixels point set The Minimum Area of a character is covered in not described picture, is specially:
    S21, preset the initial length of side;
    The color of each pixel is black in S22, the setting character pixels point set;
    The color of other pixels in S23, the setting picture in addition to the character pixels point set is white;
    A pixel in S24, the acquisition character pixels point set, obtains vertex pixel;Specially:According to from top to bottom Order obtain the one-row pixels point not being scanned in the picture;The one-row pixels are obtained according to order from left to right The pixel not being scanned in point;It is vertex pixel to set a pixel;
    It is square that S25, the top left corner apex using the vertex pixel as square draw corresponding with the initially length of side first Shape;
    S26, obtain the point for being less than pre-determined distance with the distance of the vertex pixel, obtains the second pixel point set;
    S27, when including black pixel point in the second pixel point set, and the abscissa of the black pixel point be less than it is described During the abscissa of one pixel, it is vertex pixel to update the black pixel point, and using the black pixel point as square Top left corner apex to draw corresponding with the initial length of side second square;When including black in the second pixel point set Pixel, and the ordinate of the black pixel point be less than a pixel ordinate when, update the black pixel point For vertex pixel, and the top left corner apex using the black pixel point as square draws corresponding with the initially length of side the Two squares;
    S28, repeat step S26 to S27, until black pixel point is not present in the second pixel point set;
    Region where S29, setting second square is the Minimum Area that a character is covered in the picture.
  11. 11. the terminal of scale characters according to claim 10, it is characterised in that before the S29, further include:
    Preset initial value and end value;
    The average gray value in the described second square region is calculated, obtains the second average gray value;
    The central pixel point of second square is obtained, obtains central point;
    Default first length of side, first length of side are more than the initial length of side;
    Sa, draw the 3rd square corresponding with first length of side centered on the central point;
    Average gray value in Sb, the described 3rd square region of calculating, obtains the 3rd average gray value;
    When the 3rd average gray value is less than second average gray value, first length of side is increased into the default length of side Value;The initial value adds one;If the initial value is less than the end value, step Sa to Sb is repeated;Otherwise, step is performed Rapid S29;
    When the 3rd average gray value is more than second average gray value, step S24 to S29 is performed.
  12. 12. the terminal of scale characters according to claim 8, it is characterised in that the S3 is specially:
    The corresponding region of all characters in the picture is recognized according to step S1 to S2, obtains the first character zone set;
    In the size range of the picture, equal proportion scales all areas in the first character zone set, obtains the Two character zone set;
    The width in region in the second character zone set is obtained, obtains character duration;
    The number of characters of every a line is obtained according to the character duration and picture width calculation;
    Character is shown according to the number of characters per a line.
CN201711017192.7A 2017-10-26 2017-10-26 Method and terminal for scaling characters Active CN107944449B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711017192.7A CN107944449B (en) 2017-10-26 2017-10-26 Method and terminal for scaling characters

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711017192.7A CN107944449B (en) 2017-10-26 2017-10-26 Method and terminal for scaling characters

Publications (2)

Publication Number Publication Date
CN107944449A true CN107944449A (en) 2018-04-20
CN107944449B CN107944449B (en) 2020-08-18

Family

ID=61935681

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711017192.7A Active CN107944449B (en) 2017-10-26 2017-10-26 Method and terminal for scaling characters

Country Status (1)

Country Link
CN (1) CN107944449B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101052182A (en) * 2007-03-27 2007-10-10 华为技术有限公司 Method, device and terminal for realizing content display
CN104036272A (en) * 2014-06-24 2014-09-10 联想(北京)有限公司 Text detection method and electronic device
CN104700357A (en) * 2015-04-14 2015-06-10 华东理工大学 Chinese character image zooming method based on bilinear operator
CN106127206A (en) * 2016-06-28 2016-11-16 北京智芯原动科技有限公司 The vertical angles detection method of a kind of car plate and device
US20170075547A1 (en) * 2015-09-15 2017-03-16 Google Inc. Systems and methods for determining application zoom levels

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101052182A (en) * 2007-03-27 2007-10-10 华为技术有限公司 Method, device and terminal for realizing content display
CN104036272A (en) * 2014-06-24 2014-09-10 联想(北京)有限公司 Text detection method and electronic device
CN104700357A (en) * 2015-04-14 2015-06-10 华东理工大学 Chinese character image zooming method based on bilinear operator
US20170075547A1 (en) * 2015-09-15 2017-03-16 Google Inc. Systems and methods for determining application zoom levels
CN106127206A (en) * 2016-06-28 2016-11-16 北京智芯原动科技有限公司 The vertical angles detection method of a kind of car plate and device

Also Published As

Publication number Publication date
CN107944449B (en) 2020-08-18

Similar Documents

Publication Publication Date Title
CN110390269B (en) PDF document table extraction method, device, equipment and computer readable storage medium
CN102567300B (en) Picture document processing method and device
US9055384B2 (en) Adaptive thresholding for image recognition
JP6396605B2 (en) Region extraction method and apparatus
CN107977659B (en) Character recognition method and device and electronic equipment
WO2019085971A1 (en) Method and apparatus for positioning text over image, electronic device, and storage medium
KR102271285B1 (en) Image processing apparatus and method for processing image
JP2016201126A (en) Detection of label from image
CN105320933B (en) Electronic document generating system and electronic document generation device
CN105320248A (en) Mid-air gesture input method and device
CN102737238A (en) Gesture motion-based character recognition system and character recognition method, and application thereof
CN104598907B (en) Lteral data extracting method in a kind of image based on stroke width figure
CN108830133A (en) Recognition methods, electronic device and the readable storage medium storing program for executing of contract image picture
CN110674811B (en) Image recognition method and device
CN104361335B (en) A kind of processing method that black surround is automatically removed based on scan image
CN109858409A (en) Manual figure conversion method, device, equipment and medium
CN104766354A (en) Method for augmented reality drawing and mobile terminal
JP2017535891A (en) Method and apparatus for detecting text
JP2016027444A5 (en)
CN202093528U (en) Character recognition system and translation system based on gestures
CN107797972A (en) A kind of method and terminal for showing character
CN106682670A (en) Method and system for identifying station caption
US20150269748A1 (en) Flesh color detection condition determining apparatus, and flesh color detection condition determining method
CN107944449A (en) The method and terminal of a kind of scale characters
CN111008987A (en) Method and device for extracting edge image based on gray background and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant