CN109214240A - The method and device of testing document - Google Patents
The method and device of testing document Download PDFInfo
- Publication number
- CN109214240A CN109214240A CN201710531317.1A CN201710531317A CN109214240A CN 109214240 A CN109214240 A CN 109214240A CN 201710531317 A CN201710531317 A CN 201710531317A CN 109214240 A CN109214240 A CN 109214240A
- Authority
- CN
- China
- Prior art keywords
- document
- line segment
- edge
- region
- areas
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/40—Document-oriented image-based pattern recognition
- G06V30/41—Analysis of document content
- G06V30/414—Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses the method and devices of testing document.Described device includes: acquiring unit, is configured to obtain the original document region in file and picture;Local document area determination unit is configured to determine local document region according to the original document region, wherein the local document region includes the actual edge of document areas;Line segment detection unit is configured to detect the line segment in the local document region;Document areas positioning unit is configured to position the document areas according to the line segment.Compared with prior art, the accuracy of document areas can be improved.
Description
Technical field
The present invention relates to image procossings, more particularly to the method and device of testing document.
Background technique
With the development of augmented reality (AR) technology, in some scenes, such as aspectant commercial session, it is thus necessary to determine that
Document areas simultaneously further displays some related contents in document.But in true environment, because of such as brightness change, paper
Some influences of the various factors such as deformation, so being difficult to stablize, being accurately determined document areas.
Recent years, document location technology are widely used in many situations, such as document tilt detection, document edges are cut
It cuts, document tracking etc..
In general, in order to determine document areas, will use two methods in document positioning, one is be based on characteristics of image
Technology, another kind is the technology based on straight-line detection.The technology based on characteristics of image includes: the spy according to scene image
It levies the document in key point matching scene image and determines original document region, (such as light stream is calculated by using object tracing technique
Method or continuous adaptive mean shift algorithm (CAM-Shift)) document areas is tracked in subsequent frames.
The technology based on straight-line detection includes: to calculate the difference of the tonal gradation of each pixel, then using some pre-
The threshold value of definition determines whether pixel is marginal point.It is quasi- using straight line after marginal point all in file and picture is detected
Conjunction method (such as Hough transformation (Hough transformation)) generates document edges.
US patent application publication US2009/0231639A1 discloses one kind illustratively based on the document of straight-line detection
Location technology, it includes: edge candidate pixel is detected from file and picture;It is fitted edge candidate straight line;Select suitable edge
Candidate straight line is to construct the shape in transient document region;It determines between the edge candidate pixel and the transient document region
Positional relationship, if the edge candidate pixel is in the outside in the transient document region, by moving in parallel selected edge
Candidate straight line corrects the edge candidate straight line to pass through the edge candidate pixel of ragged edge.
However, the technology based on characteristics of image is merely able to return to a ballpark document areas, accuracy is not high.
Can be by error detection because of noise lines based on the technology of straight-line detection the problem of, and the more time is needed to detect all times
Straight line is selected, then determines which bar line is document edges.In addition, if the inclination detected and document itself are inconsistent, Huo Zhejian
The edge candidate pixel measured is incorrect or some edges of document are blocked completely, then locating documents area in the picture
Domain will have very big challenge.Therefore, still need to find a kind of new method come it is accurate, detect document in file and picture at high speed
Region.
Summary of the invention
Therefore, in view of the record in background technique above, the disclosure aims to solve the problem that the above problem.
According to an aspect of the present invention, a kind of device of testing document is provided, described device includes: to obtain list
Member is configured to obtain the original document region in file and picture;Local document area determination unit is configured to according to described initial
Document areas determines local document region, wherein the local document region includes the actual edge of document areas;Line segment detection
Unit is configured to detect the line segment in the local document region;Document areas positioning unit, it is fixed according to the line segment to be configured to
The position document areas.
Using the present invention, the accuracy and speed of document positioning will get a promotion.
According to description referring to the drawings, other property features of the invention and advantage be will be evident.
Detailed description of the invention
It is incorporated in this specification and the attached drawing for constituting this specification a part illustrates the embodiment of the present invention by way of illustration,
And the principle used to explain the present invention together with verbal description.
Fig. 1 illustrates the example of the document areas in file and picture.
Fig. 2 is the block diagram for schematically showing the hardware configuration that technology according to an embodiment of the present invention can be achieved.
Fig. 3 is to illustrate the block diagram of the configuration of document positioning device according to a first embodiment of the present invention.
Fig. 4 schematically shows the flow chart of document localization process according to an embodiment of the present invention.
Fig. 5 schematically shows the flow chart of step S420 as shown in Figure 4 according to the present invention.
Fig. 6 schematically shows the flow chart of step S440 as shown in Figure 4 according to the present invention.
Fig. 7 A and Fig. 7 B illustrate the example of line segment classification.
Fig. 8 is to illustrate the block diagram of the configuration of the positioning device for blocking document according to a second embodiment of the present invention.
Fig. 9 A, Fig. 9 B and Fig. 9 C illustrate the example for blocking the positioning of document.
Specific embodiment
Describe exemplary embodiment of the present invention in detail below with reference to accompanying drawings.It should be noted that following description is substantial
It is only illustrative and exemplary of, and it is in no way intended to limit the present invention and its application or purposes.Unless otherwise expressly specified, no
Then the positioned opposite of component and step described in embodiment, numerical expression and numerical value are not limit the scope of the invention.Separately
Outside, technology known to those skilled in the art, method and apparatus may not be discussed in detail, but in situation appropriate
It should be a part of this specification.
It note that similar appended drawing reference and letter refer to similar project in attached drawing, therefore, once a project is one
It is defined, then need not discuss in following attached drawing to it in a attached drawing.
In the disclosure, term " first ", " second " etc. are only used to distinguish element or step, and are not intended to mean that the time
Sequentially, priority or importance.
The invention proposes a kind of area of computer aided document localization method, this method can be with real-time matching and tracking document simultaneously
Synchronize the related expanding content for highlighting suitable application region or the display areas adjacent that customer fills in.For example, system
Or view is projected on work top and synchronizes the suitable application region for highlighting customer and filling in by computer.Therefore, this is realized
Purpose, just must the quickly and accurately locating documents region in the image of each capture, then according to the layout attributes meter of document
Calculate the coordinate of suitable application region.
In order to rapidly obtain document areas at any time, especially in the case of movement, main structure of the invention
Think of is based on characteristics of image technological improvement line detection method.Therefore, the document that document positions and obtains high accuracy is improved
Positioning, the present invention obtain the coordinate in the initial pictures region in a frame by characteristics of image to generate bounding box, then according to institute
It states bounding box and determines local document region;Then it detects the line segment in local document region and the line segment is fitted to the text
Four edge lines in shelves region, and four intersection points of the edge line are exported to indicate document areas.In addition, the present invention can mistake
Line segment is filtered to reduce line segment noise.
Therefore, according to the present invention, in document localization process, by document edges detection limit in local document region and
It is not that the speed and accuracy of document positioning can be improved in entire file and picture.
In addition, the present invention also can be evaluated whether document areas even if one or more edges of document are blocked.Even if passing through
Edge detection can only obtain a vertex of document areas, other three tops can also be estimated according to document areas tracking result
Point.
(hardware configuration)
First by referring to Fig. 2 description can be achieved hereafter described in technology hardware configuration.Fig. 2 is that schematically show can
Realize the block diagram of the hardware configuration of technology according to an embodiment of the present invention.
Hardware configuration 200 for example including central processing unit (CPU) 210, random access memory (RAM) 220, read-only deposit
Reservoir (ROM) 230, hard disk 240, input equipment 250, output equipment 260, network interface 270 and system bus 280.In addition, hard
Part configuration 200 can pass through such as work station, server, tablet computer, laptop, desktop computer or other suitable electronics
Equipment is realized.
In the first implementation, according to the present invention in file and picture the processing in locating documents region by hardware or firmware
Configure and be used as the module or component of hardware configuration 200.Such as the device 300 by being described in detail below by reference to Fig. 3
Module or component as hardware configuration 200.In the second implementation, the locating documents area in file and picture according to the present invention
The processing in domain configure and executed by CPU 210 by the software being stored in ROM 230 or hard disk 240.Such as by will be under
The process 400 that text is described in detail referring to Fig. 4 is used as the program being stored in ROM 230 or hard disk 240.
CPU 210 is any suitable programmable control device (such as processor), and may be implemented within ROM 230
Or the various application programs in hard disk 240 (such as memory) execute the various functions being described hereinafter.RAM 220 is for facing
When the storage program or data that are loaded from ROM 230 or hard disk 240, and execute various mistakes wherein used also as CPU 210
The space of journey (such as the technology for implementing to be described in detail hereinafter with reference to Fig. 4 and Fig. 6) and other available functions.Hard disk 240 is deposited
Store up much information, such as operating system (OS), various application programs, control program, be pre-stored by manufacturer or predefined data,
It is pre-stored by manufacturer or the model and/or classifier of pre-generatmg.
In one implementation, input equipment 250 is for allowing user to interact with hardware configuration 200.At one
In example, user can input file and picture by input equipment 250.In another example, user can be set by input
Standby 250 triggering alignment processing of the invention.In addition, diversified forms can be used in input equipment 250, such as button, keyboard or touch screen.
In another implementation, input equipment 250 is used to receive the spy from such as digital camera and/or EDM System
The file and picture of different electronic equipment output.
In one implementation, output equipment 260 is used to show that document areas result is (interior in such as document to user
Table etc. in appearance, document).Moreover, various forms can be used in output equipment 260, such as cathode-ray tube (CRT) or liquid crystal display
Device and/or printer.In another implementation, output equipment 260 is used for the subsequent processing of analysis or tracking (as shown
Document analysis, document tracking and/or identification etc.) output document areas positioning result.
Network interface 270 provides the interface for hardware configuration 200 to be connected to network.For example, hardware configuration 200 can be through
Data communication is carried out by network interface 270 and other electronic equipments connected via a network.Alternatively, can be hardware configuration 200
Wireless interface is provided, to execute wireless data communication.System bus 280 can be provided in CPU 210, RAM 220, ROM
230, the data of mutual data transmission are transmitted between hard disk 240, input equipment 250, output equipment 260 and network interface 270 etc.
Path.Although referred to as bus, system bus 280 is not limited to any specific data transmission technology.
Above-mentioned hardware configuration 200 is merely illustrative, and is in no way intended to limit invention, its application, or uses.And
And for brevity, a hardware configuration is only shown in Fig. 2.Match however, if necessary multiple hardware also can be used
It sets.
(document localization process)
(first embodiment)
The main object of the present invention be according to above-mentioned document matches and tracking result in file and picture locating documents region.
The place in the locating documents region in file and picture according to a first embodiment of the present invention is described below with reference to Fig. 1 and Fig. 3 to Fig. 7 B
Reason.
Fig. 3 is to illustrate the block diagram of the configuration of document positioning device 300 according to a first embodiment of the present invention.Wherein, in Fig. 3
Some or all of shown module can be realized by specialized hardware.Flow chart 400 shown in Fig. 4 is device 300 shown in Fig. 3
Corresponding process.
As shown in Figure 3, document positioning device 300 is true including original document area acquisition unit 310, local document region
Order member 320, Line segment detection unit 330 and document areas positioning unit 340.
Firstly, input equipment 250 shown in Fig. 2 receives file and picture from special electrical devices or user.Secondly, input
Received file and picture is transferred to original document area acquisition unit 310 via system bus 280 by equipment 250.Then, initially
Document areas acquiring unit 310 obtains file and picture from input equipment 250 via system bus 280.
It is shot with obtaining by camera in addition, original document area acquisition unit 310 executes step S410 as shown in Figure 4
File and picture in original document region.As shown in Figure 4, in obtaining step S410, original document area acquisition unit
310 obtain the original document region in file and picture.
In step S410, original document area acquisition unit 310 is obtained in file and picture based on characteristics of image technology
Original document region.In one implementation, firstly, being the feature of some key points of destination document image registration.Then, phase
Machine continuously shoots file and picture frame by frame.Whether the present invention determines the document in a frame file and picture using feature matching method
With registered document matches.In the case that the document in file and picture is determined with registered document matches, the present invention
The original document region in the frame file and picture can be calculated according to key point information, then export original document region.For
Subsequent scenario frame, the present invention are estimated the original document region in a frame using method for tracing object and export original document area
Domain, unless camera can not take file and picture in shooting area or file and picture disappears in shooting area.
Fig. 1 illustrates the example of the document areas in file and picture.As shown in fig. 1, original document area acquisition unit 310
Using feature representation criterion (such as SIFT algorithm) from file and picture extract key point (such as FAST9 angle point, P1 shown in Fig. 1,
P2, P3 and P4) and its corresponding feature, then use pattern matching process by the feature of extraction and the feature of registered document into
Row matching.In the case where two kinds of features match each other, it is meant that original document area acquisition unit 310 has found matched text
Shelves.Therefore, it is calculated based on the key point of extraction (P1, P2, P3 and P4 shown in Fig. 1) and corresponding registered key point
Homography matrix (homography matrix).Then, original document area acquisition unit 310 is according to the size of registered document
With homography matrix by perspective transform obtain file and picture in original document region and its coordinate (P1, P2 shown in Fig. 1,
P3 and P4).After obtaining original document region, predicted in each subsequent frame using method for tracing object (such as optical flow algorithm)
The new region of document.
Original document area acquisition unit 310 obtains original document region from file and picture.Then, local document region is true
Order member 320 obtains original document region from original document area acquisition unit 310 via system bus 280.
Therefore, local document area determination unit 320 executes local document area determination step S420 shown in Fig. 4,
Local document region is determined according to the original document region obtained from file and picture.In the step s 420, local document region is true
Order member 320 determines local document region according to original document region.
In one implementation, the application of local document area determination unit 320 is above in conjunction with the original document of Fig. 1 description
The key point (P1, P2, P3 and P4 as shown in Figure 1) in region determines local document region.Below with reference to Fig. 1 and Fig. 5
Description determines the example in local document region using the coordinate in original document region.
Flow chart 500 shown in Fig. 5 is local document area determination step S420 shown in Fig. 4 according to the present invention
Corresponding process.
Exemplary embodiment of the present invention explained below, using polygon ring as the local document area for being used for document positioning
Domain.However, even if polygon ring is replaced with any other shape, such as straight-flanked ring, Q-RING, annulus, elliptical ring or other shapes
Shape, exemplary embodiment of the present invention can still be applied.In the present embodiment, polygon ring is straight-flanked ring.
Turning now to Fig. 5, in step S510, local document area determination unit 320 is obtained according to original document region
4 vertex (P1, P2, P3 and P4 shown in Fig. 1) and its coordinate simultaneously connect this four points one by one to generate bounding box.Citing comes
It says, bounding box shown in Fig. 1 is illustrated as the rectangle of solid line composition, four vertex of the bounding box based on original document region
P1, P2, P3 and P4 and its Coordinate generation.
In step S520, as shown in fig. 1, for each edge of bounding box, local document area determination unit 320
Two parallel lines at each edge are calculated, to generate inner polygon inside bounding box respectively and outside bounding box
Outer polygon.The distance between corresponding edge of every parallel lines and bounding box is at least a pixel.That is, part text
Shelves area determination unit 320 is using this bounding box as a reference to reducing at least one pixel to obtain inner polygon and increase
At least one pixel is to obtain outer polygon.
As shown in fig. 1, inner polygon is illustrated as the rectangle of dotted line composition and is located at the inside of bounding box;Outer polygonal
It is shown as the rectangle of dotted line composition and is located at the outside of bounding box.Positional relationship between bounding box and inner polygon and outer polygon
It is illustrated examples.With the nargin of at least one pixel between inner polygon and outer polygon and bounding box.
By inner polygon and outer polygon, it is interior more to determine that local document area determination unit 320 executes step S530
Polygon ring between side shape and outer polygon.The two polygons generate polygon ring, and assume the actual edge position of document areas
In in polygon ring.As shown in fig. 1, polygon ring is illustrated as the region between inner polygon and outer polygon.
In addition, in order to accelerate Line segment detection, local document area determination unit 320 can cover the area inside inner polygon
Domain, that is to say, that the document areas inside inner polygon can be blanked.As shown in fig. 1, after cover, inside inner polygon
All pixels by designated same grayscale value.
Therefore, Line segment detection unit 330 can execute Line segment detection step S430 to detect the line in local document region
Section can accelerate document edges to detect compared with carrying out detection in entire document areas.
In one implementation, in step S430, Line segment detection unit 330 detects the line segment in polygon ring.Firstly,
Line segment detection unit 330 is based on multiple edge pixels in the polygon ring of Tuscany operator (Canny operator) detection.Secondly,
Line segment detection unit 330 is based on Hough transformation (Hough transformation) and edge pixel is fitted to a plurality of line segment.
In addition, Line segment detection unit 330 can detecte line segment and be filtered the line segment that these are detected to delete one
The noise at document areas edge cannot be represented a bit.
In one implementation, Line segment detection unit 330 calculates separately each edge and horizontal angle of bounding box
Degree;Then every line segment of iteration and itself and horizontal angle are calculated, to obtain between every line segment and each edge of bounding box
Four differential seat angles.In the case where four differences are all larger than predefined thresholds, it is meant that the line segment detected cannot be trusted,
And Line segment detection unit 330 can delete this line segment from line segment.Herein, predefined thresholds are typically larger than 0 degree and less than 5 degree.
In the present embodiment, specifying this threshold value is 3 degree.
After filtration treatment, Line segment detection unit 330 obtains line segment substantially parallel with the edge of bounding box in polygon ring.
Then document areas positioning unit 340 obtains line segment from Line segment detection unit 330 via system bus 280.
Therefore, document areas positioning unit 340 determines the actual document region in file and picture, and via system bus
280 output this to output equipment 260 for subsequent processing.
Document areas positioning unit 340 executes actual document zone location step S440, specifically as shown in fig. 6, with basis
Line segment determines actual document region.Flow chart 600 shown in fig. 6 is the correspondence of step S440 shown in Fig. 4 according to the present invention
Process.
In step S610, the line segment retained after line segment or filtration treatment is categorized by document areas positioning unit 340
Different type.In one implementation, as shown in Fig. 7 A (illustrating the example of line segment classification), bounding box is parallel in line segment
The edge P1P2 or the edge P3P4 in the case where, the line segment is classified as type A by document areas positioning unit 340.Show in 7A
Three line segments illustrate the example for the line segment for belonging to type A out.The edge P2P3 or the edge P4P1 of bounding box are parallel in line segment
In the case where, the line segment is classified as type B by document areas positioning unit 340.Four line segments are shown to illustrate and belong in Fig. 7 A
In the example of the line segment of type B.It is readily appreciated that, belongs to the line segment angle having the same and slope of same type.
Secondly, document areas positioning unit 340 generates four midpoints according to four vertex of bounding box.In a kind of realization side
In formula, as shown in Figure 7A, point P1, P2, P3 and P4 illustrate four vertex of bounding box;Point P1P2M, P2P3M, P3P4M and
P4P1M illustrates four midpoints above-mentioned.Later, 340 tie point P2P3M of document areas positioning unit and point P4P1M are with life
At the first middle line (Mid-line1 as shown in Figure 7A), then tie point P1P2M and P3P4M is to generate the second middle line (as schemed
Mid-line2 shown in 7A).
In addition, the line segment for belonging to type A is categorized into two subclasses using the first middle line by document areas positioning unit 340
Type, respectively type A1 and type A2.As shown in Fig. 7 B (illustrating the example of line segment classification), document areas positioning unit 340
A line segment is chosen from type A, such as is illustrated as the line segment of p1p2 in figure 7b.Herein, the endpoint of line segment p1p2 be point p1 with
Point p2.Then an intersection point of the first middle line (Mid-line1 as shown in fig.7b) is calculated (such as according to the abscissa of endpoint p1
P1 ' shown in Fig. 7 B), herein, coordinate of the p1 ' shown in Fig. 7 B in x-axis is equal to coordinate of the p1 in x-axis, that is,
It says, Xp1’=Xp1.Then another intersection point (p2 ' as shown in fig.7b) of the first middle line is calculated according to the abscissa of endpoint p2,
Herein, coordinate of the p2 ' in x-axis shown in Fig. 7 B is equal to coordinate of the p2 in x-axis, that is to say, that Xp2’=Xp2.In p1 in y
Coordinate on axis is greater than p1 ' coordinate on the y axis and in the case that the coordinate of p2 on the y axis is greater than the coordinate of p2 ' on the y axis,
Line segment p1p2 is classified as type A1 by document areas positioning unit 340, otherwise, line segment p1p2 is classified as type A2.To belonging to
The remaining line segment of type A applies identical method.
According to identical method, using the second middle line, document areas positioning unit 340 classifies the line segment for belonging to type B
At two subtypes, respectively type B 1 and type B 2.
Therefore, line segment is divided into four types, i.e. type A1, type A2, type B 1 and class by document areas positioning unit 340
Type B2, these types respectively represent the different line segment groups on four direction.
In step S620, document areas positioning unit 340 selects ragged edge in each type of aforementioned four type
Line segment as edge candidate.Select the line segment of the ragged edge in a seed type as candidate with fitting a straight line.For example, literary
Shelves zone location unit 340 selects the line segment of M ragged edge as edge candidate in each type.Herein, the value of M is usually situated between
Between 1 to 10.In the present embodiment, M is appointed as 3.Four groups of candidates are generated to remaining type application same procedure.
In step S630, document areas positioning unit 340 can be fitted four straight lines according to line segment.For belonging to one kind
Every line segment of type, document areas positioning unit 340, which calculates, simultaneously generates its straight line parameter, then according to using in a seed type
Candidate line sections all parameter value calculations average parameter value fitting a straight line.It is identical to the candidate application of residue in other types
Method generates four straight lines.Finally, document areas positioning unit 340 calculates four intersection points of this four straight lines, thus according to
Four intersection points determine actual document region.
Therefore, document areas positioning unit 340 determines the actual document region in file and picture, then output equipment 260
Actual document region is shown to user for further processing via system bus 280.For example, document areas positioning is single
Actual document region is output to display by member 340, and user can be used it and be further processed.In addition, document areas is fixed
Bit location 340 can store in actual document region into RAM 220, ROM 230 or hard disk 240.
(second embodiment)
In addition, the present invention also can be evaluated whether document areas even if one or more edges are blocked.Firstly, based on above-mentioned
Device 300, the present invention detect the unshielding edge of document areas and calculate its intersection point.Later, present invention determine that it is right in bounding box
Answer the vertex of intersection point;The mean deviation amount for being then based on the vertex estimates the coordinate on the vertex that is blocked.Finally, exporting all tops
The coordinate of point is as actual document region.
Hereinafter with reference to Fig. 8 to Fig. 9 C description, document area is blocked in positioning in file and picture according to a second embodiment of the present invention
The processing in domain.
Fig. 8 is to illustrate the block diagram of the configuration of the positioning device 800 for blocking document areas according to a second embodiment of the present invention.
Wherein, part or all of module shown in fig. 8 can be realized by specialized hardware.As shown in Figure 8, the positioning of document areas is blocked
Device 800 includes device 300 and blocks edge evaluation unit 810.Fig. 9 A, Fig. 9 B and Fig. 9 C illustrate showing for the positioning for blocking document
Example.
In one implementation, as illustrated in figure 9 a, it is assumed that blocked completely at two edges of document.As above first is real
It applies described in example, 300 determination of device can represent the coordinate on four vertex in actual document region.However, in a second embodiment, by
In blocking, device 300 only can determine the coordinate for blocking a vertex of document.P1 ' shown in Fig. 9 A illustrates this vertex.
Original document region and reality are determined according to the vertex for blocking document areas secondly, blocking edge evaluation unit 810
Offset between document areas.It blocks edge evaluation unit 810 and calculates separately the vertex for blocking document areas (such as institute in Fig. 9 B
The P1 ' shown) and four vertex (P1, P2, P3 and P4 as shown in Figure 1) of the bounding box in original document region between four
A distance.Then, a vertex of the bounding box in the selection of edge evaluation unit 810 original document region is blocked (in such as Fig. 9 B
Shown in P1) as correspond to P1 ' point because the distance between P1 and P1 ' are most short.Later, edge evaluation unit 810 is blocked
Calculate offset (" △ x " as shown in fig. 9b) in the direction of the x axis and offset in the y-axis direction between P1 ' and P1
(" △ y " as shown in fig. 9b).
Finally, blocking edge evaluation unit 810 passes through the side for adding the vertex of bounding box in original document region respectively
Actual area coordinate a little is blocked in formula estimation.For example, as shown in Figure 9 C, edge evaluation unit 810 is blocked by first
The mode that the apex coordinate of bounding box in beginning document areas adds offset in x-axis and y-axis estimates the seat for blocking vertex P2 '
Mark.Other are blocked a little or vertex (P3 ' and P4 ' as shown in Figure 9 C) applies identical calculating to obtain actual document region
Coordinate.
(invention application)
According to the device and method of above-mentioned document localization process, the present invention can position actual document region, and can be with
Document areas is blocked according to the unshielding vertex of document areas to position.
Above-mentioned all units contribute to realize the exemplary and/or preferred module of processing described in the disclosure.These
Unit can be hardware cell (such as, field programmable gate array (FPGA), digital signal processor, specific integrated circuit etc.)
And/or software module (such as, computer-readable program).It does not describe at large for realizing the unit of each step above.So
And in the case where there is the step of executing particular procedure, there may be the corresponding function modules for realizing the same processing
Or unit (passing through hardware and/or software realization).All combinations of the step of passing through description and the unit corresponding to these steps
Technical solution be included in disclosure of this application, as long as the technical solution that they are constituted be it is complete, be applicable in i.e.
It can.
Methods and apparatus of the present invention can be implemented in various ways.For example, can by software, hardware, firmware or
Any combination thereof implements methods and apparatus of the present invention.Unless otherwise expressly specified, otherwise this method the step of it is above-mentioned suitable
Sequence is only intended to be illustrative, and the step of method of the invention is not limited to the sequence of above-mentioned specific descriptions.In addition, one
In a little embodiments, the present invention can also be implemented as the program recorded in the recording medium comprising for realizing according to this hair
The machine readable instructions of bright method.Therefore, the present invention covers storage also for realizing program according to the method for the present invention
Recording medium.
Although some specific embodiments of the present invention, those skilled in the art has been shown in detail by example
Member is it should be understood that above-mentioned example is only intended to be illustrative, and does not limit the scope of the invention.Those skilled in the art should
Understand, above-described embodiment can be modified without departing from the scope and spirit of the present invention.The scope of the present invention is by institute
Attached claim constraint.
Claims (16)
1. a kind of document image processing apparatus, described device include:
Acquiring unit is configured to obtain the original document region in file and picture;
Local document area determination unit is configured to determine local document region according to the original document region, wherein described
Local document region includes the actual edge of document areas;
Line segment detection unit is configured to detect the line segment in the local document region;
Document areas positioning unit is configured to position the document areas according to the line segment.
2. the apparatus according to claim 1, wherein the Line segment detection unit is additionally configured to filter based on predefined rule
The line segment.
3. device according to any one of claim 1 to 2, wherein the document areas positioning unit be additionally configured to by
The line segment is categorized into different type.
4. device according to any one of claim 1 to 2, wherein the local document area determination unit is configured that
Based on the original document Area generation bounding box;
Generate the inner polygon inside the bounding box and the outer polygon outside the bounding box;
Determine the local document region between the inner polygon and the outer polygon.
5. the apparatus of claim 2, wherein filtering the line segment includes:
Calculate the angle between every line segment and four edges in the original document region;
Delete the line segment that its angle is all larger than predefined thresholds.
6. device according to claim 3, wherein the document areas positioning unit is additionally configured in selection each type
The line segment of the ragged edge is simultaneously fitted to straight line by the line segment of ragged edge.
7. device according to claim 6, wherein the document areas positioning unit is additionally configured to:
The line segment is categorized into four seed types;
Select the line segment of ragged edge in each type as edge candidate;
Four straight lines are fitted according to the line segment of ragged edge in four seed type.
8. the apparatus according to claim 1, described device further include:
Edge evaluation unit is blocked, is configured to estimate the document area according at least one unshielding edge of the document areas
Block edge in domain.
9. device according to claim 8, the edge evaluation unit that blocks is additionally configured to calculate the document areas
Mean deviation amount between the unshielding edge and the corresponding edge in the original document region;And according to the mean deviation
Estimate that the described of the document areas blocks edge in the corresponding edge in amount and the original document region.
10. device according to claim 4, wherein the inner polygon or outer polygon are rectangle, square, circle
Shape or ellipse.
11. a kind of document image processing method, which comprises
Obtaining step, for obtaining the original document region in file and picture;
Local document area determination step, for determining local document region according to the original document region, wherein the office
Portion's document areas includes the actual edge of document areas;
Line segment detection step, for detecting the line segment in the local document region;
Document areas positioning step, for positioning the document areas according to the line segment.
12. according to the method for claim 11, wherein the Line segment detection step further include: be based on predefined rule mistake
Filter the line segment.
13. method described in any one of 1 to 12 according to claim 1, wherein the document areas positioning step further include:
The line segment is categorized into different type.
14. method described in any one of 1 to 12 according to claim 1, wherein the local document area determination step packet
It includes:
Based on the original document Area generation bounding box;
Generate the inner polygon inside the bounding box and the outer polygon outside the bounding box;
Determine the local document region between the inner polygon and the outer polygon.
15. according to the method for claim 12, wherein filtering the line segment includes:
Calculate the angle between every line segment and four edges in the original document region;
Delete the line segment that its angle is all larger than predefined thresholds.
16. the method according to claim 11, the method also includes:
Edge estimation steps are blocked, for estimating the document areas according at least one unshielding edge of the document areas
Block edge.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710531317.1A CN109214240A (en) | 2017-07-03 | 2017-07-03 | The method and device of testing document |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710531317.1A CN109214240A (en) | 2017-07-03 | 2017-07-03 | The method and device of testing document |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109214240A true CN109214240A (en) | 2019-01-15 |
Family
ID=64992208
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710531317.1A Pending CN109214240A (en) | 2017-07-03 | 2017-07-03 | The method and device of testing document |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109214240A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111382740A (en) * | 2020-03-13 | 2020-07-07 | 深圳前海环融联易信息科技服务有限公司 | Text picture analysis method and device, computer equipment and storage medium |
-
2017
- 2017-07-03 CN CN201710531317.1A patent/CN109214240A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111382740A (en) * | 2020-03-13 | 2020-07-07 | 深圳前海环融联易信息科技服务有限公司 | Text picture analysis method and device, computer equipment and storage medium |
CN111382740B (en) * | 2020-03-13 | 2023-11-21 | 深圳前海环融联易信息科技服务有限公司 | Text picture analysis method, text picture analysis device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9767567B2 (en) | Method and apparatus for separating foreground image, and non-transitory computer-readable recording medium | |
US9275281B2 (en) | Mobile image capture, processing, and electronic form generation | |
US6774889B1 (en) | System and method for transforming an ordinary computer monitor screen into a touch screen | |
JP6250014B2 (en) | System and method for mobile image capture and processing | |
CN108475433B (en) | Method and system for large scale determination of RGBD camera poses | |
JP6496987B2 (en) | Target detection method and target detection apparatus | |
JP6417702B2 (en) | Image processing apparatus, image processing method, and image processing program | |
CN102830958B (en) | A kind of method and system for obtaining interface control information | |
US8811751B1 (en) | Method and system for correcting projective distortions with elimination steps on multiple levels | |
US8897600B1 (en) | Method and system for determining vanishing point candidates for projective correction | |
US11699283B2 (en) | System and method for finding and classifying lines in an image with a vision system | |
EP2827131A1 (en) | Image inspection method and inspection region setting method | |
EP2974261A2 (en) | Systems and methods for classifying objects in digital images captured using mobile devices | |
JP6642970B2 (en) | Attention area detection device, attention area detection method, and program | |
CN105229697A (en) | Multi-modal prospect background segmentation | |
EP2977932B1 (en) | Image processing apparatus, image processing method and image processing program | |
CN104123529A (en) | Human hand detection method and system thereof | |
US8913836B1 (en) | Method and system for correcting projective distortions using eigenpoints | |
AU2016225841A1 (en) | Predicting accuracy of object recognition in a stitched image | |
US11282268B1 (en) | Top-down view mapping of interior spaces | |
US10089764B2 (en) | Variable patch shape synthesis | |
US9525859B2 (en) | Refinement of user interaction | |
CN109214240A (en) | The method and device of testing document | |
KR101484003B1 (en) | Evaluating system for face analysis | |
CN112365600B (en) | Three-dimensional object detection method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190115 |
|
WD01 | Invention patent application deemed withdrawn after publication |