Embodiments of the present invention comprise methods and systems for automatically determining image-content boundaries.
It may be desirable to crop off extraneous portions of a digital page, also considered a digital image, digital document and image. In particular, in may be desirable to retain the content of the digital page while eliminating extraneous page margins. Exemplary applications in which this may be useful include applications in which the page content may be repositioned on a different size page than the original, applications in which the page content may be composited with additional material and other document layout applications. It may be desirable to perform cropping automatically without user interaction. It also may be desirable to perform cropping on a digital page comprising an arbitrarily shaped content region, and it may be desirable to perform cropping when the digital page content is skewed with respect to the orthogonal image axes. Methods and systems for automatically determining image-content boundaries, therefore, may be desirable.
Some embodiments of the present invention comprise methods and systems for determining content boundaries in a digital image. In some embodiments of the present invention, an edge detector based on local gradient computation may be used to generate a gradient field which may thresholded by magnitude to retain strong edges. The resulting localized edge positions may be projected onto a first direction and a second direction, which may be normal to the first direction, to form two projection histograms. In some embodiments of the present invention, the first direction may be related to a skew vector which describes the skew of the image content relative to the image axes. The projection histograms may be analyzed to determine the boundaries of the image content. In some embodiments of the present invention, the corners of a cropping rectangle may be computed, wherein the cropping rectangle may contain the desired content from the image. In some embodiments of the present invention, the digital image may be cropped according to the content boundaries. In some embodiments of the present invention, the digital image may be simultaneously cropped and corrected for skew.
The foregoing and other objectives, features, and advantages of the invention will be more readily understood upon consideration of the following detailed description of the invention taken in conjunction with the accompanying drawings.
Embodiments of the present invention will be best understood by reference to the drawings, wherein like parts are designated by like numerals throughout. The figures listed above are expressly incorporated as part of this detailed description.
It will be readily understood that the components of the present invention, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations. Thus, the following more detailed description of the embodiments of the methods and systems of the present invention is not intended to limit the scope of the invention but it is merely representative of the presently preferred embodiments of the invention.
Elements of embodiments of the present invention may be embodied in hardware, firmware and/or software. While exemplary embodiments revealed herein may only describe one of these forms, it is to be understood that one skilled in the art would be able to effectuate these elements in any of these forms while resting within the scope of the present invention.
It may be desirable to crop off extraneous portions of a digital page, also considered a digital image, digital document and image. In particular, in may be desirable to retain the content of the digital page while eliminating extraneous page margins. Exemplary applications in which this may be useful include applications in which the page content may be repositioned on a different size page than the original, applications in which the page content may be composited with additional material and other document layout applications. It may be desirable to perform cropping automatically without user interaction. It also may be desirable to perform cropping on a digital page comprising an arbitrarily shaped content region, and it may be desirable to perform cropping when the digital page content is skewed with respect to the orthogonal image axes.
Some embodiments of the present invention described in relation to
In some embodiments of the present invention described in relation to
G=∥∇∥1=|Gx|+|Gy|,
where |•| denotes absolute value.
In some embodiments of the present invention, the digital page, which may be denoted I, may be independently convolved with two edge kernels to determine the gradient fields in the x-direction and the y-direction. In some embodiments the edge kernels may comprise Sobel operators, and the gradient fields may be determined according to:
In alternative embodiments, edge detection may comprise other edge operators and methods known in the art, for example, a Canny edge detector, a Prewitt edge detector, a Roberts Cross kernel and a Hough transform.
In some embodiments of the present invention, the gradient magnitude, G, may be thresholded to form a binary image, also considered edge map, which may be denoted G′. In these embodiments, the binary image, G′, may be set equal to one of the binary values when a first condition is satisfied and may be set to the other of the binary values when the first condition is not satisfied. In some embodiments of the present invention, the binary image, G′, may be determined according to:
where θ denotes an adaptive threshold based on the content of the image and (i, j) denotes a location in the gradient-magnitude image, G.
In some embodiments of the present invention, the adaptive threshold, θ, may be determined according to:
in which w is the width of and h is the height of the gradient-magnitude image, G, respectively, and p is a parameter which may control the rejection of the weakest p percentage of edges. In some embodiments, the value of p may be set to 95. In alternative embodiments, p may be set in the range of 93 to 97.
Two projection histograms may be formed 6 by projecting the edge map, G′, onto a skew vector and a vector normal to the skew vector. Two exemplary projection histograms 10, 11 are shown in
Embodiments of the present invention may be further understood in relation to
In some embodiments of the present invention, the content boundaries may be described by the corners of a bounding rectangle. These corners may be denoted in relation to the locations determined from the projection histograms. Denoting the location of the first and last histogram bins with non-zero count in the projection histogram associated with the skew vector as left and right, respectively, and the location of the first and last histogram bins with non-zero count in the projection histogram associated with the skew vector normal as bottom and top, respectively, then the corners of the bounding rectangle may be given according to:
bottom-left corner is (left, bottom) in the skewed coordinate system,
bottom-right corner is (right, bottom) in the skewed coordinate system,
top-left corner is (left, top) in the skewed coordinate system and
top-right corner is (right, top) in the skewed coordinate system.
Some embodiments of the present invention may be described in relation to
Some embodiments of the present invention may be described in relation to
Some embodiments of the present invention may be described in relation to
In some embodiments of the present invention described in relation to
R=[max(topi) min(bottomi) min(lefti) max(righti)]
for a coordinate origin in the lower-left of an image, and according to:
R=[min(topi) max(bottomi) min(lefti) max(righti)]
for a coordinate origin in the upper-left of an image. In some embodiments of the present invention, determination 74 of the block content boundaries may be performed in parallel by a plurality of processors. In alternative embodiments, the determination 74 of the block content boundaries may be performed serially.
In some embodiments of the present invention described in relation to
R=[max(topi) min(bottomi) min(lefti) max(righti)]
for a coordinate origin in the lower-left of an image, and according to:
R=[min(topi) max(bottomi) min(lefti) max(righti)]
for a coordinate origin in the upper-left of an image. In some embodiments of the present invention, determination 84 of the block content boundaries may be performed in parallel by a plurality of processors. In alternative embodiments, the determination 84 of the block content boundaries may be performed serially.
In some embodiments of the present invention, the input image may be a color image. In alternative embodiments of the present invention, the input image may be a gray-scale image. In still alternative embodiments of the present invention, the input image may be a binary image.
In some embodiments of the present invention, the input image may be a luminance image corresponding to a color image. In alternative embodiments of the present invention, the input image may be a binary image corresponding to a color image. In still alternative embodiments of the present invention, the input image may be a binary image corresponding to a gray-scale image.
In some embodiments of the present invention, an image may be cropped according to the determined content boundaries.
In some embodiments of the present invention, an image may be simultaneously cropped according to the determined content boundaries and skew corrected.
The terms and expressions which have been employed in the foregoing specification are used therein as terms of description and not of limitation, and there is no intention in the use of such terms and expressions of excluding equivalence of the features shown and described or portions thereof, it being recognized that the scope of the invention is defined and limited only by the claims which follow.
Number | Name | Date | Kind |
---|---|---|---|
5335290 | Cullen et al. | Aug 1994 | A |
5452374 | Cullen et al. | Sep 1995 | A |
5465304 | Cullen et al. | Nov 1995 | A |
5528387 | Kelly et al. | Jun 1996 | A |
5781665 | Cullen et al. | Jul 1998 | A |
5825914 | Tsuboi | Oct 1998 | A |
5828776 | Lee et al. | Oct 1998 | A |
5854854 | Cullen et al. | Dec 1998 | A |
5880858 | Jin | Mar 1999 | A |
5892854 | de Queiroz et al. | Apr 1999 | A |
5901253 | Tretter | May 1999 | A |
5974199 | Lee et al. | Oct 1999 | A |
5978519 | Bollman et al. | Nov 1999 | A |
6011635 | Bungo et al. | Jan 2000 | A |
6043823 | Kodaira et al. | Mar 2000 | A |
6178270 | Taylor | Jan 2001 | B1 |
6201901 | Zhou et al. | Mar 2001 | B1 |
6282326 | Lee et al. | Aug 2001 | B1 |
6298157 | Wilensky | Oct 2001 | B1 |
6310984 | Sansom-Wai et al. | Oct 2001 | B2 |
6360026 | Kulkarni et al. | Mar 2002 | B1 |
6373590 | Ancin et al. | Apr 2002 | B1 |
6430320 | Jia et al. | Aug 2002 | B1 |
6556721 | Wang et al. | Apr 2003 | B1 |
6560376 | Kimbell et al. | May 2003 | B2 |
6674919 | Ma et al. | Jan 2004 | B1 |
6901168 | Gardes et al. | May 2005 | B1 |
6956587 | Anson | Oct 2005 | B1 |
6973222 | Haeberli | Dec 2005 | B2 |
6987880 | Dolan et al. | Jan 2006 | B2 |
7034848 | Sobol | Apr 2006 | B2 |
7065261 | Horie | Jun 2006 | B1 |
7068855 | Simske et al. | Jun 2006 | B2 |
7133050 | Schowtka | Nov 2006 | B2 |
7133571 | Cheatle | Nov 2006 | B2 |
7201323 | Kotovich | Apr 2007 | B2 |
7209149 | Jogo | Apr 2007 | B2 |
7239726 | Li | Jul 2007 | B2 |
7305146 | Cheatle | Dec 2007 | B2 |
7657091 | Postnikov | Feb 2010 | B2 |
7720291 | Trifonov | May 2010 | B2 |
20010005867 | Zhou et al. | Jun 2001 | A1 |
20010007116 | Zhou et al. | Jul 2001 | A1 |
20050168775 | Liu | Aug 2005 | A1 |
20050244079 | Lin et al. | Nov 2005 | A1 |
20060072847 | Chor et al. | Apr 2006 | A1 |
20060098844 | Luo | May 2006 | A1 |
20060109282 | Lin et al. | May 2006 | A1 |
20060188173 | Zhang et al. | Aug 2006 | A1 |
20060228044 | Yeh et al. | Oct 2006 | A1 |
20060280364 | Ma et al. | Dec 2006 | A1 |
20070013974 | Hattori | Jan 2007 | A1 |
20070076979 | Zhang et al. | Apr 2007 | A1 |
20090180694 | Chen | Jul 2009 | A1 |
20110142341 | Dolan et al. | Jun 2011 | A1 |
Number | Date | Country |
---|---|---|
2006-163821 | Jun 2006 | JP |
2008-305099 | Dec 2008 | JP |
Entry |
---|
USPTO Office Action—U.S. Appl. No. 12/639,895—Notification Date Jan. 6, 2011. |
USPTO Office Action—U.S. Appl. No. 12/639,895—Notification Date Aug. 11, 2011. |
Japanese Office Action—Patent Application No. 2010-263891—Mailing Date Feb. 14, 2012. |
Number | Date | Country | |
---|---|---|---|
20100014774 A1 | Jan 2010 | US |