CN106934788B - Rapid extraction method of straight line inclination angle - Google Patents

Rapid extraction method of straight line inclination angle Download PDF

Info

Publication number
CN106934788B
CN106934788B CN201511018905.2A CN201511018905A CN106934788B CN 106934788 B CN106934788 B CN 106934788B CN 201511018905 A CN201511018905 A CN 201511018905A CN 106934788 B CN106934788 B CN 106934788B
Authority
CN
China
Prior art keywords
data
image
projection
coordinates
taking
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
CN201511018905.2A
Other languages
Chinese (zh)
Other versions
CN106934788A (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.)
Shenyang Institute of Automation of CAS
Original Assignee
Shenyang Institute of Automation of CAS
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 Shenyang Institute of Automation of CAS filed Critical Shenyang Institute of Automation of CAS
Priority to CN201511018905.2A priority Critical patent/CN106934788B/en
Publication of CN106934788A publication Critical patent/CN106934788A/en
Application granted granted Critical
Publication of CN106934788B publication Critical patent/CN106934788B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection

Landscapes

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

Abstract

The invention relates to a method for quickly extracting a straight line inclination angle, which comprises the following steps: the image input unit carries out binarization processing on the image to obtain binarization data and coordinates, and sends the binarization data and the coordinates to the plurality of operation units; each single-angle image coordinate transformation and projection extreme value selection unit performs center rotation on the coordinates of the data in the image according to a set angle to obtain rotated coordinates; taking the rotated horizontal coordinate as a read-write address of the dual-port RAM, and taking the binary data as projection accumulated data of the dual-port RAM so as to complete the projection of the rotated image in the horizontal direction; selecting a maximum value in the projection data; the output result selection means selects the maximum value among the output results transmitted from the respective arithmetic means, and the corresponding set angle is used as the inclination angle of the straight line. The invention realizes the single-angle image coordinate transformation and projection extreme value selection unit, only needs to store less projection result data, does not need a large-capacity storage space to buffer the image data, and has high operation efficiency.

Description

Rapid extraction method of straight line inclination angle
Technical Field
The invention relates to the fields of image inclination correction, geometric figure feature extraction and the like in the field of image processing, in particular to a method for quickly extracting a straight line inclination angle.
Background
Line tilt angle extraction is a very important aspect in image processing. The method comprises the steps of firstly realizing image coordinate transformation and projection extreme value selection units, performing projection operation on image data at a given angle, only caching single-line data, realizing multi-path unit parallel operation control by a parallel operation control module, obtaining a middle maximum value by taking eight comparison data as a group, then taking the result of each group as the comparison data again, and finally obtaining a maximum value, thereby obtaining the inclination angle of a straight line.
Disclosure of Invention
The invention is applied to the rapid extraction of the linear inclination angle in image processing, can be widely applied to the field of image processing or detection as a general module, and is beneficial to improving the performance and the speed of a processing system.
The technical scheme of the invention comprises the following steps: a method for rapidly extracting a straight line inclination angle comprises the following steps:
the image input unit carries out binarization processing on the gray level image containing the straight line to obtain binarization data and coordinates of the data in the image and sends the binarization data and the coordinates of the data in the image to a plurality of single-angle image coordinate transformation and projection extreme value selection units;
each single-angle image coordinate transformation and projection extreme value selection unit performs center rotation on the coordinates of the data in the image according to a set angle to obtain rotated coordinates; taking the rotated horizontal coordinate as a read-write address of the dual-port RAM, and taking the binary data as projection accumulated data of the dual-port RAM so as to complete the projection of the rotated image in the horizontal direction; selecting the maximum value in the projection data as an output result and sending the output result to an output result selection unit;
the output result selection means selects the maximum value among the output results transmitted from the respective arithmetic means, and the set angle corresponding to the maximum value is set as the inclination angle of the straight line.
The binarization processing comprises the following steps:
taking the straight line as a foreground, taking 1 during binarization, and taking 0 for a background to obtain a binary image;
and in the output process of the binary image data, row-column counting is adopted to obtain binary data and coordinates of the data in the image.
The method comprises the following steps of taking the rotated horizontal coordinate as a read-write address of a dual-port RAM, taking binary data as projection accumulated data of the dual-port RAM, and completing projection of a rotated image in the horizontal direction, wherein the projection accumulated data comprises the following steps:
reading the written data by taking the rotated horizontal coordinate as an address for accessing the dual-port RAM, accumulating the written data with the current binary data, and writing the data into the dual-port RAM again;
after the coordinates of all the images and the binary data are input, the projection of the rotated images in the horizontal direction is realized.
The output result selection unit selects the maximum value among the output results sent by the operation units, and includes the following steps:
the output result selection unit groups the output results sent by the operation units, extracts the maximum value from each group as a result, and selects the maximum value from the results of each group.
A method for rapidly extracting a straight line inclination angle is realized by an FPGA.
The invention has the following advantages:
1. the invention can be widely applied to relevant systems needing straight line inclination angle extraction as an effective method.
2. The invention realizes the single-angle image coordinate transformation and projection extreme value selection unit, only needs to store less projection result data, does not need a large-capacity storage space to buffer the image data, and has high operation efficiency.
3. The algorithm structure of the invention fully considers the parallel operation characteristic of the programmable logic device, uses a plurality of rotary operation units to realize multi-angle parallel operation, and can obviously improve the processing speed.
4. The invention uses a modular design method to divide the inclination angle extraction operation process into a plurality of reconfigurable units, and can be very easily embedded into a related application system.
Drawings
FIG. 1 is a schematic view of the structure of the present invention.
Detailed Description
The present invention will be described in further detail below with reference to the accompanying drawings.
As shown in fig. 1, the present embodiment is implemented by using an FPGA, and includes an image input unit, a single-angle image coordinate transformation operation unit, a projection extremum selection unit, and an output result selection unit.
The collected gray image data containing straight lines are sequentially input into an image input unit according to the sequence of rows and columns, the image data input unit firstly carries out binarization processing on the gray image data, the selection of a threshold value during the binarization processing is obtained by a large number of experiments according to the characteristics of gray values of the straight lines and a background in practical application, the gray value where the straight lines are located is used as a foreground and is assigned to be 1, and the gray value where the background is located is 0, so that binary image data are obtained; the binary image data completes coordinate generation of the binary image data by using a row-column counter while inputting n single-angle image coordinate transformation and projection extreme value selection units.
When the number of the single-angle image coordinate transformation operation units and the number of the projection extreme value selection units are selected, the practical application conditions are followed, all possible situations are covered by a small angle range, for example, for the application with a small angle, the number of the operation units can be properly selected, so that the consumption of operation resources is reduced, and the operation efficiency of the algorithm is improved. In this embodiment, 30 arithmetic units are used.
Each single-angle image coordinate transformation operation unit and the projection extreme value selection unit firstly rotate the coordinate data sent by the image input module by taking the image center as a rotation center according to a set angle (in the embodiment, the serial number of the operation unit is used as the angle, namely 0-29 degrees), so as to obtain horizontal and vertical coordinates after the image rotation; then, the obtained horizontal coordinate is used as an access address of the azimuth dual-port RAM, written data of the dual-port RAM is read out to be added with image data sent by the image input module, and then the data is written back to the dual-port RAM, namely, the operation process of reading, repairing and rewriting is completed, it needs to be noted that the situation that two adjacent access addresses are the same when the dual-port RAM is accessed can occur, and the solution method is as follows: using a register to cache the last operation result, if the two access addresses are the same, using the value of the register as the result of reading the dual-port RAM, otherwise, selecting the dual-port RAM to read the value, thereby avoiding the occurrence of read-write collision; after the binary data of the whole image is input, the projection of the image data in the horizontal direction is finished; and after the projection data are obtained, the projection data are sequentially output, the maximum value is extracted through a comparison storage operation, and the maximum value is obtained and used as the operation result of the single-angle image coordinate transformation operation unit and the projection extreme value selection unit.
The output result selection unit firstly carries out sequential grouping processing on the data sent by each single angle operation unit, if 0-7 degrees are the 0 th group, 8-15 degrees are the 1 st group, and the like, each group extracts the maximum value in parallel, the eight grouping processing is completed, then the maximum value is selected from the results, and the rotation set angle corresponding to the value is the inclined angle of the image.

Claims (3)

1. A method for rapidly extracting a straight line inclination angle is characterized by comprising the following steps:
the image input unit carries out binarization processing on the image containing the straight line to obtain binarization data and coordinates of the data in the image and sends the binarization data and the coordinates of the data in the image to the multiple single-angle image coordinate transformation and projection extreme value selection units;
each single-angle image coordinate transformation and projection extreme value selection unit performs center rotation on the coordinates of the data in the image according to a set angle to obtain rotated coordinates; taking the rotated horizontal coordinate as a read-write address of the dual-port RAM, and taking the binary data as projection accumulated data of the dual-port RAM so as to complete the projection of the rotated image in the horizontal direction; selecting the maximum value in the projection data as an output result and sending the output result to an output result selection unit;
the method comprises the following steps of taking the rotated horizontal coordinate as a read-write address of a dual-port RAM, taking binary data as projection accumulated data of the dual-port RAM, and completing projection of a rotated image in the horizontal direction, wherein the projection accumulated data comprises the following steps:
reading the written data by taking the rotated horizontal coordinate as an address for accessing the dual-port RAM, accumulating the written data with the current binary data, and writing the data into the dual-port RAM again;
after the coordinates of all the images and the binary data are input, the projection of the rotated images in the horizontal direction is realized;
the output result selection unit selects the maximum value from the output results sent by the operation units, and the set angle corresponding to the maximum value is used as the inclination angle of the straight line;
the output result selection unit selects the maximum value among the output results sent by the operation units, and includes the following steps:
the output result selection unit groups the output results sent by the operation units, extracts the maximum value from each group as a result, and selects the maximum value from the results of each group;
wherein, 0-7 degrees are 0 th group, 8-15 degrees are 1 st group, and so on, each group extracts the maximum value in parallel, the eight groups are completed, then the maximum value is selected from the results, and the rotation setting angle corresponding to the value is the inclination angle of the image.
2. The method for rapidly extracting the straight line inclination angle according to claim 1, wherein the binarization processing comprises the steps of:
taking the straight line as a foreground, taking 1 during binarization, and taking 0 for a background to obtain a binary image;
and in the output process of the binary image data, row-column counting is adopted to obtain binary data and coordinates of the data in the image.
3. The method for rapidly extracting the straight line inclination angle according to claim 1, which is implemented by an FPGA.
CN201511018905.2A 2015-12-30 2015-12-30 Rapid extraction method of straight line inclination angle Active CN106934788B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511018905.2A CN106934788B (en) 2015-12-30 2015-12-30 Rapid extraction method of straight line inclination angle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511018905.2A CN106934788B (en) 2015-12-30 2015-12-30 Rapid extraction method of straight line inclination angle

Publications (2)

Publication Number Publication Date
CN106934788A CN106934788A (en) 2017-07-07
CN106934788B true CN106934788B (en) 2020-11-24

Family

ID=59442309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511018905.2A Active CN106934788B (en) 2015-12-30 2015-12-30 Rapid extraction method of straight line inclination angle

Country Status (1)

Country Link
CN (1) CN106934788B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289810A (en) * 2011-08-05 2011-12-21 上海交通大学 Quick rectangle detection method of images high resolution and high order of magnitude
CN102385750A (en) * 2011-06-22 2012-03-21 清华大学 Line matching method and line matching system on basis of geometrical relationship
JP4950290B2 (en) * 2007-06-27 2012-06-13 パナソニック株式会社 Imaging apparatus, method, system integrated circuit, and program
CN105096298A (en) * 2014-05-08 2015-11-25 东北大学 Grid feature point extraction method based on fast line extraction

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012145822A1 (en) * 2011-04-25 2012-11-01 Magna International Inc. Method and system for dynamically calibrating vehicular cameras
CN104766078B (en) * 2015-04-02 2018-06-22 四川九洲电器集团有限责任公司 The inclination angle detection method of target image and inclination angle detection device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4950290B2 (en) * 2007-06-27 2012-06-13 パナソニック株式会社 Imaging apparatus, method, system integrated circuit, and program
CN102385750A (en) * 2011-06-22 2012-03-21 清华大学 Line matching method and line matching system on basis of geometrical relationship
CN102289810A (en) * 2011-08-05 2011-12-21 上海交通大学 Quick rectangle detection method of images high resolution and high order of magnitude
CN105096298A (en) * 2014-05-08 2015-11-25 东北大学 Grid feature point extraction method based on fast line extraction

Also Published As

Publication number Publication date
CN106934788A (en) 2017-07-07

Similar Documents

Publication Publication Date Title
CN106203619B (en) Data optimized neural network traversal
TW201447776A (en) Performing object detection operations via a graphics processing unit
CN110582745B (en) Memory device and method for facilitating tensor memory access
US9678827B2 (en) Access counts for performing data inspection operations in data storage device
CN107748723B (en) Storage method and access device supporting conflict-free stepping block-by-block access
CN104331861B (en) Image rotating method and system
CN106846255B (en) Image rotation realization method and device
CN106530209A (en) FPGA-based image rotation method and apparatus
Ngo et al. Resource-aware architecture design and implementation of hough transform for a real-time iris boundary detection system
US10552307B2 (en) Storing arrays of data in data processing systems
CN103760525A (en) Completion type in-place matrix transposition method
US20160170648A1 (en) Data storage device and operating method thereof
CN115035128B (en) Image overlapping sliding window segmentation method and system based on FPGA
CN105488753A (en) Method and device for carrying out two-dimensional Fourier transform and inverse transform on image
CN106934788B (en) Rapid extraction method of straight line inclination angle
CN110930423B (en) Object edge feature recognition and extraction method
CN108920097B (en) Three-dimensional data processing method based on interleaving storage
CN113900813B (en) Blind pixel filling method, system and device based on double-port RAM
CN110490312B (en) Pooling calculation method and circuit
CN108182169A (en) Efficient FFT implementation methods in a kind of MTD wave filters
CN105069084A (en) Massive data oriented method for efficiently taking difference set
CN104333676A (en) Defective pixel shielding method and system
CN110569684B (en) Image binarization method for small-capacity cache
CN110264488B (en) Binary image edge extraction device
CN110503193B (en) ROI-based pooling operation method and circuit

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
GR01 Patent grant
GR01 Patent grant