CN111402281B - Book edge detection method and device - Google Patents

Book edge detection method and device Download PDF

Info

Publication number
CN111402281B
CN111402281B CN202010173429.6A CN202010173429A CN111402281B CN 111402281 B CN111402281 B CN 111402281B CN 202010173429 A CN202010173429 A CN 202010173429A CN 111402281 B CN111402281 B CN 111402281B
Authority
CN
China
Prior art keywords
sequence
edge
book
point
image
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
CN202010173429.6A
Other languages
Chinese (zh)
Other versions
CN111402281A (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.)
Shanghai Linguan Data Technology Co ltd
Shanghai Shengteng Data Technology Co ltd
Shanghai Yingwuchu Data Technology Co ltd
Shanghai Hehe Information Technology Development Co Ltd
Original Assignee
Shanghai Linguan Data Technology Co ltd
Shanghai Shengteng Data Technology Co ltd
Shanghai Yingwuchu Data Technology Co ltd
Shanghai Hehe Information Technology Development 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 Shanghai Linguan Data Technology Co ltd, Shanghai Shengteng Data Technology Co ltd, Shanghai Yingwuchu Data Technology Co ltd, Shanghai Hehe Information Technology Development Co Ltd filed Critical Shanghai Linguan Data Technology Co ltd
Priority to CN202010173429.6A priority Critical patent/CN111402281B/en
Publication of CN111402281A publication Critical patent/CN111402281A/en
Application granted granted Critical
Publication of CN111402281B publication Critical patent/CN111402281B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a book edge detection method which comprises the following steps. Step S10: an image containing a book is acquired. Step S20: and extracting left and right edges of the book from the image by adopting a straight line detection method. Step S30: and extracting the upper edge and the lower edge of the book from the image by adopting a trip point detection method based on cyclic search. The application also discloses a corresponding book edge detection device. The method has the advantages of quick and stable processing, and can accurately detect the edge of the book under the conditions of difficult scenes such as poor image quality (blurring or noise existence) and partial shielding of the edge of the book, and can detect the edge of the book which is bent.

Description

Book edge detection method and device
Technical Field
The application relates to a digital image processing technology, in particular to a method for accurately positioning the edge of a book by using the digital image processing technology.
Background
Document edge detection refers to a technique of locating a document edge in an input image. Document edge detection is an essential step of a document image processing flow, and can improve the readability of a document by matching with a subsequent document correction function, and meanwhile, the accuracy of optical character recognition (OCR, optical character recognition) in a document image is improved. The book edge detection technique is closely related to the document edge detection technique.
The Chinese patent with the authorized bulletin number of CN100426313C and the authorized bulletin day of 2008, 10, 15, discloses a boundary detection method, a boundary detection device and a copying machine for detecting the boundary in a document image. The disadvantage of this method is that it relies on special equipment such as scanners, copiers, etc., and requires contact scanning of the document.
Chinese patent application number CN105339951B, date 2017, 5, 31, discloses a method for detecting document boundaries in digital images. The method utilizes image processing means such as edge detection, contour extraction and the like to extract potential document edges, and designs features to screen out the document edges. The disadvantage of this method is that the contour extraction method is susceptible to noise and cannot cope with defects that edge portions are blocked.
The application publication number is CN109214240A, and the Chinese patent application publication date is 2019, 1 month and 15 days, which discloses a method for detecting document edges by using line segment detection means. The disadvantage of this method is that the edges of the document cannot be described in straight lines when there is distortion of the document, and therefore this method is not applicable to documents where distortion exists.
Therefore, the existing document edge detection method cannot meet the practical application such as the situations that the document edge is partially blocked, the document edge has bending deformation and the like.
Disclosure of Invention
The application aims to solve the technical problem of providing a book edge detection method which can rapidly and stably position the edge of a bent book in an image and is insensitive to noise existing in the image and shielding of the edge part of the book.
In order to solve the technical problems, the book edge detection method provided by the application comprises the following steps. Step S10: an image containing a book is acquired. Step S20: and extracting left and right edges of the book from the image by adopting a straight line detection method. Step S30: and extracting the upper edge and the lower edge of the book from the image by adopting a detection method based on the cyclic search trip point. The method comprises the steps of obtaining an image through a mobile phone camera; performing straight line detection on the edge map to determine the left edge and the right edge of the book; uniformly sampling a column pixel sequence in the left and right edge range, and determining a response jump point existing in the column pixel sequence; and (3) connecting the response jump points transversely, primarily screening the upper edge sequence and the lower edge sequence of the books through rules, and obtaining the accurate upper edge and the lower edge of the books through depth-first search.
Preferably, the step S10 includes acquiring an image including a book through a photographing and image capturing part of the mobile terminal, or acquiring an image including a book in a memory of the electronic device, or acquiring an image including a book through a network transmission mode. Several common ways of acquiring the original input image are given here by way of example.
Further, the step S20 includes the following steps. Step S21: and extracting an edge graph of the input image, and removing interference information of characters in the edge graph, lines in a table and lines in a picture by using an image processing method. Step S22: and (5) performing straight line detection on the picture. Step S23: and (5) screening left and right edge lines of the book from the detected straight lines. A specific implementation is given here for step S20.
Preferably, in the step S21, an edge map is obtained by using a Canny edge detection method based on a gradient method; or subtracting the image subjected to the vertical corrosion operation on the gray level image from the image subjected to the horizontal corrosion operation on the gray level image to obtain an edge image; and opening the edge graph to remove the interference information.
Preferably, in the step S22, a hough transform line detection method is adopted, and the line angle is limited between-45 ° and 45 °.
Preferably, in the step S23, a line with the greatest number of hough votes at the center point of the line on the left side of the image is selected as the left edge line of the book, and a line with the greatest number of hough votes at the center point of the line on the right side of the image is selected as the right edge line of the book.
Further, the step S30 includes the following steps. Step S31: the multiple sets of column pixel sequences are sampled uniformly over one or more channels or edge maps of the input image, within the range between the left and right edge lines of the book. Step S32: and respectively calculating and recording the jumping points of the sequences of each group of column pixel sequences by adopting a jumping point detection method based on cyclic search. Step S33, the jump points of each group of pixel sequences are transversely connected, and the upper edge and the lower edge of the book are screened out. A specific implementation is given here for step S30.
Preferably, in the step S31, a plurality of sets of column pixel sequences are uniformly sampled on a saturation channel of the input image.
Further, the step S32 includes the following steps. Step S321: the total variance of a certain set of column pixel sequences X is calculated. Step S322: circularly traversing the sequence X to find out the point X with the greatest contribution to the total inter-class variance of the sequence X cut As the first trip point of sequence X. Step S323: cutting the sequence X at the current jump point to obtain two subsequences, denoted S 0 And S is 1 The method comprises the steps of carrying out a first treatment on the surface of the Sub-sequence S 0 Traversing to obtain the point X with the greatest contribution to the total inter-class variance of the sequence X 0 And is recorded in X 0 The contribution of the cut to the total inter-class variance of sequence X is d0, the value pair (X 0 D 0) adding the same to the candidate hopping point set; the same is done for sub-sequence S1. Step S324: traversing the candidate trip point set to find the value pair with the largest contribution to the total inter-class variance of the sequence X, and recording as (X) cut2 D) X produced in this step is subjected to cut2 As a new trip point for sequence X. Step S325: judging whether the cut-off condition is met; if so, proceeding to step S33; if not, jumping to step S323; the cut-off condition includes that the number of hopping points is greater than a preset threshold one and the contribution of the current hopping point to the total inter-class variance of the sequence X is less than a preset threshold two. A specific implementation is given here for step S32.
Further, the step S33 includes the following steps. Step S331: calculating a vertical gradient map on a saturation channel of an input image, and marking as G saturation The method comprises the steps of carrying out a first treatment on the surface of the Calculating on the brightness channel of the input image to obtain a vertical gradient map, which is marked as G brightness . Step S332: searching the jump points of each group of pixel sequences backwards along the approximately horizontal direction according to the following rule to obtain multiple sets of pixel sequencesA set of hopping point sequences { H }; the j-th trip point on the i-th group of column pixel sequences is denoted as P ij The method comprises the steps of carrying out a first treatment on the surface of the Trip point P ij Is marked as y_P by the y-axis seat of (2) ij The method comprises the steps of carrying out a first treatment on the surface of the Assume that the current trip point is P ij The current trip point P ij In the pixel sequence of the immediately adjacent (i+1) th group of columns, the y-axis coordinate is in [ y_P ] ij –η,y_P ij +η]Within the range, and G saturation +G brightness Maximum trip point P i+1,x Connecting; if there is no eligible trip point P in the (i+1) -th group of column pixel sequences i+1,x Searching jump points meeting the conditions in the (i+2) th group of column pixel sequences; repeating the step until all column pixel sequences are exhausted, and transversely connecting all the jumping points meeting the conditions and adding the jumping points into a jumping point sequence set { H }; η is a search range threshold; then repeating the process on the j+1st jumping point on the ith group of column pixel sequences to obtain another jumping point sequence set { H }; each set of hopping point sequences { H } represents a line that is connected approximately horizontally. Step S333: screening out preliminary upper and lower edge sequences from a plurality of hopping point sequence sets { H }; the jump point sequence set { H } with the longest length and positioned at the upper half part of the image is taken as the upper edge sequence H of the image top The jump point sequence set { H } with the longest length positioned at the lower half part of the image is taken as the lower edge sequence H of the image bottom . Step S334: and fine tuning is carried out on the upper edge sequence and the lower edge sequence respectively to obtain the final upper edge and the final lower edge. A specific implementation is given here for step S33.
Preferably, in the step S334, the upper edge sequence H top Is connected with adjacent jumping points and takes the connection as a starting point and an end point to do depth first search so as to maximize G of a sequence saturation +G brightness Obtaining a final upper edge sequence by the value; for the lower edge sequence H bottom And performing the same operation to obtain a final lower edge sequence.
The application provides a book edge detection device which comprises an image acquisition unit, a left edge detection unit, a right edge detection unit and an upper edge detection unit and a lower edge detection unit. The acquisition unit is used for acquiring images containing books. The left and right edge detection unit is used for extracting left and right edges of the book from the image by adopting a straight line detection method. The upper and lower edge detection unit is used for extracting upper and lower edges of books in the images based on a trip point detection method of cyclic search. The device detects the left edge, the right edge, the upper edge and the lower edge of the book by adopting different technical means, and has the characteristics of rapidness and stability.
The technical effects achieved by the application include the following aspects. The processing is fast, and the edges of the books can be detected and extracted in real time at mobile terminals such as mobile phones. And the other is stable treatment. Due to the adoption of the jump point detection method based on the cyclic search, the book edge can still be accurately detected under the conditions of difficult scenes such as poor image quality (blurring or noise existence) and partial shielding of the book edge. Thirdly, the edge of the book can be detected.
Drawings
Fig. 1 is a flowchart of a book edge detection method provided by the application.
Fig. 2 is a detailed flowchart of step S20 in fig. 1.
Fig. 3 is a detailed flowchart of step S30 in fig. 1.
Fig. 4 is a flowchart of the trip point detection method using the loop search based step S32 in fig. 3.
Fig. 5 is a schematic diagram of the result of searching for a trip point for a column of pixel sequences using the method of fig. 4.
Fig. 6 is a flowchart of a specific implementation method of step S33 in fig. 3.
Fig. 7 to 13 are schematic diagrams illustrating steps of a book edge detection method according to the present application.
Fig. 14 is a schematic structural diagram of a book edge detecting device provided by the application.
The reference numerals in the drawings illustrate: 10 is an image acquisition unit; 20 is a left and right edge detection unit; and 30 is an upper and lower edge detection unit.
Detailed Description
Referring to fig. 1, the method for detecting the edge of the book provided by the application comprises the following steps.
Step S10: an image containing a book is acquired. For example, an image including a book is acquired by a photographing and imaging unit of a mobile terminal such as a mobile phone, or an image including a book is acquired in a memory of an electronic device, or an image including a book is acquired by a network transmission system.
Step S20: and extracting left and right edges of the book from the image by adopting a straight line detection method.
Step S30: and extracting the upper edge and the lower edge of the book from the image by adopting a trip point detection method based on cyclic search.
The left edge and the right edge of the book are not easy to bend and deform, so that the straight line detection method is more suitable. The upper edge and the lower edge of the book are easy to bend and deform, for example, the upper edge and the lower edge of the book after being unfolded are in an arc shape, so that a trip point detection method based on cyclic search is more suitable.
Referring to fig. 2, the step S20 of extracting the left and right edges of the book specifically includes the following steps.
Step S21: and extracting an edge map (edge map) of the input image, and removing interference information such as characters in the edge map, lines in a table, lines in a picture and the like by using an image processing method.
For example, an edge map is obtained by a Canny edge detection method based on a gradient method, which is commonly used in the field of image processing. For example, by adopting the image morphology processing method, the edge image can be obtained more quickly, namely, the image after vertical etching operation (Erode) is performed on the gray image minus the image after horizontal etching operation is performed on the gray image. An image morphological open operation (open) may be performed on the edge map to remove noise interference of text, lines in a table, lines in a picture, and the like.
The present application is not dependent on a specific edge map extraction method or a specific noise removal method. The foregoing is merely a preferred example.
Step S22: and (5) performing straight line detection on the picture. Straight line detection is a common type of digital image processing method, for example, a method of straight line detection using Hough Transform (Hough Transform), and limits the straight line angle to between-45 ° and 45 °.
Step S23: and (5) screening left and right edge lines of the book from the detected straight lines. For example, a line with the greatest number of hough votes at the center point of the line on the left side of the image is selected as the left edge line of the book, and a line with the greatest number of hough votes at the center point of the line on the right side of the image is selected as the right edge line of the book.
Referring to fig. 3, the step S30 of extracting the upper and lower edges of the book specifically includes the following steps.
Step S31: the multiple sets of column pixel sequences are sampled uniformly over one or more channels or edge maps of the input image, within the range between the left and right edge lines of the book. For example, 15 sets of column pixel sequences are sampled uniformly along the x-axis using the saturation channel of the input image.
Step S32: and respectively calculating and recording the jumping points of the sequences of each group of column pixel sequences by adopting a jumping point detection method based on cyclic search. The hopping point (also called a variable point) of a sequence is a point at which the sequence strength changes significantly. The book responds differently to the background area on the saturation channel, so the column pixel sequence will change significantly at the edge of the book, forming a trip point. Due to the different book shooting environments, there will be an unfixed number of jumping points in a group of column pixel sequences.
Step S33, the jump points of each group of pixel sequences are transversely connected, and the upper edge and the lower edge of the book are screened out.
In the step S32, the contents such as text and picture in the book, other objects in the background area, illumination, shadow and the like may interfere with the positioning of the jump points. Compared with the violent search method, the method is faster, and can meet the requirement of the edge detection task on the precision.
First a mathematical definition of variance, inter-class variance and inter-class variance variation over a set of column pixel sequences X is given. The sequence is marked as X, the length of the sequence is N, and the ith element in the sequence is marked as X i
The variance of sequence X is defined asAnd is denoted as equation one. Wherein->The average value of the sequence X is shown.
According to the first formula, the definition of the inter-class variance can be obtained after simple deduction. If the sequence X is divided into n subsequences, the jth subsequence is denoted as S j Having a length of n j Average value isThen the inter-class variance of sequence X is defined asAnd is noted as equation two.
According to the formula II, the definition of the variance variation between classes after the sequence is further segmented is further deduced. If subsequence S j Further divided into two subsequences S j0 And S is j1 This partition contributes to the inter-class variance of sequence X asAnd is denoted as formula three. Wherein n is j0 Representing the subsequence S j0 Length n of (2) j1 Representing the subsequence S j1 Is a length of (c).
According to the above definition, the step S32 may employ a trip point detection method based on a loop search as shown in fig. 4, which specifically includes the following steps.
Step S321: the total variance of a certain set of column pixel sequences X, denoted as σ, is calculated from equation one. Initializing a candidate trip point set CandidateCutList as an empty set. Initializing an output trip point set CutList as an empty set.
Step S322: circularly traversing the sequence X, finding out the point with the maximum contribution to the total inter-class variance of the sequence X, and marking the point as X cut X is taken as cut And adding the output jumping point set CutList. Each pair of pointsThe contribution of the total inter-class variance of sequence X can be calculated from equation three. This step only results in the first trip point X of the sequence X cut
Step S323: the sequence X is segmented at the current trip point to obtain two subsequences, denoted S 0 And S is 1 . Sub-sequence S 0 Traversing to obtain the point X with the greatest contribution to the total inter-class variance of the sequence X 0 And is recorded in X 0 The contribution of the cut to the total inter-class variance of sequence X is d0, the value pair (X 0 D0) is added to the candidate trip point set CandidateCutList. The same is done for sub-sequence S1.
Step S324: traversing the candidate hopping point set Candida ecartList, finding out the value pair with the largest contribution to the total inter-class variance of the sequence X, and recording as (X) cut2 D) X produced in this step is subjected to cut2 And adding the output jumping point set CutList.
Each time step S323 to step S324 are performed, one trip point is added to the output trip point set CutList.
Step S325: whether the cut-off condition is satisfied is determined. If so, step S33 is entered. If not, go to step S323. The cut-off condition includes that the number of the hopping points is stored to be larger than a preset threshold value I, and the contribution of the current hopping point to the total inter-class variance of the sequence X is smaller than a preset threshold value II.
Referring to fig. 5, a schematic diagram of the result of searching for a trip point for a column of pixel sequences using the method of fig. 4 is shown. The abscissa in fig. 5 is the pixel sequence number in the column pixel sequence, e.g., increasing from top to bottom; the ordinate is the saturation value. In the figure, each scattered point is a saturation value corresponding to each pixel in the column of pixel sequences, and the positions of the jump points detected through cyclic searching are marked on vertical lines. Fig. 5 exemplarily shows that 5 trip points are found in a set of column pixel sequences.
Referring to fig. 6, the step S33 further includes the following steps.
Step S331: calculating a vertical gradient map on a saturation channel of an input image, and marking as G saturation . In the brightness channel of the input imageCalculating to obtain a vertical gradient graph, which is marked as G brightness
Step S332: the hopping points of each set of column pixel sequences are searched back in a generally horizontal direction according to the following rules to obtain a plurality of hopping point sequence sets { H }. The j-th trip point on the i-th group of column pixel sequences is denoted as P ij . Trip point P ij Is marked as y_P by the y-axis seat of (2) ij . Assume that the current trip point is P ij The current trip point P ij In the pixel sequence of the immediately adjacent (i+1) th group of columns, the y-axis coordinate is in [ y_P ] ij –η,y_P ij +η]Within the range, and G saturation +G brightness Maximum trip point P i+1,x And (5) connection. If there is no eligible trip point P in the (i+1) -th group of column pixel sequences i+1,x Then the eligible trip points in the i+2-th set of column pixel sequences are searched. This is repeated until all column pixel sequences are exhausted, all the hops meeting the above conditions are laterally connected and added to one set of hopping sequences { H }. η is the search range threshold. And then repeating the process on the j+1st hopping point on the ith group of column pixel sequences to obtain another hopping point sequence set { H }. This step thus results in a plurality of sets of hopping sequences { H } each representing a line of generally horizontal connections.
Step S333: and screening out preliminary upper and lower edge sequences from the plurality of hopping point sequence sets { H }. The jump point sequence set { H } with the longest length and positioned at the upper half part of the image is taken as the upper edge sequence H of the image top The jump point sequence set { H } with the longest length positioned at the lower half part of the image is taken as the lower edge sequence H of the image bottom
Step S334: and fine tuning is carried out on the upper edge sequence and the lower edge sequence respectively to obtain the final upper edge and the final lower edge. Upper edge sequence H top Is used as a starting point and an end point to do depth-first search (depth first search) to maximize G of the sequence saturation +G brightness And (5) obtaining a final upper edge sequence. For the lower edge sequence H bottom And performing the same operation to obtain a final lower edge sequence.
For better understanding of the present application, fig. 7 to 13 sequentially illustrate output images of each step of the book edge detection method provided by the present application. Fig. 7 shows step S10 of acquiring an original input image containing a book. Fig. 8 shows the first half of step S21, extracting an edge map of the input image. Fig. 9 shows the second half of step S21, where the text in the edge map, the lines in the table, the lines in the picture, and other interference information are removed. Fig. 10 shows that step S22 and step S23 screen out the left and right edge lines of the book by the straight line detection method. Fig. 11 shows steps S31 to S32, in which the hopping points of the sequences are calculated and recorded for each group of column pixel sequences, respectively, the hopping points being indicated by white dots. Fig. 12 shows step S33, where the hopping points that connect the pixel sequences of each column laterally screen the upper and lower edges of the book. Fig. 13 shows the edges of a book detected according to the application, indicated by a black dashed box.
Referring to fig. 14, the book edge detecting apparatus provided by the present application includes an image acquiring unit 10, a left and right edge detecting unit 20, and an upper and lower edge detecting unit 30, corresponding to the method shown in fig. 1. The acquiring unit 10 is used for acquiring an image including a book, for example, a photographic component of a mobile terminal such as a mobile phone, a memory of an electronic device, or a network communication component. The left and right edge detection unit 20 is used to extract left and right edges of the book in the image using a straight line detection method. The upper and lower edge detection unit 30 is used for extracting upper and lower edges of the book from the image based on a trip point detection method of the cyclic search.
The above are only preferred embodiments of the present application, and are not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. The book edge detection method is characterized by comprising the following steps of:
step S10: acquiring an image containing a book;
step S20: extracting left and right edges of the book on an edge map of the image by adopting a straight line detection method;
step S30: uniformly sampling a column pixel sequence on an image, calculating a jump point in the column pixel sequence based on a jump point detection method of cyclic search, and extracting upper and lower edges of a book by connecting the jump points transversely;
the step S30 includes the following steps; step S31: uniformly sampling a plurality of sets of column pixel sequences on one or more channels or edge maps of an input image within a range between left and right edge lines of a book; step S32: respectively calculating and recording the jumping points of each group of column pixel sequences by adopting a jumping point detection method based on cyclic search; step S33, transversely connecting the jump points of each group of pixel sequences, and screening the upper edge and the lower edge of the book;
the step S32 includes the following steps; step S321: calculating the total variance of a certain group of column pixel sequences X; step S322: circularly traversing the sequence X to find out the point X with the greatest contribution to the total inter-class variance of the sequence X cut As the first trip point of sequence X; step S323: cutting the sequence X at the current jump point to obtain two subsequences, denoted S 0 And S is 1 The method comprises the steps of carrying out a first treatment on the surface of the Sub-sequence S 0 Traversing to obtain the point X with the greatest contribution to the total inter-class variance of the sequence X 0 And is recorded in X 0 The contribution of the cut to the total inter-class variance of sequence X is d0, the value pair (X 0 D 0) adding the same to the candidate hopping point set; the same operation is performed on the sub-sequence S1; step S324: traversing the candidate trip point set to find the value pair with the largest contribution to the total inter-class variance of the sequence X, and recording as (X) cut2 D) X produced in this step is subjected to cut2 As a new trip point for sequence X; step S325: judging whether the cut-off condition is met; if so, proceeding to step S33; if not, jumping to step S323; the cut-off condition includes that the number of hopping points is greater than a preset threshold one and the contribution of the current hopping point to the total inter-class variance of the sequence X is less than a preset threshold two.
2. The method according to claim 1, wherein the step S10 includes acquiring an image including a book by a photographing part of the mobile terminal, or acquiring an image including a book in a memory of the electronic device, or acquiring an image including a book by a network transmission method.
3. The book edge detection method of claim 1, wherein the step S20 includes the steps of;
step S21: extracting an edge graph of an input image, and removing interference information of characters in the edge graph, lines in a table and lines in a picture by using an image processing method;
step S22: performing straight line detection on the picture;
step S23: and (5) screening left and right edge lines of the book from the detected straight lines.
4. The book edge detection method according to claim 3, wherein in the step S21, an edge map is obtained by using a Canny edge detection method based on a gradient method; or subtracting the image subjected to the vertical corrosion operation on the gray level image from the image subjected to the horizontal corrosion operation on the gray level image to obtain an edge image; and opening the edge graph to remove the interference information.
5. The book edge detecting method of claim 3, wherein in the step S22, a hough transform line detecting method is adopted, and the line angle is limited between-45 ° and 45 °.
6. The method for detecting the edge of the book according to claim 3, wherein in the step S23, a line with the greatest number of hough votes at the center point of the line on the left side of the image is selected as the left edge line of the book, and a line with the greatest number of hough votes at the center point of the line on the right side of the image is selected as the right edge line of the book.
7. The book edge detection method according to claim 1, wherein in the step S31, a plurality of sets of column pixel sequences are uniformly sampled on a saturation channel of the input image.
8. The book edge detection method of claim 1, wherein the step S33 includes the steps of;
step S331: calculating a vertical gradient map on a saturation channel of an input image, and marking as G saturation The method comprises the steps of carrying out a first treatment on the surface of the Calculating on the brightness channel of the input image to obtain a vertical gradient map, which is marked as G brightness
Step S332: searching the jumping points of each group of column pixel sequences backwards along the approximately horizontal direction according to the following rule to obtain a plurality of jumping point sequence sets { H }; the j-th trip point on the i-th group of column pixel sequences is denoted as P ij The method comprises the steps of carrying out a first treatment on the surface of the Trip point P ij Is marked as y_P by the y-axis seat of (2) ij The method comprises the steps of carrying out a first treatment on the surface of the Assume that the current trip point is P ij The current trip point P ij In the pixel sequence of the immediately adjacent (i+1) th group of columns, the y-axis coordinate is in [ y_P ] ij –η,y_P ij +η]Within the range, and G saturation +G brightness Maximum trip point P i+1,x Connecting; if there is no eligible trip point P in the (i+1) -th group of column pixel sequences i+1,x Searching jump points meeting the conditions in the (i+2) th group of column pixel sequences; repeating the step until all column pixel sequences are exhausted, and transversely connecting all the jumping points meeting the conditions and adding the jumping points into a jumping point sequence set { H }; η is a search range threshold; then repeating the processing procedure of the j-th jumping point by the j+1th jumping point on the pixel sequence of the i-th group to obtain another jumping point sequence set { H }; each set of hopping point sequences { H } represents a line of generally horizontal connections;
step S333: screening out preliminary upper and lower edge sequences from a plurality of hopping point sequence sets { H }; the jump point sequence set { H } with the longest length and positioned at the upper half part of the image is taken as the upper edge sequence H of the image top The jump point sequence set { H } with the longest length positioned at the lower half part of the image is taken as the lower edge sequence H of the image bottom
Step S334: and fine tuning is carried out on the upper edge sequence and the lower edge sequence respectively to obtain the final upper edge and the final lower edge.
9. The book edge detecting method of claim 8, wherein in the step S334, the upper edge sequence H is set to top Is connected with adjacent jumping points and takes the connection as a starting point and an end point to do depth first search so as to maximize G of a sequence saturation +G brightness Obtaining a final upper edge sequence by the value; for the lower edge sequence H bottom And performing the same operation to obtain a final lower edge sequence.
10. The book edge detection device is characterized by comprising an image acquisition unit, a left edge detection unit, a right edge detection unit and an upper edge detection unit and a lower edge detection unit;
the acquisition unit is used for acquiring an image containing books;
the left and right edge detection units are used for extracting left and right edges of the book on an edge map of the image by adopting a straight line detection method;
the upper and lower edge detection units are used for uniformly sampling column pixel sequences on the image, calculating jump points in the column pixel sequences based on a jump point detection method of cyclic search, and transversely connecting the jump points to extract the upper and lower edges of the book;
the upper and lower edge detection units are specifically configured to sequentially process: a. uniformly sampling a plurality of sets of column pixel sequences on one or more channels or edge maps of an input image within a range between left and right edge lines of a book; b. respectively calculating and recording the jumping points of each group of column pixel sequences by adopting a jumping point detection method based on cyclic search; c. the jump points of each group of pixel sequences are transversely connected, and the upper edge and the lower edge of the book are screened out;
the upper and lower edge detection units are also configured to sequentially process for b: b1. calculating the total variance of a certain group of column pixel sequences X; b2. circularly traversing the sequence X to find out the point X with the greatest contribution to the total inter-class variance of the sequence X cut As the first trip point of sequence X; b3. the sequence X is segmented at the current jump point to obtain two sub-elementsThe sequence is denoted as S 0 And S is 1 The method comprises the steps of carrying out a first treatment on the surface of the Sub-sequence S 0 Traversing to obtain the point X with the greatest contribution to the total inter-class variance of the sequence X 0 And is recorded in X 0 The contribution of the cut to the total inter-class variance of sequence X is d0, the value pair (X 0 D 0) adding the same to the candidate hopping point set; the same operation is performed on the sub-sequence S1; b4. traversing the candidate trip point set to find the value pair with the largest contribution to the total inter-class variance of the sequence X, and recording as (X) cut2 D) X produced in this step is subjected to cut2 As a new trip point for sequence X; b5. judging whether the cut-off condition is met; if yes, entering c; if not, jumping to b3; the cut-off condition includes that the number of hopping points is greater than a preset threshold one and the contribution of the current hopping point to the total inter-class variance of the sequence X is less than a preset threshold two.
CN202010173429.6A 2020-03-12 2020-03-12 Book edge detection method and device Active CN111402281B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010173429.6A CN111402281B (en) 2020-03-12 2020-03-12 Book edge detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010173429.6A CN111402281B (en) 2020-03-12 2020-03-12 Book edge detection method and device

Publications (2)

Publication Number Publication Date
CN111402281A CN111402281A (en) 2020-07-10
CN111402281B true CN111402281B (en) 2023-11-10

Family

ID=71413320

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010173429.6A Active CN111402281B (en) 2020-03-12 2020-03-12 Book edge detection method and device

Country Status (1)

Country Link
CN (1) CN111402281B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112613523B (en) * 2020-12-15 2023-04-07 中冶赛迪信息技术(重庆)有限公司 Method, system, medium and electronic terminal for identifying steel flow at converter steel tapping hole

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6124950A (en) * 1997-04-15 2000-09-26 Minolta Co., Ltd. Apparatus and method for detecting book document along the longitudinal edge
CN102196112A (en) * 2010-03-01 2011-09-21 佳能株式会社 Page border detection method and device
CN104182934A (en) * 2014-08-06 2014-12-03 西安电子科技大学 Automatic book counting method based on spine image characteristics and spatial filtering
CN106250831A (en) * 2016-07-22 2016-12-21 北京小米移动软件有限公司 Image detecting method, device and the device for image detection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6124950A (en) * 1997-04-15 2000-09-26 Minolta Co., Ltd. Apparatus and method for detecting book document along the longitudinal edge
CN102196112A (en) * 2010-03-01 2011-09-21 佳能株式会社 Page border detection method and device
CN104182934A (en) * 2014-08-06 2014-12-03 西安电子科技大学 Automatic book counting method based on spine image characteristics and spatial filtering
CN106250831A (en) * 2016-07-22 2016-12-21 北京小米移动软件有限公司 Image detecting method, device and the device for image detection

Also Published As

Publication number Publication date
CN111402281A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN109993040B (en) Text recognition method and device
CN110147774B (en) Table format picture layout analysis method and computer storage medium
CN104978578B (en) Mobile phone photograph text image method for evaluating quality
RU2651144C2 (en) Data input from images of the documents with fixed structure
CN106548169B (en) Fuzzy literal Enhancement Method and device based on deep neural network
US8019164B2 (en) Apparatus, method and program product for matching with a template
CN110473189B (en) Text image definition judging method and system
CN110020692B (en) Handwriting separation and positioning method based on print template
RU2721188C2 (en) Improved contrast and noise reduction on images obtained from cameras
CN111259891B (en) Method, device, equipment and medium for identifying identity card in natural scene
CN113112511B (en) Method and device for correcting test paper, storage medium and electronic equipment
WO2021218706A1 (en) Text identification method and apparatus, device, and storage medium
CN112749696A (en) Text detection method and device
CN111915635A (en) Test question analysis information generation method and system supporting self-examination paper marking
CN113888756A (en) Method for determining effective area parameters, image acquisition method and test system
CN110060208B (en) Method for improving reconstruction performance of super-resolution algorithm
CN111402281B (en) Book edge detection method and device
CN108876845B (en) Fresnel pattern center determining method and device
CN115063813B (en) Training method and training device of alignment model aiming at character distortion
CN116030472A (en) Text coordinate determining method and device
CN114821596A (en) Text recognition method and device, electronic equipment and medium
CN110134924A (en) Overlay text component extracting method and device, text recognition system and storage medium
Tran et al. Super-resolution in music score images by instance normalization
CN116883461B (en) Method for acquiring clear document image and terminal device thereof
CN115344738B (en) Retrieval method and system based on artificial intelligence

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 200433 room 335, No. 8008-34, National Road, Shanghai, Yangpu District

Applicant after: Shanghai hehe Information Technology Co.,Ltd.

Address before: 200433 room 335, No. 8008-34, National Road, Shanghai, Yangpu District

Applicant before: INTSIG INFORMATION Co.,Ltd.

CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 1105-1123, No. 1256, 1258, Wanrong Road, Jing'an District, Shanghai, 200436

Applicant after: Shanghai hehe Information Technology Co.,Ltd.

Address before: 200433 room 335, No. 8008-34, National Road, Shanghai, Yangpu District

Applicant before: Shanghai hehe Information Technology Co.,Ltd.

CB02 Change of applicant information
TA01 Transfer of patent application right

Effective date of registration: 20210304

Address after: Room 1105-1123, 1256 and 1258 Wanrong Road, Jing'an District, Shanghai, 200436

Applicant after: Shanghai hehe Information Technology Co.,Ltd.

Applicant after: Shanghai Shengteng Data Technology Co.,Ltd.

Applicant after: Shanghai Linguan Data Technology Co.,Ltd.

Applicant after: Shanghai yingwuchu Data Technology Co.,Ltd.

Address before: Room 1105-1123, 1256 and 1258 Wanrong Road, Jing'an District, Shanghai, 200436

Applicant before: Shanghai hehe Information Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant