WO2019019250A1 - 倾斜图像的倾斜值获取方法、装置、终端及存储介质 - Google Patents
倾斜图像的倾斜值获取方法、装置、终端及存储介质 Download PDFInfo
- Publication number
- WO2019019250A1 WO2019019250A1 PCT/CN2017/099644 CN2017099644W WO2019019250A1 WO 2019019250 A1 WO2019019250 A1 WO 2019019250A1 CN 2017099644 W CN2017099644 W CN 2017099644W WO 2019019250 A1 WO2019019250 A1 WO 2019019250A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- tilt
- value
- character
- regions
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/12—Edge-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
-
- 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/10—Character recognition
- G06V30/14—Image acquisition
- G06V30/146—Aligning or centring of the image pick-up or image-field
- G06V30/1475—Inclination or skew detection or correction of characters or of image to be recognised
- G06V30/1478—Inclination or skew detection or correction of characters or of image to be recognised of characters or characters lines
-
- 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/10—Character recognition
- G06V30/18—Extraction of features or characteristics of the image
- G06V30/1801—Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections
- G06V30/18019—Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections by matching or filtering
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20048—Transform domain processing
- G06T2207/20061—Hough transform
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30176—Document
-
- 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/10—Character recognition
Definitions
- the present invention relates to the field of image processing, and in particular, to a method, an apparatus, a terminal, and a storage medium for acquiring a tilt value of a tilt image.
- the boundary line of the image can be detected by the Hough line segment detection algorithm, but since the rectangular image includes the boundary line along the length direction and the width direction of the image, The borders of some rectangular images are not clear enough, so that multiple line segments will be extracted on the same boundary, and the background of some rectangular images is not pure enough to carry the impurity line segments, which will cause the detection of the Hough line segment detection algorithm. A lot of border lines.
- the boundary values are different. Normally, the slope values will be different from each other. Even the slope values of multiple line segments extracted from the same boundary of the rectangular image will have some differences, so that the tilt value of the image cannot be uniquely determined.
- the present invention provides a method, an apparatus, a terminal, and a storage medium for acquiring the tilt value of the tilt image.
- an embodiment of the present invention provides a method for acquiring a tilt value of a tilt image, where the tilt image is a rectangle, and the method for obtaining the tilt value includes:
- Parsing the oblique image acquiring coordinate information of a plurality of boundary lines of the oblique image
- the first tilt value corresponding to the minimum difference is determined as the tilt value of the tilt image.
- the embodiment of the present invention provides a tilt value acquiring device for a tilt image, wherein the tilt image is a rectangle, and the tilt value obtaining device includes:
- a parsing module configured to parse the oblique image, and acquire coordinate information of a plurality of boundary lines of the oblique image
- a first tilt value obtaining module configured to separately perform analysis and calculation on each coordinate information, to obtain a first tilt value of each of the boundary lines
- a calibration value acquisition module for obtaining a calibration value
- a difference calculation module configured to separately calculate a difference between each of the first tilt value and the calibration value to obtain a minimum difference
- a determining module configured to determine a first tilt value corresponding to the minimum difference value as a tilt value of the tilt image.
- an embodiment of the present invention provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the computer program
- the tilt value acquisition method of the oblique image described in the above first aspect is a third aspect.
- an embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the tilt image according to the first aspect. Tilt value acquisition method.
- the invention provides a method, a device, a terminal and a storage medium for acquiring a tilt value of a tilt image, and obtains a calibration value, and compares the first tilt value of each extracted boundary line with a calibration value, The first tilt value corresponding to the minimum difference is then determined as the tilt value of the tilt image, so that the tilt value of the tilt image is uniquely determined.
- FIG. 1 is a schematic flow chart of a first embodiment of a method for acquiring a tilt value of a tilt image according to the present invention
- FIG. 2 is a schematic flow chart of a second embodiment of a method for acquiring a tilt value of a tilt image according to the present invention
- FIG. 3 is a schematic flow chart of an embodiment of a calibration value acquisition method of the present invention.
- FIG. 4 is a schematic flow chart of an embodiment of a calibration value acquisition method of the present invention.
- Fig. 5 is a view showing the configuration of an embodiment of a tilt value acquiring device for a tilt image of the present invention.
- FIG. 1 is a schematic flow chart of a first embodiment of a method for acquiring a tilt value of a tilt image according to the present invention.
- the method includes:
- Step 101 Analyze the oblique image, and acquire coordinate information of a plurality of boundary lines of the oblique image.
- This step may specifically perform binarization processing on the oblique image to obtain a binarized image, that is, a black and white image; and detecting the binarized image based on the Hough line segment detection algorithm to obtain coordinate information of a plurality of boundary lines.
- the coordinate information may be a slope and an intercept of the boundary line in the plane rectangular coordinate system (x, y), or may be a coordinate of a boundary line corresponding to the point corresponding to the parameter plane (k, b).
- the binarization processing of the oblique image is to set the gray value of the pixel point in the oblique image to the first value or the second value, that is, to display the entire oblique image with a distinct black and white visual effect.
- the binarization processing method for the oblique image has a bimodal method, an iterative method, a P-parameter method, etc., and several types of binarization processing methods are listed, and there are many other methods of binarization processing, and embodiments of the present disclosure This is no longer listed one by one. For detailed steps of the binarization processing method, reference may be made to related technologies, which is not specifically described in this embodiment.
- the first value and the second value may be set in advance, and the first value is greater than the second value, for example, the first value may be 255, 254, 253, etc., and the second value may be 0, 1, 2 Etc., in order to more accurately obtain the contour of the straight line to be detected (ie, the boundary line) in the oblique image, thereby improving the accuracy of the line detection, the first value may be 255, and the second value may be 0, the implementation This example does not specifically limit this.
- the coordinates of the point, the number of intersecting lines corresponding to the intersection point, and the number of intersecting lines exceeds the preset number.
- the intersection point is determined as a point at which each boundary line corresponds to the parameter plane, and the coordinate information of the intersection point is determined as the coordinate information of the boundary point.
- the coordinates (k, b) of the intersection point are the slope and intercept of the boundary line.
- Step 102 Acquire a first tilt value of each boundary line according to each coordinate information.
- the first tilt value can be an oblique angle or a slope. Specifically, when the first tilt value is a slope, the slope of each boundary line may be extracted from the coordinate information of each boundary line; when the first tilt value is the tilt angle, the coordinate information of each boundary line may be extracted. The slope k of each boundary line, and the slope is calculated to obtain an inclination angle of arctank.
- a calibration value is obtained.
- the calibration value is used to filter or filter the first tilt value of each extracted boundary line, from which the tilt value of the unique tilt image is obtained. There are many ways to obtain calibration values.
- the obtained plurality of first tilt values may be clustered to obtain two clusters, each of which has a variance smaller than a preset variance value; and then respectively calculated in each cluster
- Each first tilt value corresponds to a length sum of the line segments; a maximum value or a minimum value of the two length sums obtained above is determined, and a mean value of the cluster corresponding to the maximum value or the minimum value is used as a calibration value.
- boundary lines are extracted: one is a boundary line substantially parallel to the longitudinal direction of the oblique image, and the other is a boundary line substantially parallel to the width direction; and all boundary lines substantially parallel to the longitudinal direction.
- the sum of the lengths is greater than the sum of the widths of all the boundary lines substantially parallel to the width direction. Therefore, by using the mean value of the cluster corresponding to the maximum value or the minimum value as a calibration value, the linear direction corresponding to the calibration value can be determined.
- the linear direction is substantially parallel to the longitudinal direction or the width direction of the oblique image.
- the tilt direction corresponding to the tilt value obtained in step 105 is the length direction of the oblique image; if the average value of the cluster corresponding to the minimum value is used as the calibration value, then step 105
- the tilt direction corresponding to the tilt value obtained in the middle is the width of the oblique image to.
- the oblique image may be parsed, and a plurality of element regions are extracted, wherein
- the element area is an area containing a single element in the oblique image; determining two adjacent element areas; acquiring all the second tilt values, and the second tilt value is a tilt value of a line connecting the adjacent two element areas; All the second tilt values are analyzed and calculated to obtain a calibration value.
- the oblique image may be parsed to extract a plurality of character regions, wherein the character region is an affine invariant region containing the characters; Two adjacent character regions, wherein a distance between two adjacent character regions is less than a preset distance value, and a preset distance value is less than or equal to a minimum line spacing of characters; obtaining all second tilt values, second The tilt value is the slope value of the line connecting the adjacent two character regions; the average value is obtained for all the second tilt values to obtain a calibration value.
- the straight line connecting any two adjacent character regions and the length direction of the oblique image is substantially parallel such that the oblique direction corresponding to the calibration value is the length direction of the oblique image.
- the method of extracting a plurality of character regions and extracting the oblique image and extracting the plurality of element regions is the same as the method of extracting the oblique image, and is specifically shown in the embodiment shown in FIG. 3, and details are not described herein.
- the tilt image is a captured image of the ID card
- the ID image is parsed, and all single-character regions are extracted, and the single-character region is an affine invariant region containing a single character; all single-character regions are grouped , get multiple single-character area groups; among them, single-character area group
- the distance between two adjacent single-character regions is smaller than the first preset threshold; the single-character region group with the largest length is obtained; and the inclination value of the connecting segment of the first and second single-character regions of the single-character region group with the largest length is obtained.
- step 104 the difference between each first tilt value and the calibration value is calculated separately to obtain a minimum difference.
- Step 105 Determine a first tilt value corresponding to the minimum difference value as a tilt value of the tilt image.
- the calibration value is obtained, and the first tilt value of each extracted boundary line is compared with the calibration value, and finally the first tilt value corresponding to the minimum difference value is determined as the tilt value of the tilt image, thereby making the tilt
- the tilt value of the image is uniquely determined.
- FIG. 2 is a schematic flow chart of a second embodiment of a method for acquiring a tilt value of a tilt image according to the present invention.
- the oblique image comes from the captured image of the tilted document.
- the method includes:
- Step 201 Acquire a captured image of the tilted document, wherein the captured image includes a background image and a tilted image.
- the tilted document can be specifically an ID card, a social security card or a bank card.
- Step 202 parsing the captured image, removing the background image, and obtaining a tilted image.
- the feature information of the preset tilt image may be acquired, and the feature information may specifically be a shape feature or a color brightness feature; and an image region matching the feature information is searched in the captured image; The area (ie, the background image) is removed, resulting in a tilted image.
- step 203 it is determined whether the size of the oblique image is larger than the size of the tilted document.
- Step 204 If the size of the tilt image is larger than the size of the tilt document, set the size of the tilt image to the size of the tilt document. If the size of the oblique image is less than or equal to the size of the tilted document, the size of the oblique image is not set.
- Step 205 parsing the oblique image, and acquiring coordinate information of a plurality of boundary lines of the oblique image.
- the step may specifically perform binarization processing on the oblique image to obtain a binarized image; and detecting the binarized image based on the Hough line segment detection algorithm to obtain coordinate information of the plurality of boundary lines.
- the information can be the coordinate information of the two endpoints of the boundary line.
- Step 206 Perform analysis and calculation on each coordinate information to obtain a first tilt value of each boundary line.
- the first tilt value can be an oblique angle or a slope.
- Step 207 obtaining a calibration value.
- the method of obtaining the calibration value is also described in detail above, and therefore will not be described again.
- Step 208 respectively calculating a difference between each of the first tilt values and the calibration values.
- Step 209 determining a first tilt value corresponding to the minimum difference value as a tilt value of the tilt image.
- the size of the oblique image may deviate from the size of the tilted document, and in the process of extracting the boundary line, the larger the size of the oblique image, the less easily the boundary line is extracted. Therefore, in the embodiment of the present invention, when the size of the oblique image is larger than the size of the tilted document, the size of the oblique image is set to the size of the tilted document, thereby ensuring that the oblique image is not excessively large, thereby not affecting the boundary line. extract.
- FIG. 3 is a schematic flowchart of an embodiment of a calibration value acquisition method according to the present invention.
- This embodiment describes the second method of obtaining the calibration value in detail.
- the oblique image includes a plurality of elements arranged in order, and the sorting direction of the plurality of elements is the same as the length direction or the width direction of the oblique image of the rectangle.
- the calibration value acquisition method specifically includes:
- Step 301 parsing the oblique image, and extracting a plurality of element regions, wherein the element region is an affine invariant region containing the element.
- Step 301 includes:
- the step includes: acquiring a preset number of gray thresholds, performing binarization processing on the oblique images by using each gray threshold, respectively, obtaining a binarized image corresponding to each gray threshold; acquiring the preset grayscale A region with a stable shape is maintained in each binarized image corresponding to the threshold range, and Maximum stable extreme value area.
- the step includes: determining a contour of the maximum stable extremum region; and obtaining a minimum circumscribed rectangle of the contour according to the determined contour, thereby obtaining a rectangular boundary of the maximum stable extremum region.
- the minimum circumscribed rectangle refers to the maximum range of the two-dimensional shape represented by two-dimensional coordinates, that is, the maximum abscissa, the minimum abscissa, the maximum ordinate, and the minimum ordinate of each vertice of a given two-dimensional shape are defined The rectangle.
- 301c is specifically: detecting whether there is a first rectangular boundary.
- the first rectangular boundary is a rectangular boundary located inside the other rectangular boundary, a rectangular boundary having an area larger than a second preset threshold, or a rectangular boundary having an aspect ratio greater than a third preset threshold; if the first rectangular boundary is detected, the The maximum stable extreme value region corresponding to the first rectangular boundary is filtered out in all the maximum stable extreme value regions.
- the second preset threshold may be one quarter of the area of the tilt image, and if the element is a character, the third preset threshold may be 1.5.
- Step 302 determining two adjacent element regions. Specifically, the distance between the two element regions may be acquired; determining whether the distance is less than a third preset threshold; if the distance is less than the third preset threshold, determining two element regions as two adjacent element regions .
- two The distance between the element regions may be the distance between the center points of the two element regions.
- the distance between the two element regions is the lateral distance and/or the longitudinal distance of the two element regions in the preset coordinate system.
- the third preset threshold is less than twice the element row spacing or twice the column spacing; or the third preset threshold is less than twice the element row spacing, and Less than twice the spacing of the element columns.
- the determined adjacent two element regions include two element regions adjacent in the element sorting direction, and/or two element regions adjacent in the vertical direction.
- the vertical direction is a direction perpendicular to the order in which the elements are sorted.
- the number of linear directions connecting the adjacent two element regions depends on the line spacing of the elements, the column spacing, and the third predetermined threshold.
- Step 303 Acquire all the second tilt values, and the second tilt value is a tilt value of a line connecting the adjacent two element regions.
- the distance between two adjacent element regions is less than a preset distance value.
- the preset distance value may be customized according to actual requirements. In this embodiment, the preset distance value should be less than twice the row spacing or column spacing of the element.
- step 304 all the second tilt values are analyzed and calculated to obtain a calibration value.
- the step includes: 304a, clustering all the second tilt values to obtain a plurality of tilt value clusters; 304b, obtaining the tilt value cluster with the largest weight (ie, the tilt value cluster having the largest number of tilt values); 304c Calculate the mean of the cluster of slope values with the largest weight and obtain the calibration value. Since the adjacent two element regions determined in step 302 include element regions adjacent in the longitudinal direction of the oblique image and element regions adjacent in the width direction of the oblique image, clustering and clustering of the tilt values having the largest weight are performed The mean value is used as a calibration value to uniquely determine the calibration value.
- the step 304a is specifically: acquiring a preset number; clustering all the third tilt values to obtain a preset number of tilt value clusters; calculating a variance of each tilt value cluster to obtain a minimum variance value; determining the minimum Whether the variance value is smaller than the first preset threshold; if the minimum variance value is greater than or equal to the first pre-predetermined value If the threshold is set, the preset number is updated, and the step of performing clustering on all the third tilt values to obtain a preset number of tilt value clusters is performed until the minimum variance value is less than the first preset threshold.
- the preset number is usually 2, and the more preset number is: adding 1 to the current preset number value, obtaining a new value, and assigning the new value to the preset number. If the tilt image is an image of an ID card, the first preset value is 200.
- the step of clustering all the tilt values to obtain a preset number of tilt value clusters includes: arbitrarily selecting a preset number of tilt values from all the tilt values as the initial cluster center; and for remaining others
- the tilt values are assigned to the cluster clusters represented by the initial cluster centers, based on their similarity with the initial cluster centers (ie, the distance from the initial cluster center). The number of clusters.
- FIG. 4 it is a schematic flowchart of an embodiment of a calibration value acquisition method according to the present invention. This embodiment describes in detail the fourth mode of obtaining the calibration value.
- Step 401 Parse the ID card image and extract a plurality of single character regions.
- the ID card image includes a plurality of characters in a sequence of characters, and the characters can be characters or numbers.
- the single character area is an affine invariant area containing a single character. Specifically, all the affine invariant regions in the ID image can be extracted based on the region feature extraction algorithm, and the single character region (ie, the affine invariant region that does not have all the features of the single character) is removed therefrom, thereby obtaining Single character area.
- Step 402 Acquire a first single character area.
- the first single-character region may be randomly selected from all the extracted single-character regions for the first-characterized single-character region group; for the first-character region group that is not first acquired, the first single-character region needs to be Random selection in the remaining single-character areas.
- the remaining single-character area refers to a plurality of single-character areas obtained by culling the acquired single-character area group from all single-character areas.
- Step 403 Acquire all the seconds that are smaller than the first preset threshold by the first single-character area.
- Single character area The distance between any two adjacent single-character regions in the single-character region group is smaller than the first preset threshold. Further, in order to divide all single-character regions located on the same line of the ID image into the same group as possible, any one of the single-character regions and any other single-character region group in any one-character region group The distance between the single character regions is greater than or equal to the first predetermined threshold.
- the first preset threshold has been described above in detail, and therefore will not be described herein.
- the single-character region in the middle usually has at least two single-character regions with a distance less than the first predetermined threshold, so in order to obtain all the single-character regions in the same row Need to get all the second single character areas.
- Step 404 until all the nth character single character regions whose distance from the n-1th single character region is smaller than the first preset threshold are obtained.
- This step can be understood as to sequentially obtain all the single-character regions whose reference distance is less than the first preset threshold from the newly acquired single-character region to the n-th single-character region.
- n is greater than or equal to 2.
- the first single character area, the second single character area, and the nth single character area are different.
- n can be a preset value, for example, n can be 10.
- n may also be an indefinite value.
- step 404 includes: obtaining a distance from the n-1th single-character area is smaller than All n-th character single-character regions of the first preset threshold until the n+1th single-character region acquisition fails.
- the n+1th single character area is different from the first single character area, the second single character area, and the nth single character area.
- the step 404 includes: acquiring all the third single-character regions whose distance from the second single-character region is less than the first preset threshold; acquiring all the first distances from the third single-character region that are smaller than the first preset threshold. Four single-character regions... until all n-th single-character regions whose distance from the n-1th single-character region is less than the first predetermined threshold are obtained. During the implementation of the step, since the distance between the third single-character region and the first character region and the second-character region is less than the first preset threshold, The obtained third single-character area and the previously acquired first single-character area are repeated. Therefore, the process in step 304 is performed to ensure that the currently obtained single-character area is different from all previously acquired single-character areas. ,specifically,
- the newly acquired m-th single-character region and all previously acquired single-character regions may be determined. (including all the first single-character area, the second single-character area, and the m-th single-character area) whether there is a coincidence. If there is a coincidence, the process ends. If there is no coincidence, the next step is performed: the latest acquired order
- the character area is a reference (ie, the mth single-character area), and all the m+1th single-character areas that are smaller than the first preset threshold from the reference distance (m single-character area) are acquired. Where m is less than or equal to n-1.
- Step 405 Determine the first single character area, the second single character area, and the nth single character area as a single character area group.
- Step 406 Acquire a single-character region group with the largest length.
- the step specifically includes: calculating the length of each single-character region group separately, and filtering out the single-character region group having the largest length.
- the length calculation of the single-character region group includes: obtaining the length of the connection line segment of the first and second single-character regions of the single-character region group; determining the length of the connection segment as the length of the single-character region group.
- the step of obtaining the length of the connecting line segment of the first two character regions of the single-character region group includes: obtaining a distance between any two single-character regions in the current single-character region group, and filtering out the maximum distance; The maximum distance is determined as the length of the connecting line segment of the first two character regions of the current single-character region group.
- the step of filtering out the single-character region group with the largest length includes: selecting the maximum length from the lengths of all the connected segment segments, and determining the single-character region group corresponding to the maximum length as the single-character region having the largest length. group.
- Step 407 Obtain a connection line between the first and last two single-character regions of the single-character region group with the largest length
- the slope value of the segment and the slope value of the connected segment is determined as the calibration value.
- the connecting line segment is a line segment that uses the reference point of each of the two single-character regions in the first and last ends as an end point.
- the reference point is specifically a geometric center point of a single character area.
- FIG. 5 it is a schematic structural view of an embodiment of a tilt value acquiring apparatus for a tilt image according to the present invention.
- the tilt value obtaining means includes a parsing module 501, a first tilt value acquiring module 502, a calibration value acquiring module 503, a difference calculating module 504, and a determining module 505.
- the parsing module 501 is configured to parse the oblique image, and acquire coordinate information of a plurality of boundary lines of the oblique image.
- the step may specifically perform binarization processing on the oblique image to obtain a binarized image; and detecting the binarized image based on the Hough line segment detection algorithm to obtain coordinate information of the plurality of boundary lines.
- the first tilt value obtaining module 502 is configured to separately perform analysis and calculation on each coordinate information to obtain a first tilt value of each boundary line.
- the first tilt value can be an oblique angle or a slope.
- the calibration value acquisition module 503 is configured to acquire a calibration value.
- the way the calibration value is obtained has been made above. A detailed introduction, so I will not repeat them here.
- the calibration value acquiring module 503 includes an element extracting unit, an adjacent element determining unit, and the Two tilt value acquisition unit and calibration value calculation unit.
- the element extracting unit is configured to parse the oblique image and extract a plurality of element regions, wherein the element region is an affine invariant region including the element.
- the adjacent element determining unit is for determining two adjacent element regions.
- the second tilt value acquisition unit is configured to acquire all the second tilt values, and the second tilt value is a tilt value of a line connecting the adjacent two element regions.
- the calibration value calculation unit is configured to perform analysis calculation on all the second tilt values to obtain a calibration value.
- the difference calculation module 504 is configured to separately calculate a difference between each of the first tilt values and the calibration values.
- the determining module 505 is configured to determine the first tilt value corresponding to the minimum difference value as the tilt value of the tilt image.
- the calibration value is obtained, and the first tilt value of each extracted boundary line is compared with the calibration value, and finally the first tilt value corresponding to the minimum difference value is determined as the tilt value of the tilt image, thereby making the tilt
- the tilt value of the image is uniquely determined.
- the tilt value acquisition device of the oblique image further includes a captured image acquisition module, a background removal module, a determination module, and a setting module.
- the captured image acquisition module is configured to acquire a captured image of the tilted document, wherein the captured image includes a background image and a tilted image.
- the tilted document can be specifically an ID card, a social security card or a bank card.
- a background removal module is configured to parse the captured image, remove the background image, and obtain a tilted image.
- the judging module is configured to judge whether the size of the tilt image is larger than the size of the tilt document.
- the setting module is configured to set the size of the oblique image to the size of the tilted document if the size of the tilted image is larger than the size of the tilted document.
- the parsing module 501 is configured to parse the oblique image set by the setting module, and acquire coordinate information of a plurality of boundary lines of the oblique image.
- the size of the oblique image may deviate from the size of the tilted document, and in the process of extracting the boundary line, the larger the size of the oblique image, the less easily the boundary line is extracted. Therefore, in the embodiment of the present invention, when the size of the oblique image is larger than the size of the tilted document, the size of the oblique image is set to the size of the tilted document, thereby ensuring that the oblique image is not excessively large, thereby not affecting the boundary line. extract.
- An embodiment of the present invention further provides a terminal, including a memory, a processor, and a computer program stored in the memory and operable on the processor, where the processor implements the tilt image described above when executing the computer program The method of obtaining the tilt value.
- the embodiment of the present invention further provides a computer readable storage medium storing a computer program, and when the computer program is executed by a processor, implementing the tilt value acquisition method of the oblique image.
- the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Geometry (AREA)
- Computer Graphics (AREA)
- Artificial Intelligence (AREA)
- Image Analysis (AREA)
- Apparatus For Radiation Diagnosis (AREA)
- Character Input (AREA)
Abstract
Description
Claims (20)
- 一种倾斜图像的倾斜值获取方法,其特征在于,所述倾斜图像为矩形,所述倾斜值获取方法包括:解析所述倾斜图像,获取所述倾斜图像的多个边界线的坐标信息;根据各个所述坐标信息,获取各个所述边界线的第一倾斜值;获取校准值;分别计算各个所述第一倾斜值与所述校准值的差值,以获得最小差值;将所述最小差值对应的第一倾斜值确定为所述倾斜图像的倾斜值。
- 如权利要求1所述的倾斜图像的倾斜值获取方法,其特征在于,所述解析所述倾斜图像,获取所述倾斜图像的多个边界线的坐标信息,包括:对所述倾斜图像进行二值化处理,得到二值化图像;基于霍夫线段检测算法对所述二值化图像进行检测,得到多个所述边界线的坐标信息。
- 如权利要求1所述的倾斜图像的倾斜值获取方法,其特征在于,所述倾斜图像为身份证图像;所述获取校准值,包括:解析身份证图像,提取所有的单字符区域,所述单字符区域为包含单个字符的仿射不变区域;对所有的单字符区域进行分组,得到多个单字符区域组;其中,所述单字符区域组中任意相邻的两个单字符区域之间的距离小于第一预设阈值;获取长度最大的单字符区域组;获取长度最大的单字符区域组的首尾两个单字符区域的连接线段的倾斜值,并将所述连接线段的倾斜值确定为校准值。
- 如权利要求3所述的倾斜图像的倾斜值获取方法,其特征在于,所述对所有的单字符区域进行分组,得到多个单字符区域组,包括:获取第一单字符区域;获取与所述第一单字符区域的距离小于所述第一预设阈值的所有第二字单字符区域;直至获取与第n-1单字符区域的距离小于所述第一预设阈值的所有的第n字单字符区域;其中,n大于2,且所述第一单字符区域、所述第二单字符区域直至所述第n单字符区域不相同;将所述第一单字符区域、所有的所述第二单字符区域直至所有的所述第n单字符区域确定为单字符区域组。
- 如权利要求1所述的倾斜图像的倾斜值获取方法,其特征在于,所述倾斜图像包括按序排列的多个元素,多个元素的排序方向与所述倾斜图像的长度方向或宽度方向相同;所述获取校准值,包括:解析所述倾斜图像,提取多个元素区域,所述元素区域为包含单个元素的区域;确定相邻的两个元素区域;获取所有的第二倾斜值,所述第二倾斜值为连接相邻的两个元素区域的直线的倾斜值;对所有的所述第二倾斜值进行分析计算,得到所述校准值。
- 如权利要求5所述的倾斜图像的倾斜值获取方法,其特征在于,所述对所有的所述第二倾斜值进行分析计算,得到所述校准值,包括:对所有的所述第二倾斜值进行聚类,得到多个倾斜值簇;获取权重最大的倾斜值簇;计算权重最大的倾斜值簇的均值,得到所述校准值。
- 如权利要求5所述的倾斜图像的倾斜值获取方法,其特征在于,所述解析倾斜图像,提取多个元素区域,包括:解析倾斜图像,提取所有的最大稳定极值区域;从所有的最大稳定极值区域中滤除非元素区域,得到多个所述元素区域。
- 如权利要求1所述的倾斜图像的倾斜值获取方法,其特征在于,当倾斜图像为长方形时,所述获取校准值,包括:对获取的多个第一倾斜值进行聚类,得到两个簇,每个簇的方差都小于预设方差值;分别计算每个簇中各第一倾斜值对应线段的长度和;确定获取的两个长度和中的最大值或最小值,并将最大值或最小值对应的簇的均值作为校准值。
- 如权利要求1所述的倾斜图像的倾斜值获取方法,其特征在于,解析所述倾斜图像,获取所述倾斜图像的多个边界线的坐标信息,之前还包括:获取倾斜证件的拍摄图像,其中,拍摄图像包括背景图像和倾斜图像;解析拍摄图像,去除所述背景图像,得到倾斜图像;判断倾斜图像的尺寸是否大于倾斜证件的尺寸;若倾斜图像的尺寸大于倾斜证件的尺寸,则将倾斜图像的尺寸设置为倾斜证件的尺寸;若倾斜图像的尺寸小于或等于倾斜证件的尺寸,则不对倾斜图像的尺寸进行设置。
- 一种倾斜图像的倾斜值获取装置,其特征在于,所述倾斜图像为矩 形,所述倾斜值获取装置包括:解析模块,用于解析所述倾斜图像,获取所述倾斜图像的多个边界线的坐标信息;第一倾斜值获取模块,用于分别对各个坐标信息进行分析计算,得到各个所述边界线的第一倾斜值;校准值获取模块,用于获取校准值;差值计算模块,用于分别计算各个所述第一倾斜值与所述校准值的差值,以获得最小差值;确定模块,用于将所述最小差值对应的第一倾斜值确定为所述倾斜图像的倾斜值。
- 如权利要求10所述的倾斜图像的倾斜值获取装置,其特征在于,所述倾斜图像的倾斜值获取装置还包括:拍摄图像获取模块,用于获取倾斜证件的拍摄图像,其中,拍摄图像包括背景图像和倾斜图像;背景去除模块,用于解析拍摄图像,去除所述背景图像,得到倾斜图像;判断模块,用于判断倾斜图像的尺寸是否大于倾斜证件的尺寸;设置模块,用于若倾斜图像的尺寸大于倾斜证件的尺寸,则将倾斜图像的尺寸设置为倾斜证件的尺寸。
- 一种终端,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如下步骤:解析所述倾斜图像,获取所述倾斜图像的多个边界线的坐标信息;根据各个所述坐标信息,获取各个所述边界线的第一倾斜值;获取校准值;分别计算各个所述第一倾斜值与所述校准值的差值,以获得最小差值;将所述最小差值对应的第一倾斜值确定为所述倾斜图像的倾斜值。
- 根据权利要求12所述的终端,其特征在于,所述解析所述倾斜图像,获取所述倾斜图像的多个边界线的坐标信息,包括:对所述倾斜图像进行二值化处理,得到二值化图像;基于霍夫线段检测算法对所述二值化图像进行检测,得到多个所述边界线的坐标信息。
- 根据权利要求12所述的终端,其特征在于,所述倾斜图像为身份证图像;所述获取校准值,包括:解析身份证图像,提取所有的单字符区域,所述单字符区域为包含单个字符的仿射不变区域;对所有的单字符区域进行分组,得到多个单字符区域组;其中,所述单字符区域组中任意相邻的两个单字符区域之间的距离小于第一预设阈值;获取长度最大的单字符区域组;获取长度最大的单字符区域组的首尾两个单字符区域的连接线段的倾斜值,并将所述连接线段的倾斜值确定为校准值。
- 根据权利要求14所述的终端,其特征在于,所述对所有的单字符区域进行分组,得到多个单字符区域组,包括:获取第一单字符区域;获取与所述第一单字符区域的距离小于所述第一预设阈值的所有第二字单字符区域;直至获取与第n-1单字符区域的距离小于所述第一预设阈值的所有的第n字单字符区域;其中,n大于2,且所述第一单字符区域、所述第二单字符区域直至所述第n单字符区域不相同;将所述第一单字符区域、所有的所述第二单字符区域直至所有的所述第n单字符区域确定为单字符区域组。
- 根据权利要求12所述的终端,其特征在于,所述倾斜图像包括按序排列的多个元素,多个元素的排序方向与所述倾斜图像的长度方向或宽度方向相同;所述获取校准值,包括:解析所述倾斜图像,提取多个元素区域,所述元素区域为包含单个元素的区域;确定相邻的两个元素区域;获取所有的第二倾斜值,所述第二倾斜值为连接相邻的两个元素区域的直线的倾斜值;对所有的所述第二倾斜值进行分析计算,得到所述校准值。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如下步骤:解析所述倾斜图像,获取所述倾斜图像的多个边界线的坐标信息;根据各个所述坐标信息,获取各个所述边界线的第一倾斜值;获取校准值;分别计算各个所述第一倾斜值与所述校准值的差值,以获得最小差值;将所述最小差值对应的第一倾斜值确定为所述倾斜图像的倾斜值。
- 根据权利要求17所述的计算机可读存储介质,其特征在于,所述解 析所述倾斜图像,获取所述倾斜图像的多个边界线的坐标信息,包括:对所述倾斜图像进行二值化处理,得到二值化图像;基于霍夫线段检测算法对所述二值化图像进行检测,得到多个所述边界线的坐标信息。
- 根据权利要求17所述的计算机可读存储介质,其特征在于,所述倾斜图像为身份证图像;所述获取校准值,包括:解析身份证图像,提取所有的单字符区域,所述单字符区域为包含单个字符的仿射不变区域;对所有的单字符区域进行分组,得到多个单字符区域组;其中,所述单字符区域组中任意相邻的两个单字符区域之间的距离小于第一预设阈值;获取长度最大的单字符区域组;获取长度最大的单字符区域组的首尾两个单字符区域的连接线段的倾斜值,并将所述连接线段的倾斜值确定为校准值。
- 根据权利要求19所述的计算机可读存储介质,其特征在于,所述对所有的单字符区域进行分组,得到多个单字符区域组,包括:获取第一单字符区域;获取与所述第一单字符区域的距离小于所述第一预设阈值的所有第二字单字符区域;直至获取与第n-1单字符区域的距离小于所述第一预设阈值的所有的第n字单字符区域;其中,n大于2,且所述第一单字符区域、所述第二单字符区域直至所述第n单字符区域不相同;将所述第一单字符区域、所有的所述第二单字符区域直至所有的所述第n单字符区域确定为单字符区域组。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/090,198 US11074443B2 (en) | 2017-07-28 | 2017-08-30 | Method and device for acquiring slant value of slant image, terminal and storage medium |
SG11201808503WA SG11201808503WA (en) | 2017-07-28 | 2017-08-30 | Method and device for acquiring slant value of slant image, terminal and storage medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710630855.6A CN107680108B (zh) | 2017-07-28 | 2017-07-28 | 倾斜图像的倾斜值获取方法、装置、终端及存储介质 |
CN201710630855.6 | 2017-07-28 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019019250A1 true WO2019019250A1 (zh) | 2019-01-31 |
Family
ID=61133913
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/099644 WO2019019250A1 (zh) | 2017-07-28 | 2017-08-30 | 倾斜图像的倾斜值获取方法、装置、终端及存储介质 |
Country Status (4)
Country | Link |
---|---|
US (1) | US11074443B2 (zh) |
CN (1) | CN107680108B (zh) |
SG (1) | SG11201808503WA (zh) |
WO (1) | WO2019019250A1 (zh) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112840308A (zh) * | 2018-12-19 | 2021-05-25 | 深圳市欢太科技有限公司 | 一种优化字体的方法及相关设备 |
CN110788858B (zh) * | 2019-10-23 | 2023-06-13 | 武汉库柏特科技有限公司 | 一种基于图像的物体校位方法、智能机器人及校位系统 |
CN111553344B (zh) * | 2020-04-17 | 2023-05-12 | 携程旅游信息技术(上海)有限公司 | 文本图像的倾斜校正方法、系统、设备和存储介质 |
CN114322849A (zh) * | 2020-09-29 | 2022-04-12 | 昆山午力电子有限公司 | 基于图像识别的物品特征定位系统 |
CN113379681B (zh) * | 2021-05-20 | 2022-11-04 | 深圳技术大学 | Led芯片倾斜角度的获取方法、系统、电子装置及存储介质 |
CN115229357B (zh) * | 2022-09-23 | 2022-12-13 | 江苏美乐嘉科技新材料有限公司 | 一种用于木塑材料的激光切割方法 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4136819B2 (ja) * | 2003-07-18 | 2008-08-20 | 株式会社リコー | 画像処理装置及びプログラム |
CN105608455A (zh) * | 2015-12-18 | 2016-05-25 | 浙江宇视科技有限公司 | 一种车牌倾斜校正方法及装置 |
CN106131362A (zh) * | 2016-07-12 | 2016-11-16 | 珠海赛纳打印科技股份有限公司 | 一种图像处理方法、装置及图像形成设备 |
Family Cites Families (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6373997B1 (en) * | 1991-07-30 | 2002-04-16 | Xerox Corporation | Coarse and fine skew measurement |
US5937084A (en) * | 1996-05-22 | 1999-08-10 | Ncr Corporation | Knowledge-based document analysis system |
US6310984B2 (en) * | 1998-04-09 | 2001-10-30 | Hewlett-Packard Company | Image processing system with image cropping and skew correction |
KR100264331B1 (ko) * | 1998-05-26 | 2000-08-16 | 윤종용 | 원고 비틀림 보정 장치 및 방법 |
CN101425142B (zh) * | 2008-09-17 | 2011-05-11 | 北大方正集团有限公司 | 页面倾斜角度的确定方法和装置 |
CN101408937B (zh) * | 2008-11-07 | 2011-12-21 | 东莞市微模式软件有限公司 | 一种字符行定位的方法及装置 |
CN101859382B (zh) * | 2010-06-03 | 2013-07-31 | 复旦大学 | 一种基于最大稳定极值区域的车牌检测与识别的方法 |
CN102955941A (zh) * | 2011-08-31 | 2013-03-06 | 汉王科技股份有限公司 | 身份信息录入方法和装置 |
CN103366165B (zh) | 2012-03-30 | 2016-06-29 | 富士通株式会社 | 图像处理装置、图像处理方法以及设备 |
JP6384236B2 (ja) * | 2014-09-29 | 2018-09-05 | ブラザー工業株式会社 | 制御プログラム、および情報処理装置 |
CN105590112B (zh) * | 2015-09-22 | 2018-12-04 | 成都数联铭品科技有限公司 | 一种图像识别中倾斜文字判断方法 |
CN106067023B (zh) * | 2016-06-02 | 2021-08-17 | 北京国泰星云科技有限公司 | 基于图像处理的集装箱箱号及集卡车号识别系统及方法 |
CN106127206B (zh) * | 2016-06-28 | 2019-04-05 | 北京智芯原动科技有限公司 | 一种车牌的竖直角度检测方法及装置 |
CN106529520A (zh) * | 2016-10-09 | 2017-03-22 | 中国传媒大学 | 基于运动员号码识别的马拉松比赛照片管理方法 |
CN106650739B (zh) * | 2016-12-09 | 2020-08-11 | 浙江浩腾电子科技股份有限公司 | 一种车牌字符切割新方法 |
CN106845475A (zh) * | 2016-12-15 | 2017-06-13 | 西安电子科技大学 | 基于连通域的自然场景文字检测方法 |
CN106846339A (zh) * | 2017-02-13 | 2017-06-13 | 广州视源电子科技股份有限公司 | 一种图像检测方法和装置 |
-
2017
- 2017-07-28 CN CN201710630855.6A patent/CN107680108B/zh active Active
- 2017-08-30 WO PCT/CN2017/099644 patent/WO2019019250A1/zh active Application Filing
- 2017-08-30 US US16/090,198 patent/US11074443B2/en active Active
- 2017-08-30 SG SG11201808503WA patent/SG11201808503WA/en unknown
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4136819B2 (ja) * | 2003-07-18 | 2008-08-20 | 株式会社リコー | 画像処理装置及びプログラム |
CN105608455A (zh) * | 2015-12-18 | 2016-05-25 | 浙江宇视科技有限公司 | 一种车牌倾斜校正方法及装置 |
CN106131362A (zh) * | 2016-07-12 | 2016-11-16 | 珠海赛纳打印科技股份有限公司 | 一种图像处理方法、装置及图像形成设备 |
Also Published As
Publication number | Publication date |
---|---|
CN107680108B (zh) | 2019-06-21 |
US20210124918A1 (en) | 2021-04-29 |
CN107680108A (zh) | 2018-02-09 |
SG11201808503WA (en) | 2019-02-27 |
US11074443B2 (en) | 2021-07-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019019250A1 (zh) | 倾斜图像的倾斜值获取方法、装置、终端及存储介质 | |
KR101690981B1 (ko) | 형태 인식 방법 및 디바이스 | |
WO2016065701A1 (zh) | 图像文字识别方法及装置 | |
CN113109368B (zh) | 玻璃裂纹检测方法、装置、设备及介质 | |
WO2021139197A1 (zh) | 一种图像处理方法及装置 | |
CN111739020B (zh) | 周期纹理背景缺陷标签自动标注方法、装置、设备及介质 | |
WO2017113692A1 (zh) | 一种图像匹配方法及装置 | |
CN111222507A (zh) | 数字式仪表读数的自动识别方法、计算机可读存储介质 | |
CN112541504A (zh) | 一种针对文本中单个字符目标的检测方法 | |
CN116342525A (zh) | 基于Lenet-5模型的SOP芯片引脚缺陷检测方法及系统 | |
CN109752393B (zh) | 一种基于图像特征的贴片电阻型号检测方法及其装置 | |
WO2019019681A1 (zh) | 身份证图像的倾斜值获取方法及装置、终端、存储介质 | |
Papandreou et al. | Word slant estimation using non-horizontal character parts and core-region information | |
Aldavert et al. | Manuscript text line detection and segmentation using second-order derivatives | |
CN109035285B (zh) | 图像边界确定方法及装置、终端及存储介质 | |
CN116434071B (zh) | 一种规整化建筑掩膜的确定方法、确定装置、设备及介质 | |
CN112036232A (zh) | 一种图像表格结构识别方法、系统、终端以及存储介质 | |
CN112950594A (zh) | 产品表面缺陷的检测方法、设备及存储介质 | |
CN109657577B (zh) | 一种基于熵和运动偏移量的动物检测方法 | |
EP2993623B1 (en) | Apparatus and method for multi-object detection in a digital image | |
CN115797649A (zh) | 一种复杂背景下的裂缝提取方法 | |
CN111275693B (zh) | 一种图像中物体的计数方法、计数装置及可读存储介质 | |
CN116416671B (zh) | 一种人脸图像旋正方法、装置、电子设备和存储介质 | |
CN117115275B (zh) | 畸变参数的确定方法、装置和计算机设备 | |
US20220392103A1 (en) | Visual positioning method, mobile machine using the same, and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17919540 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17919540 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 05.08.2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17919540 Country of ref document: EP Kind code of ref document: A1 |