CN105389165B - Document picture display method and device and terminal - Google Patents

Document picture display method and device and terminal Download PDF

Info

Publication number
CN105389165B
CN105389165B CN201510696302.1A CN201510696302A CN105389165B CN 105389165 B CN105389165 B CN 105389165B CN 201510696302 A CN201510696302 A CN 201510696302A CN 105389165 B CN105389165 B CN 105389165B
Authority
CN
China
Prior art keywords
picture
document
document picture
coordinate
extended area
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.)
Active
Application number
CN201510696302.1A
Other languages
Chinese (zh)
Other versions
CN105389165A (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.)
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shirui Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shirui Electronics Co Ltd
Priority to CN201510696302.1A priority Critical patent/CN105389165B/en
Publication of CN105389165A publication Critical patent/CN105389165A/en
Priority to PCT/CN2016/093104 priority patent/WO2017067275A1/en
Application granted granted Critical
Publication of CN105389165B publication Critical patent/CN105389165B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • G06V10/225Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition based on a marking or identifier characterising the area

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Editing Of Facsimile Originals (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a document picture display method, which comprises the following steps: reading a document picture to be displayed; carrying out edge detection on the document picture by using an edge detection algorithm to obtain a content display area of the document picture, wherein the content display area is rectangular; translating the four boundaries of the content display area by a preset distance along the direction far away from the center of the document picture to obtain an expanded area; extracting the overlapping part of the extended area and the document picture to obtain a display picture; and displaying the display picture. The invention also discloses a document picture display device and a terminal. According to the invention, the display range of the document picture is adaptively adjusted, so that better reading experience is provided for a user.

Description

A kind of document image display method, device and terminal
Technical field
The present invention relates to field of image processing more particularly to a kind of document image display methods, device and terminal.
Background technique
In mobile terminal when reading documents, ocr software is generally only simply to open document in a manner of picture and be in Now give user.However during document compiling, some documents can have the blank boundary of larger area, to cause in reality The region of appearance is smaller, and then leads to text importing in actual content region also very little, and reading to user makes troubles.Especially When user also needed when reading interested region by manual operation the text in interested region is amplified, use Family reading experience is poor.
Summary of the invention
In view of the above-mentioned problems, being used for the purpose of the present invention is to provide a kind of document image display method, device and terminal Adaptive adjustment is carried out to the indication range of document picture, to improve the reading experience of user.
The embodiment of the present invention provides a kind of document image display method, includes the following steps:
Read document picture to be shown;
Edge detection is carried out to the document picture using edge detection algorithm, the content for obtaining the document picture is shown Region, wherein the content display region is in rectangle;
Direction translation by four edges circle of the content display region along the center far from the document picture is scheduled Distance obtains extended area;
The lap of the extended area Yu the document picture is extracted, display picture is obtained;
Show the display picture.
As an improvement of the above scheme, described that edge detection is carried out to the document picture using edge detection algorithm, it obtains The content display region for obtaining the document picture, specifically includes:
The document picture is scanned by the way of transversal scanning from left to right, obtains the picture of first with preceding single pass The gray value differences of vegetarian refreshments are greater than the coordinate of the pixel of preset threshold, and generate one by the coordinate and hang down with scanning direction Straight left margin;
The document picture is scanned by the way of transversal scanning from right to left, obtains the picture of first with preceding single pass The gray value differences of vegetarian refreshments are greater than the coordinate of the pixel of preset threshold, and generate one by the coordinate and hang down with scanning direction Straight right margin;
The document picture is scanned by the way of longitudinal scanning from top to bottom, obtains the picture of first with preceding single pass The gray value differences of vegetarian refreshments are greater than the coordinate of the pixel of preset threshold, and generate one by the coordinate and hang down with scanning direction Straight coboundary;
The document picture is scanned by the way of longitudinal scanning from bottom to up, obtains the picture of first with preceding single pass The gray value differences of vegetarian refreshments are greater than the coordinate of the pixel of preset threshold, and generate one by the coordinate and hang down with scanning direction Straight lower boundary;
According to the region that the left margin, right margin, coboundary and lower boundary are surrounded, content display region is obtained.
As an improvement of the above scheme, the scheduled distance is 0, the extended area and the content display region phase Together.
As an improvement of the above scheme, the scheduled distance is greater than 0, then four by the content display region Boundary translates scheduled distance along the direction at the center far from the document picture, obtains extended area, specifically:
Four edges circle of the content display region are put down along the direction at the center far from the content display region respectively Scheduled distance is moved, four boundaries after translation, and the region being surrounded according to the boundary after this four translations are obtained, Obtain extended area.
As an improvement of the above scheme, the scheduled distance is greater than 0, then four by the content display region Boundary translates scheduled distance along the direction at the center far from the document picture, obtains extended area, specifically:
Obtain the initial coordinate on four vertex of the content display region;
According to the distance that four edges circle of the content display region translate, four vertex are calculated after movement Coordinates of targets;
The coordinates of targets is connected, a new rectangle is generated, obtains extended area.
As an improvement of the above scheme, the lap for extracting the extended area and the document picture, obtains Show picture, comprising:
Four edges circle of the extended area are obtained at a distance from the center of the document picture and the document picture Four edges circle are at a distance from the center of the document picture;Wherein, four edges circle be coboundary, lower boundary, left margin and Right margin;
More corresponding boundary obtains the closer coboundary of centre distance apart from the document picture, lower boundary, the left side Boundary and right margin;Wherein, the coboundary of the extended area is corresponding with the coboundary of the document picture, the extended area Lower boundary is corresponding with the lower boundary of the document picture, the left margin pair of the left margin of the extended area and the document picture It answers, the right margin of the extended area is corresponding with the right margin of the document picture;
It cuts out described in acquisition that four edges circle surround the rectangular area to be formed up and down from the document map on piece, obtains It must show picture.
The embodiment of the present invention also provides a kind of document image display apparatus, comprising:
Reading unit, for reading document picture to be shown;
Detection unit obtains the document for carrying out edge detection to the document picture using edge detection algorithm The content display region of picture, wherein the content display region is in rectangle;
Expanding element, for the side by four edges circle of the content display region along the center far from the document picture To scheduled distance is translated, extended area is obtained;
Extraction unit obtains display picture for extracting the lap of the extended area Yu the document picture;
Display unit, for showing the display picture.
As an improvement of the above scheme, the detection unit, specifically includes:
First scanning element obtains first for scanning the document picture by the way of transversal scanning from left to right A gray value differences with the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate described in a process Coordinate and the left margin vertical with scanning direction;
Second scanning element obtains first for scanning the document picture by the way of transversal scanning from right to left A gray value differences with the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate described in a process Coordinate and the right margin vertical with scanning direction;
Third scanning element obtains first for scanning the document picture by the way of longitudinal scanning from top to bottom A gray value differences with the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate described in a process Coordinate and the coboundary vertical with scanning direction;
4th scanning element obtains first for scanning the document picture by the way of longitudinal scanning from bottom to up A gray value differences with the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate described in a process Coordinate and the lower boundary vertical with scanning direction;
Unit is surrounded, with the region being surrounded according to the left margin, right margin, coboundary and lower boundary, in acquisition Hold display area.
As an improvement of the above scheme, the scheduled distance is 0, the extended area and the content display region phase Together.
As an improvement of the above scheme, the scheduled distance is greater than 0, then the expanding element is specifically used for, and respectively will Four edges circle of the content display region translate scheduled distance along the direction at the center far from the content display region, obtain Four boundaries after translation, and the region being surrounded according to the boundary line after this four translations are obtained, extended area is obtained.
As an improvement of the above scheme, the scheduled distance is greater than 0, then the expanding element, comprising:
Initial coordinate acquiring unit, the initial coordinate on four vertex for obtaining the content display region;
Coordinates of targets acquiring unit, the distance for being translated according to four edges circle of the content display region calculate institute State coordinates of targets of four vertex after movement;
Connection unit generates a new rectangle, obtains extended area for connecting the coordinates of targets.
As an improvement of the above scheme, the extraction unit, comprising:
Distance acquiring unit, for obtaining four edges circle of the extended area at a distance from the center of the document picture And four edges circle of the document picture are at a distance from the center of the document picture;Wherein, four edges circle be coboundary, Lower boundary, left margin and right margin;
Comparing unit is used for more corresponding boundary, obtains the closer top of centre distance apart from the document picture Boundary, lower boundary, left margin and right margin;Wherein, the coboundary of the extended area is corresponding with the coboundary of the document picture, The lower boundary of the extended area is corresponding with the lower boundary of the document picture, the left margin of the extended area and the document The left margin of picture is corresponding, and the right margin of the extended area is corresponding with the right margin of the document picture;
Unit is cut, surrounds for cutting out described in acquisition four edges circle up and down from the document map on piece to be formed Rectangular area, obtain display picture.
The embodiment of the present invention also provides a kind of terminal, including above-mentioned document image display apparatus.
Document image display method, device and terminal provided in an embodiment of the present invention, by being obtained using edge detection algorithm The document picture content display region, then after being adjusted by the boundary to the content display region, generate most Whole display picture.Since the size on the boundary of the display picture is adaptive generation, it is ensured that the content display area The domain ratio shared in display is reasonable, the reading of appropriate user, to give the preferable document reading experience of user.
Detailed description of the invention
In order to illustrate more clearly of technical solution of the present invention, attached drawing needed in embodiment will be made below Simply introduce, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow diagram for the document image display method that first embodiment of the invention provides.
Fig. 2 is the schematic diagram that content display region is obtained in document picture.
Fig. 3 is a kind of schematic diagram that the gray value of the pixel of acquisition is scanned to document picture.
Fig. 4 is that a kind of schematic diagram for obtaining extended area is extended to content display region.
Fig. 5 is that another schematic diagram for obtaining extended area is extended to content display region.
Fig. 6 is the structural schematic diagram for the document image display apparatus that second embodiment of the invention provides.
Fig. 7 is a kind of structural schematic diagram of detection unit shown in fig. 6.
Fig. 8 is a kind of structural schematic diagram of expanding element shown in fig. 6.
Fig. 9 is a kind of structural schematic diagram of extraction unit shown in fig. 6.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The embodiment of the present invention provides a kind of document image display method, device and terminal, for the display to document picture Range is adjusted, so that user obtains preferably reading experience, is described in detail individually below.
Referring to Fig. 1, Fig. 1 is the flow diagram for the document image display method that first embodiment of the invention provides.Institute Stating document image display method can be executed by document image display apparatus, and include at least step S101 to S105.
S101 reads document picture to be shown.
Referring to Figure 2 together, in embodiments of the present invention, the document image display apparatus can receive various documents (such as The document of PPT or PDF format), and these documents are converted into picture format, then the picture being converted to will be split Afterwards, at least independent document picture 100 of one page is obtained.For example, it is assumed that described document itself includes the PPT of page 10, then the document Image display apparatus can be according to the corresponding document picture 100 of page 10 of the document structure tree.
In embodiments of the present invention, after generating the document picture 100, the document picture 100 is shown when receiving Instruction when, the document image display apparatus reads document picture 100 to be shown.
S102 carries out edge detection to the document picture using edge detection algorithm, obtains the interior of the document picture Hold display area, wherein the content display region is in rectangle.
As shown in Fig. 2, in embodiments of the present invention, due to that may have the blank on the boundary of partial document picture 100 Region 10 is more, and the ratio that textual display portion accounts for is smaller and causes the reading experience of user bad, thus needs to the text The indication range processing of shelves picture 100, so that user obtains preferable reading experience.Specifically:
S1021 scans the document picture by the way of transversal scanning from left to right, obtains first and once sweeps with preceding The gray value differences for the pixel retouched be greater than preset threshold pixel coordinate, and generate one by the coordinate and with scanning The vertical left margin in direction.
In embodiments of the present invention, the document image display apparatus scans institute by the way of scanning from left to right first Document picture 100 is stated, obtains the gray value of the pixel in scan path, and obtain the pixel of first with preceding single pass Gray value differences be greater than preset threshold pixel coordinate.For example, as shown in Figure 3, it is assumed that Fig. 3 is that the document picture is shown The gray value for one group of pixel that certain a line that device scans the document picture 100 obtains.The threshold value is set as 50, then from Fig. 3 is it is found that the gray value differences for the pixel that the pixel and gray value that gray value is 237 are 34 are greater than the threshold value, at this point, institute State document image display apparatus obtain gray value be 34 pixel coordinate, and generate one by the coordinate and perpendicular to The left margin of the scanning direction.
S1022 scans the document picture by the way of transversal scanning from right to left, obtains first and once sweeps with preceding The gray value differences for the pixel retouched be greater than preset threshold pixel coordinate, and generate one by the coordinate and with scanning The vertical right margin in direction.
S1023 scans the document picture by the way of longitudinal scanning from top to bottom, obtains first and once sweeps with preceding The gray value differences for the pixel retouched be greater than preset threshold pixel coordinate, and generate one by the coordinate and with scanning The vertical coboundary in direction.
S1024 scans the document picture by the way of longitudinal scanning from bottom to up, obtains first and once sweeps with preceding The gray value differences for the pixel retouched be greater than preset threshold pixel coordinate, and generate one by the coordinate and with scanning The vertical lower boundary in direction.
S1025 obtains content and shows according to the region that the left margin, right margin, coboundary and lower boundary are surrounded Region.
Referring to Fig. 2, in embodiments of the present invention, left margin that the document image display apparatus is obtained according to scanning, The region that right margin, coboundary and lower boundary are surrounded obtains the content display region 20.
It should be noted that in other embodiments of the present invention, others can also be used in the document image display apparatus Edge detection algorithm obtains the content display region 20, such as Sobel edge detection algorithm, Robert edge detection algorithm, Prewitt edge detection algorithm, Laplacian edge detection algorithm, Canny edge detection algorithm etc., since these edges are examined Method of determining and calculating is all techniques known, thus the present invention does not do specific description herein, but is calculated according to these edge detections Method obtains the scheme of the content display region 20 also within protection scope of the present invention.
S103 translates four edges circle of the content display region in advance along the direction at the center far from the document picture Fixed distance obtains extended area.
Referring to Figure 4 together, in embodiments of the present invention, after obtaining the content display region 20, the document map Sheet display device also needs to be extended the content display region 20, certain in the surrounding addition of the content display region 20 The white space of size, to guarantee the reading experience of user.
Specifically, in one embodiment,
The document image display apparatus is respectively by four edges circle of the content display region 20 along far from the document The direction at the center of picture translates scheduled distance, obtains four boundaries after translation, and according to this four translations after The region that boundary line is surrounded obtains the extended area 30.
In another embodiment,
The document image display apparatus obtains the initial coordinate on four vertex of the content display region 20, further according to The distance of the four edges circle translation of the content display region 20, calculates coordinates of targets of four vertex after movement, The coordinates of targets is finally connected, a new rectangle is generated, obtains the extended area 30.
For example, using the upper left corner of the document picture 100 as coordinate origin, it is assumed that the upper left of the content display region 20 The initial coordinate at angle is (x1, y1), the initial coordinate in the upper right corner is (x2, y1), the initial coordinate in the lower left corner is (x1, y2) lower right corner Initial coordinate be (x2, y2), and the distance of the four edges circle translation of the content display region 20 is D, four tops The coordinates of targets of point are as follows: top left co-ordinate is (x1- D, y1- D), the coordinate in the upper right corner is (x2+ D, y1- D), lower-left angular coordinate is (x1- D, y2+ D), the coordinate in the lower right corner is (x2+ D, y2+D).At this point, connection four coordinates of targets, generate a new square Shape can be obtained the extended area 30.
It should be noted that the distance of the four edges circle translation of the content display region 20 can phase in above-described embodiment Together, can also be different, the present invention is not specifically limited.
In addition, in another embodiment of the present invention, the distance of the four edges circle translation may be alternatively provided as 0, that is, exist In this case, the extended area 30 is identical with the content display region 20, these schemes are in guarantor of the invention Within the scope of shield.
S104 extracts the lap of the extended area Yu the document picture, obtains display picture.
Referring to Figure 4 together and extended area 30 described in Fig. 5, Fig. 4 be fully located at the document picture 100 range it It is interior, at this point, cutting out the extended area 30 can be obtained the display picture 40.But in some implementations of the invention, institute State document picture 100 itself blank boundary may also can be smaller, at this time the extended area 30 might have part is more than The boundary (as shown in Figure 5) of the document picture 100, thus need to the extended area 30 and the document picture 100 Size is compared, and obtains the lap of the two, to obtain display picture 40.
Specifically, the document image display apparatus can by execute following steps obtain the extended area 30 with it is described The lap of document picture 100:
S1041 obtains four edges circle of the extended area at a distance from the center of the document picture and the document Four edges circle of picture are at a distance from the center of the document picture;Wherein, four edges circle are coboundary, lower boundary, a left side Boundary and right margin.
S1042, more corresponding boundary obtain the closer coboundary of centre distance apart from the document picture, following Boundary, left margin and right margin.
Wherein, the coboundary of the extended area is corresponding with the coboundary of the document picture, under the extended area Boundary is corresponding with the lower boundary of the document picture, the left margin pair of the left margin of the extended area and the document picture It answers, the right margin of the extended area is corresponding with the right margin of the document picture.
S1043, cuts out described in acquisition that four edges circle surround the rectangle to be formed up and down from the document map on piece Region obtains display picture.
For example, as shown in figure 5,30 coboundary of extended area is apart from institute in four edges circle of the extended area 30 The distance for stating the center of document picture 100 is greater than center of the coboundary of the document picture 100 apart from the document picture 100 Distance.And the distance at the center of other lower boundaries, left margin, right margin apart from the document picture 100 is respectively less than described The distance at center of the lower boundary, left margin, right margin of document picture 100 apart from the document picture 100.At this point, the expansion The coboundary in exhibition section domain 30, it is described that lower boundary, left margin, the right margin of the document picture 100, which surround the region to be formed, The lap of extended area 30 and the document picture 100, the document image display apparatus is by cutting out the overlapping Part obtains display picture 40.
S105 shows the display picture.
In embodiments of the present invention, the document image display apparatus shows the display picture 40, and user can pass through Picture 40 is shown described in screen reading.
It should be noted that in embodiments of the present invention, the document image display apparatus is obtaining the display picture After 40, the display picture 40 is also saved, so that the document image display apparatus can be directly read and institute in subsequent operation Display picture 40 is stated, without using above-mentioned cutting process.
Document image display method provided in an embodiment of the present invention, by obtaining the document map using edge detection algorithm The content display region 20 of piece 100, then after being adjusted by the boundary to the content display region 20 generates final aobvious Diagram piece 40.Since the size on the boundary of the display picture 40 is adaptive generation, it is ensured that the content display region 20 in display shared ratio it is reasonable, the reading of appropriate user, to give the preferable document reading experience of user.
Referring to Figure 6 together, Fig. 6 is the structural representation for the document image display apparatus that second embodiment of the invention provides Figure.The document image display apparatus 200 can be used for executing document image display method described in any of the above-described embodiment, described Document image display apparatus 200 includes reading unit 210, detection unit 220, expanding element 230, extraction unit 240 and display Unit 250, in which:
The reading unit 210, for reading document picture to be shown.
Referring to Figure 2 together, in embodiments of the present invention, the document image display apparatus 200 can receive various documents (document of such as PPT or PDF format), and these documents are converted into picture format, then the picture being converted to will be carried out After fractionation, at least independent document picture 100 of one page is obtained.For example, it is assumed that described document itself includes the PPT of page 10, then it is described Document image display apparatus 200 can be according to the corresponding document picture of page 10 of the document structure tree.
In embodiments of the present invention, after generating the document picture 100, when receiving the finger for showing the document picture When enabling, the reading unit 210 reads document picture 100 to be shown.
The detection unit 220 obtains institute for carrying out edge detection to the document picture using edge detection algorithm State the content display region of document picture, wherein the content display region is in rectangle.
Referring to Fig. 2, in embodiments of the present invention, due to that may have the blank on the boundary of partial document picture 100 Region 10 is more, and the ratio that textual display portion accounts for is smaller and causes the reading experience of user bad, thus the detection unit 220 need that the indication range of the document picture 100 is adjusted, so that user obtains preferable reading experience, specifically, Referring to Figure 7 together, the detection unit 220 can include:
First scanning element 221 obtains for scanning the document picture by the way of transversal scanning from left to right The gray value differences of one and the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate one and pass through institute State coordinate and the left margin vertical with scanning direction.
Second scanning element 222 obtains for scanning the document picture by the way of transversal scanning from right to left The gray value differences of one and the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate one and pass through institute State coordinate and the right margin vertical with scanning direction.
Third scanning element 223 obtains for scanning the document picture by the way of longitudinal scanning from top to bottom The gray value differences of one and the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate one and pass through institute State coordinate and the coboundary vertical with scanning direction.
4th scanning element 224 obtains for scanning the document picture by the way of longitudinal scanning from bottom to up The gray value differences of one and the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate one and pass through institute State coordinate and the lower boundary vertical with scanning direction.
Unit 225 is surrounded, with the region being surrounded according to the left margin, right margin, coboundary and lower boundary, is obtained Content display region.
It should be noted that in other embodiments of the present invention, other edge inspections can also be used in the detection unit 220 Method of determining and calculating obtains the content display region 20, such as Sobel edge detection algorithm, Robert edge detection algorithm, Prewitt Edge detection algorithm, Laplacian edge detection algorithm, Canny edge detection algorithm etc., all due to these edge detection algorithms It is techniques known, thus the present invention does not do specific description herein, but is obtained according to these edge detection algorithms The scheme of the content display region 20 is also within protection scope of the present invention.
The expanding element 230, for by four edges circle of the content display region along far from the document picture The direction at center translates scheduled distance, obtains extended area.
Referring to Figure 4 together, in embodiments of the present invention, after obtaining the content display region 20, the extension is single Member 230 also needs to be extended the content display region 20, adds certain size in the surrounding of the content display region 20 White space, to improve the reading experience of user.
Specifically, in one embodiment,
The expanding element 230 is respectively by four edges circle of the content display region 20 along the separate document picture The direction at center translates scheduled distance, obtains four boundaries after translation, and according to the boundary line after this four translations The region being surrounded obtains the extended area 30.
Also referring to Fig. 8, in one embodiment,
The expanding element 230 can include:
Initial coordinate acquiring unit 231, the initial coordinate on four vertex for obtaining the content display region 20.
Coordinates of targets acquiring unit 232, the distance for being translated according to four edges circle of the content display region 20, meter Calculate coordinates of targets of four vertex after movement.
Connection unit 233 generates a new rectangle, is extended for connecting the coordinates of targets on four vertex Region 30.
For example, the initial coordinate acquiring unit 231 is successively using the upper left corner of the document picture 100 as coordinate origin The initial coordinate for obtaining the upper left corner of the content display region 20 is (x1, y1), the initial coordinate in the upper right corner is (x2, y1), it is left The initial coordinate of inferior horn is (x1, y2) lower right corner initial coordinate be (x2, y2), it is assumed that four of the content display region 20 The distance of boundary translation is D, then the coordinates of targets acquiring unit 231 is by obtaining the target on four vertex after calculating Coordinate: top left co-ordinate is (x1- D, y1- D), the coordinate in the upper right corner is (x2+ D, y1- D), lower-left angular coordinate is (x1- D, y2+ D), The coordinate in the lower right corner is (x2+ D, y2+D).At this point, the connection unit 233 connects the coordinates of targets on four vertex, generate One new rectangle can be obtained the extended area 30.
It should be noted that the distance of the four edges circle translation of the content display region 20 can phase in above-described embodiment Together, can also be different, the present invention is not specifically limited.
In addition, in another embodiment of the present invention, the distance of the four edges circle translation may be alternatively provided as 0, that is, exist In this case, the extended area 30 is identical with the content display region 20, these schemes are in guarantor of the invention Within the scope of shield.
The extraction unit 240 is shown for extracting the lap of the extended area Yu the document picture Picture.
Referring to Figure 4 together and extended area 30 described in Fig. 5, Fig. 4 be fully located at the document picture 100 range it It is interior, at this point, cutting out the extended area 30 can be obtained display picture 40.But it is in some embodiments of the invention, described Extended area 30 might have the size (as shown in Figure 5) that part is more than the document picture 100, thus need to the extension The size of region 30 and the document picture 100 is compared, and obtains the lap of the two, to obtain display picture 40.
Specifically, also referring to Fig. 9, the extraction unit 240 includes:
Distance acquiring unit 241, for obtaining four edges circle of the extended area and the center of the document picture Four edges circle of distance and the document picture are at a distance from the center of the document picture.
Wherein, four edges circle include coboundary, lower boundary, left margin and right margin;
Comparing unit 242 is used for more corresponding boundary, obtain centre distance apart from the document picture it is closer on Boundary, lower boundary, left margin and right margin.
Wherein, the coboundary of the extended area is corresponding with the coboundary of the document picture, under the extended area Boundary is corresponding with the lower boundary of the document picture, the left margin pair of the left margin of the extended area and the document picture It answers, the right margin of the extended area is corresponding with the right margin of the document picture.
Unit 243 is cut, four edges circle surround up and down for cutting out described in acquisition from the document map on piece The rectangular area of formation obtains display picture.
The display unit 250, for showing the display picture.
In embodiments of the present invention, the document image display apparatus shows the display picture 40, and user can pass through Picture 40 is shown described in screen reading.
It should be noted that in embodiments of the present invention, the document image display apparatus 200 is obtaining the display figure After piece 40, the display picture 40 is also saved, so that the document image display apparatus 200 can directly be read in subsequent operation It takes and the display picture 40, without using above-mentioned cutting process.
In conclusion document image display apparatus 200 provided in an embodiment of the present invention, by being obtained using detection unit 220 The content display region 20 of the document picture 100 is obtained, then by the expanding element 230 and extraction unit 240 to described interior After the boundary of appearance display area 20 is adjusted, final display picture 40 is generated.Due to the boundary for showing picture 40 Size is adaptive generation, it is ensured that the content display region 20 ratio shared when on the screen of display is reasonable, fits The reading of suitable user, to give the preferable document reading experience of user.
The embodiment of the present invention also provides a kind of terminal, and the terminal includes that document picture described in any of the above-described embodiment is aobvious Showing device, wherein the terminal can also be able to be various such as smart phone, tablet computer or laptop for mobile terminal Reading terminal etc., the present invention is not specifically limited.
Terminal provided in an embodiment of the present invention, it is aobvious by the content for obtaining the document picture 100 using detection unit 220 Show region 20, then the boundary of the content display region 20 is adjusted by the expanding element 230 and extraction unit 240 Afterwards, final display picture 40 is generated.Since the size on the boundary of the display picture 40 is adaptive generation, thus can protect It is reasonable to demonstrate,prove the content display region 20 ratio shared when on the screen of display, the reading of appropriate user, give user compared with Good document reading experience.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples It closes and combines.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the present invention, the meaning of " plurality " is at least two, such as two, three It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussed suitable Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang function, this should be of the invention Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass Defeated software is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print the software on it or other are suitable Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain the software, is then stored in computer storage.
In the above-described embodiment, multiple steps or method can be answered in memory and by suitably instructing to hold with storage Work as understanding, each section of the invention can be realized with hardware, software, firmware or their combination.The software that row system executes Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware Any one of column technology or their combination are realized: having a logic gates for realizing logic function to data-signal Discrete logic, with suitable combinational logic gate circuit specific integrated circuit, programmable gate array (PGA), scene Programmable gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by software, the software can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in a processing module It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above The embodiment of the present invention is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as to limit of the invention System, those skilled in the art can be changed above-described embodiment, modify, replace and become within the scope of the invention Type.

Claims (7)

1. a kind of document image display method, which comprises the steps of:
Read document picture to be shown;
Edge detection is carried out to the document picture using edge detection algorithm, obtains the content display area of the document picture Domain, wherein the content display region is in rectangle;
Four edges circle of the content display region are translated into scheduled distance along the direction at the center far from the document picture, Obtain extended area;
The lap of the extended area Yu the document picture is extracted, display picture is obtained;
Show the display picture;
The scheduled distance is greater than 0, then four edges circle by the content display region are along far from the document picture The direction at center translate scheduled distance, obtain extended area, specifically:
Four edges circle of the content display region are translated along the direction at the center far from the content display region respectively pre- Fixed distance obtains four boundaries after translation, and the region being surrounded according to the boundary after this four translations, obtains Extended area;Or,
The scheduled distance is greater than 0, then four edges circle by the content display region are along far from the document picture The direction at center translate scheduled distance, obtain extended area, specifically:
Obtain the initial coordinate on four vertex of the content display region;
According to the distance that four edges circle of the content display region translate, target of four vertex after movement is calculated Coordinate;
The coordinates of targets is connected, a new rectangle is generated, obtains extended area.
2. document image display method according to claim 1, which is characterized in that described to utilize edge detection algorithm to institute It states document picture and carries out edge detection, obtain the content display region of the document picture, specifically include:
The document picture is scanned by the way of transversal scanning from left to right, obtains the pixel of first with preceding single pass Gray value differences be greater than preset threshold pixel coordinate, and generate one by the coordinate and vertical with scanning direction Left margin;
The document picture is scanned by the way of transversal scanning from right to left, obtains the pixel of first with preceding single pass Gray value differences be greater than preset threshold pixel coordinate, and generate one by the coordinate and vertical with scanning direction Right margin;
The document picture is scanned by the way of longitudinal scanning from top to bottom, obtains the pixel of first with preceding single pass Gray value differences be greater than preset threshold pixel coordinate, and generate one by the coordinate and vertical with scanning direction Coboundary;
The document picture is scanned by the way of longitudinal scanning from bottom to up, obtains the pixel of first with preceding single pass Gray value differences be greater than preset threshold pixel coordinate, and generate one by the coordinate and vertical with scanning direction Lower boundary;
According to the region that the left margin, right margin, coboundary and lower boundary are surrounded, content display region is obtained.
3. according to claim 1 to document image display method described in 2 any one, which is characterized in that described in the extraction The lap of extended area and the document picture obtains display picture, comprising:
Four edges circle of the extended area are obtained at a distance from the center of the document picture and four of the document picture Boundary is at a distance from the center of the document picture;Wherein, four edges circle are coboundary, lower boundary, left margin and the right Boundary;
More corresponding boundary, obtain the closer coboundary of centre distance apart from the document picture, lower boundary, left margin and Right margin;Wherein, the coboundary of the extended area is corresponding with the coboundary of the document picture, the extended area it is following Boundary is corresponding with the lower boundary of the document picture, and the left margin of the extended area is corresponding with the left margin of the document picture, The right margin of the extended area is corresponding with the right margin of the document picture;
It cuts out described in acquisition that four edges circle surround the rectangular area to be formed up and down from the document map on piece, is shown Diagram piece.
4. a kind of document image display apparatus characterized by comprising
Reading unit, for reading document picture to be shown;
Detection unit obtains the document picture for carrying out edge detection to the document picture using edge detection algorithm Content display region, wherein the content display region be in rectangle;
Expanding element, for putting down four edges circle of the content display region along the direction at the center far from the document picture Scheduled distance is moved, extended area is obtained;
Extraction unit obtains display picture for extracting the lap of the extended area Yu the document picture;
Display unit, for showing the display picture;
The scheduled distance is greater than 0, then the expanding element is specifically used for, respectively by the four edges of the content display region Boundary translates scheduled distance along the direction at the center far from the content display region, obtains four boundaries after translation, And the region being surrounded according to the boundary line after this four translations, obtain extended area;Or,
The scheduled distance is greater than 0, then the expanding element, comprising:
Initial coordinate acquiring unit, the initial coordinate on four vertex for obtaining the content display region;
Coordinates of targets acquiring unit, the distance for being translated according to four edges circle of the content display region calculate described four Coordinates of targets of a vertex after movement;
Connection unit generates a new rectangle, obtains extended area for connecting the coordinates of targets.
5. document image display apparatus according to claim 4, which is characterized in that the detection unit specifically includes:
First scanning element, for scanning the document picture by the way of transversal scanning from left to right, obtain first with The gray value differences of the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate one and pass through the coordinate And the left margin vertical with scanning direction;
Second scanning element, for scanning the document picture by the way of transversal scanning from right to left, obtain first with The gray value differences of the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate one and pass through the coordinate And the right margin vertical with scanning direction;
Third scanning element, for scanning the document picture by the way of longitudinal scanning from top to bottom, obtain first with The gray value differences of the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate one and pass through the coordinate And the coboundary vertical with scanning direction;
4th scanning element, for scanning the document picture by the way of longitudinal scanning from bottom to up, obtain first with The gray value differences of the pixel of preceding single pass are greater than the coordinate of the pixel of preset threshold, and generate one and pass through the coordinate And the lower boundary vertical with scanning direction;
Unit is surrounded, with the region being surrounded according to the left margin, right margin, coboundary and lower boundary, it is aobvious to obtain content Show region.
6. according to document image display apparatus described in claim 4 to 5 any one, which is characterized in that the extraction unit, Include:
Distance acquiring unit, for obtaining four edges circle of the extended area at a distance from the center of the document picture and institute Four edges circle of document picture are stated at a distance from the center of the document picture;Wherein, four edges circle are coboundary, below Boundary, left margin and right margin;
Comparing unit is used for more corresponding boundary, obtain the closer coboundary of centre distance apart from the document picture, under Boundary, left margin and right margin;Wherein, the coboundary of the extended area is corresponding with the coboundary of the document picture, described The lower boundary of extended area is corresponding with the lower boundary of the document picture, the left margin of the extended area and the document picture Left margin it is corresponding, the right margin of the extended area is corresponding with the right margin of the document picture;
Unit is cut, four edges circle surround the square to be formed up and down for cutting out described in acquisition from the document map on piece Shape region obtains display picture.
7. a kind of terminal, which is characterized in that including the document image display apparatus as described in claim 4 to 6 any one.
CN201510696302.1A 2015-10-21 2015-10-21 Document picture display method and device and terminal Active CN105389165B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510696302.1A CN105389165B (en) 2015-10-21 2015-10-21 Document picture display method and device and terminal
PCT/CN2016/093104 WO2017067275A1 (en) 2015-10-21 2016-08-03 Document image display method, device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510696302.1A CN105389165B (en) 2015-10-21 2015-10-21 Document picture display method and device and terminal

Publications (2)

Publication Number Publication Date
CN105389165A CN105389165A (en) 2016-03-09
CN105389165B true CN105389165B (en) 2019-04-30

Family

ID=55421472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510696302.1A Active CN105389165B (en) 2015-10-21 2015-10-21 Document picture display method and device and terminal

Country Status (2)

Country Link
CN (1) CN105389165B (en)
WO (1) WO2017067275A1 (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105389165B (en) * 2015-10-21 2019-04-30 广州视睿电子科技有限公司 Document picture display method and device and terminal
CN106204588B (en) * 2016-07-08 2020-03-17 腾讯科技(深圳)有限公司 Image processing method and device
CN107678636A (en) * 2016-08-01 2018-02-09 广州市动景计算机科技有限公司 The webpage representation method and apparatus of electronic equipment
CN107678635A (en) * 2016-08-01 2018-02-09 广州市动景计算机科技有限公司 The webpage representation method and apparatus of electronic equipment
CN106775333A (en) * 2017-02-16 2017-05-31 深圳市茁壮网络股份有限公司 A kind of screenshotss method and device
CN107103312A (en) * 2017-06-07 2017-08-29 深圳天珑无线科技有限公司 A kind of image processing method and device
CN109710199A (en) * 2017-10-25 2019-05-03 中兴通讯股份有限公司 Character display method, device, terminal device and the storage medium of Mosaic screen
CN110543624B (en) * 2018-05-28 2023-06-23 珠海金山办公软件有限公司 Method and device for identifying check boxes in PDF document and electronic equipment
CN111414111A (en) * 2019-01-04 2020-07-14 珠海金山办公软件有限公司 Page cutting method and device
CN112635351B (en) * 2019-09-24 2022-04-19 长鑫存储技术有限公司 Intelligent positioning tool and intelligent positioning method
CN111028139B (en) * 2019-11-01 2023-09-12 深圳供电局有限公司 Method and system for expanding bitmap point positions
CN111047617B (en) * 2019-12-18 2021-07-23 南方电网电力科技股份有限公司 Rectangle recognition optimization method, device and equipment
CN113673200A (en) * 2020-05-13 2021-11-19 西安诺瓦星云科技股份有限公司 Text display method and text display device
CN112102442A (en) * 2020-09-04 2020-12-18 卡莱特(深圳)云科技有限公司 Image-text walking setting method and device for LED display screen
CN112414679B (en) * 2020-12-04 2022-06-03 歌尔光学科技有限公司 Method and device for extracting SFR algorithm knife edge area
CN113949854B (en) * 2021-11-17 2022-06-24 杭州震威科技有限公司 Screen seamless display method and system based on distributed projection
CN118095202B (en) * 2024-04-29 2024-07-05 江西易卫云信息技术有限公司 Experimental data recording method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582083A (en) * 2008-05-15 2009-11-18 株式会社理光 Web-based detection in image, extraction and recognition
CN102254302A (en) * 2011-06-07 2011-11-23 盛乐信息技术(上海)有限公司 Picture trimming system and method thereof
CN102567300A (en) * 2011-12-29 2012-07-11 方正国际软件有限公司 Picture document processing method and device
CN102890826A (en) * 2011-08-12 2013-01-23 北京多看科技有限公司 Method for resetting scan edition document
CN104573675A (en) * 2015-01-29 2015-04-29 百度在线网络技术(北京)有限公司 Operating image displaying method and device
CN104933430A (en) * 2015-06-03 2015-09-23 北京好运到信息科技有限公司 Interactive image processing method and interactive image processing system for mobile terminal

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6187405B1 (en) * 1998-10-24 2001-02-13 Todd Rudin Paper and method for displaying multiple page images
KR20090018514A (en) * 2007-08-17 2009-02-20 삼성테크윈 주식회사 Printing method of photographed image and photo-printing system adapted for the same
GB2454033A (en) * 2007-10-24 2009-04-29 Plastic Logic Ltd Portable paperless electronic printer
CN103164119B (en) * 2013-02-25 2016-06-08 东莞宇龙通信科技有限公司 The adaptive display method of communication terminal and image
CN103793152B (en) * 2013-06-28 2017-03-01 南京南瑞继保电气有限公司 A kind of monitoring system of electric substation picture on-line customization method
CN104461280A (en) * 2014-11-03 2015-03-25 联想(北京)有限公司 Information processing method and electronic device
CN105389165B (en) * 2015-10-21 2019-04-30 广州视睿电子科技有限公司 Document picture display method and device and terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582083A (en) * 2008-05-15 2009-11-18 株式会社理光 Web-based detection in image, extraction and recognition
CN102254302A (en) * 2011-06-07 2011-11-23 盛乐信息技术(上海)有限公司 Picture trimming system and method thereof
CN102890826A (en) * 2011-08-12 2013-01-23 北京多看科技有限公司 Method for resetting scan edition document
CN102567300A (en) * 2011-12-29 2012-07-11 方正国际软件有限公司 Picture document processing method and device
CN104573675A (en) * 2015-01-29 2015-04-29 百度在线网络技术(北京)有限公司 Operating image displaying method and device
CN104933430A (en) * 2015-06-03 2015-09-23 北京好运到信息科技有限公司 Interactive image processing method and interactive image processing system for mobile terminal

Also Published As

Publication number Publication date
WO2017067275A1 (en) 2017-04-27
CN105389165A (en) 2016-03-09

Similar Documents

Publication Publication Date Title
CN105389165B (en) Document picture display method and device and terminal
Tanaka et al. Layout Analysis of Tree-Structured Scene Frames in Comic Images.
US20110035661A1 (en) Document layout system
CN109947972A (en) Reduced graph generating method and device, electronic equipment, storage medium
CN106610829B (en) Webpage screenshot method and device
RU2631765C1 (en) Method and system of correcting perspective distortions in images occupying double-page spread
US20150029219A1 (en) Information processing apparatus, displaying method and storage medium
CN106648581B (en) Page display method and device
US9760965B2 (en) Information embedding device, information detecting device, information embedding method, and information detecting method
CN110502985A (en) Table recognition method, apparatus and Table recognition equipment
US20170365061A1 (en) Image recognition method and apparatus
US8705862B2 (en) Image processing apparatus
US20090052792A1 (en) Computer-Assisted Image Cropping For Book Scans
CN110989958B (en) Method and related device for opening polygonal window on splicing wall
US20130194298A1 (en) Image processing apparatus, image processing method, and computer-readable recording medium storing image processing program
US9734610B2 (en) Image processing device, image processing method, and image processing program
CN112906532A (en) Image processing method and apparatus, electronic device, and storage medium
CN108804652B (en) Method and device for generating cover picture, storage medium and electronic device
CN106910196A (en) A kind of image detecting method and device
US11908173B1 (en) Method and system for three-dimensional profiling of an object
CN103252088B (en) Outdoor scene scanning game interactive system
Wu et al. A fast hybrid retargeting scheme with seam context and content aware strip partition
US10572759B2 (en) Image processing device, image processing method, and program
JP2007295210A (en) Image processing apparatus, image processing method, image processing program, and recording medium recording the program
US12045946B2 (en) Rotating and cropping images for various forms of media including animation, comics, film, or television

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