CN104751177B - A kind of method for being used in reference numbers image give fuzzy digit straightway - Google Patents
A kind of method for being used in reference numbers image give fuzzy digit straightway Download PDFInfo
- Publication number
- CN104751177B CN104751177B CN201510137710.3A CN201510137710A CN104751177B CN 104751177 B CN104751177 B CN 104751177B CN 201510137710 A CN201510137710 A CN 201510137710A CN 104751177 B CN104751177 B CN 104751177B
- Authority
- CN
- China
- Prior art keywords
- bdss
- coordinates
- digital
- straight line
- mrow
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 238000006243 chemical reaction Methods 0.000 claims description 23
- 238000012417 linear regression Methods 0.000 claims description 8
- 238000004422 calculation algorithm Methods 0.000 claims description 7
- 230000009466 transformation Effects 0.000 claims description 6
- 230000000007 visual effect Effects 0.000 abstract description 6
- 238000004364 calculation method Methods 0.000 description 12
- 238000004458 analytical method Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000002715 modification method Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000009877 rendering Methods 0.000 description 3
- 239000007787 solid Substances 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 238000013519 translation Methods 0.000 description 3
- 238000007792 addition Methods 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 241001323519 Syngrapha alias Species 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000001351 cycling effect Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012015 optical character recognition Methods 0.000 description 1
- 238000011946 reduction process Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- HOWHQWFXSLOJEF-MGZLOUMQSA-N systemin Chemical compound NCCCC[C@H](N)C(=O)N[C@@H](CCSC)C(=O)N[C@@H](CCC(N)=O)C(=O)N[C@@H]([C@@H](C)O)C(=O)N[C@@H](CC(O)=O)C(=O)OC(=O)[C@@H]1CCCN1C(=O)[C@H]1N(C(=O)[C@H](CC(O)=O)NC(=O)[C@H](CCCN=C(N)N)NC(=O)[C@H](CCCCN)NC(=O)[C@H](CO)NC(=O)[C@H]2N(CCC2)C(=O)[C@H]2N(CCC2)C(=O)[C@H](CCCCN)NC(=O)[C@H](CO)NC(=O)[C@H](CCC(N)=O)NC(=O)[C@@H](NC(=O)[C@H](C)N)C(C)C)CCC1 HOWHQWFXSLOJEF-MGZLOUMQSA-N 0.000 description 1
- 108010050014 systemin Proteins 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
- 230000016776 visual perception Effects 0.000 description 1
- 238000003466 welding Methods 0.000 description 1
Landscapes
- Image Analysis (AREA)
Abstract
The present invention relates to a kind of method for being used in reference numbers image give fuzzy digit straightway, fuzzy digit straightway BDSS identification, fuzzy digit straightway BDSS save as recognition result in the form of gathering in fuzzy digit straightway BDSS recognizers are completed to digital picture;The fuzzy digit straightway BDSS given according to recognition result, calculates its geometry linear characteristic, and the rectangular shaped rim that the geometry linear characteristic is met using slope identifies given pixel set.The present invention is especially suitable for visual representation numeral straightway, there is the pixel set of rectilinear geometry feature in the digital pictures such as fuzzy digit straightway, in addition to rectangular shaped rim is added in digital picture, other raw informations in digital picture are not changed, and background is easier to observe;Implement simple, time-consuming and resolution ratio linearly stable increase substantially, performance efficiency.
Description
Technical Field
The invention relates to a method for identifying straight line segments of a given fuzzy number in a digital image, namely a calculation method for carrying out visual identification on a set consisting of scattered or continuous pixels.
Background
In digital image processing, identifying objects with specific attributes in an image has high academic and application values, such as face recognition, optical character recognition and the like. Digital straight line segments and derived graphic recognition with straight line geometry belong to important branches in the field of image recognition, and applications thereof include road recognition in satellite pictures (s.alias, v.a.tolpekina, w.bijkera, l.kumarb, "identification security of overhead roads in Iran from high spatial resolution sensing data", int.j.of application. earth Observation and geometry, vol.26, pp.21-25,2014.), and weld recognition in welding (l.jia, n.sun, "a line segment detection algorithm on stability analysis of calibrated dimensions, parameter & model, technology, pp.18.79-88,2014, etc.). The automatic identification and calculation method for the digital straight-line segment and the derivative object is continuously developed in the academic circles at home and abroad, and although the identification precision and efficiency gradually increase, the results are always marked by adopting a rough method, as shown in figure 1 in the description of the attached drawings. Fig. 1 shows three common identification methods, in order from left to right, an end point identification method (p.bhowmick and b.b.bhattacharya, "Fast polymeric adaptation of digital current using linear lighting properties", IEEE trans.pattern No. mach. intel., vol.29, No.9, pp.1590-1602, sept.2007), a color line identification method (l.jia, n.sun, "a line segment detection algorithm of linear simulation in digital image", com. model & New Technologies, vol.18, No.6, 79-88,2014) and an overlay identification method (l.zer, "a simple alignment, gradient, p.1684, p.1674, p.1). The common defects of the three identification methods are that a single color is used to completely cover an identification object, the original data of an image is modified too much, background information is lost, an overlapping area cannot be clearly identified, and the observation of the identified object by human eyes is hindered, particularly when the identified object only contains partial pixels of the covering area, the situation that the object contains partial pixels is a common situation in a real image. The academia usually carries out tests with corresponding original images similar to (a) and (c) in fig. 1, in such an ideal state, problems caused by monochromatic coverage are not significant, but when the practical application is involved, experiments are often carried out repeatedly according to the test results of practical images, and the three marking methods similar to those shown in fig. 1 can cause complete loss of background information of a marking area and difficulty in distinguishing overlapping areas in practical experiments, so that the test results are difficult to evaluate with human eyes. Therefore, there is no identification calculation method that is simple to implement and can relatively well preserve the image background for image recognition, especially for recognition of digital straight line segments and derived objects.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the invention provides a method for identifying given fuzzy digital straight line segments in a digital image, which is particularly suitable for visually identifying pixel sets with straight line geometric characteristics in digital images such as digital straight line segments, fuzzy digital straight line segments and the like, and does not modify other original information in the digital image except for adding a rectangular frame in the digital image.
For clarity of presentation, reference will now be made in detail to some of the symbols and concepts related to the present invention.
Z+Representing a set of positive integers.
Z represents a set of integers including zero.
R+Representing a set of positive real numbers including zero.
R represents a set of real numbers including zero.
max { condition that element | element satisfies } represents the "largest" element that satisfies the condition.
min { condition that element | element satisfies } represents the "smallest" element that satisfies the condition.
For R ∈ R+,
Representing the width of the digital image.
Representing the height of the digital image.
Exist r1,r2∈R+Satisfies the conditions
Index value:
image data: digitized information identified and stored by an index value.
Image space (notation)): image data of the digital image is saved. Each recording unit corresponds to a unique pixel. In the image data, the pixel index value corresponding to the upper left corner of the image information isArranging pixels in the order of left to right and then top to bottom corresponding to image information, wherein the kth e.Z in the order+An index value of one pixel is
piRepresenting a pixel in image space with index value i.
p(x,y)Represents a pixel in image space corresponding to a point (x, y) in coordinate space, where x, y ∈ Z.
dist(o1,o2): when o is1,o2At a point in two-dimensional space, dist (o)1,o2) Represents o1And o2The euclidean distance between them; when o is1,o2Dist (o) when respectively a point and a straight line in two-dimensional space1,o2) Represents from o1Do and o2Straight vertical line, perpendicular line and o2From point of intersection to o1The Euclidean distance of; when o is1,o2∈R,dist(o1,o2)=|o1-o2|。
For r, round (r) min Z ∈ Z+|dist(z,r)≥0}。
Offset amount: for theOffset is as follows
Serialization: will be provided withThe pixels in (1) are arranged in a row one by one to the right according to the ascending order of the index value, and when the number of the pixels in one row isStarting another row just below the first pixel in the row, and arranging the pixels continuously according to the arrangement method of the previous row, and repeating the steps until the pixels are arranged again and againAll the pixels are arranged according to the ascending order of the index value, and the number of the pixels in each row is Can be regarded as having a longWidth ofAnd the unit Euclidean distance isIn a two-dimensional space.
Coordinate space (notation as): serializationAnd optionally selecting a rectangular coordinate system with one pixel as an origin. For two points (x) in the coordinate system with a unit Euclidean distance1,y1) And (x)2,y2) Is of the formulaGiven a unit Euclidean distance value ofThe coordinate system is a two-dimensional space with infinite length (y-axis) and width (x-axis).
Average center: for theWherein i is 1,2 … n, n is the total number of pixels contained in the BDSS; mean centerHas the coordinates of
Image center: i.e. pixel
And (3) coordinate centralization: serializationIs provided withIs the image center and the positive x-axis points to the right of the line in which the image center lies, for an offset known as diIs formed by a plurality of pixelsAndthe center coordinate is Is in one-to-one correspondence with (x)i,yi) Is referred to as piThe center coordinates of (a). When pixelIs known as (x)i,yi) At an offset of Index value of
Digital straight line segment (DSS): coordinate centeringIf pixelAndare respectively the coordinate values ofAndip,iq,jp,jqe is Z and ip<iqAnd the straight lines passing through p and q are denoted asAnd the slope thereof belongs to the interval (0,1) forWhere the middle straight line x ═ i ∈ R where ip≤i≤iqIf straight lineAnd the coordinate of the intersection point of the straight line x ═ i is (x, y), then there is a unique pixel whose coordinate value is (round (x), round (y)), and whose euclidean distance from the intersection point is not more thanIn the interval [ ip,iq]By varying the value of i internally, a set of such pixels is obtained, the digital straight-line segment DSS (p, q) defined by p and q being:
blurred digital straight line segment (BDSS): coordinate centeringIf i, j, a, b, μ, ω ∈ Z, b ≠ 0, and gcd (a, b) ≠ 1, it satisfiesWith the condition that mu is less than or equal to di-bj is less than or equal to mu + omegaThe collection of blurred digital straight line segments BDSS (a, b, μ, ω), namely:
on the basis of the above definition, the technical scheme adopted by the invention for solving the technical problems is as follows:
when the fuzzy digital straight line segment BDSS recognition algorithm is completed, the width is widenedHeight ofIdentifying the fuzzy digital straight line segments BDSS in the digital image, and storing the fuzzy digital straight line segments BDSS as an identification result in a set form;
and calculating the geometric straight line characteristic of the fuzzy digital straight line segment BDSS according to the given fuzzy digital straight line segment BDSS of the recognition result, and identifying the given pixel set by using a rectangular frame with the slope meeting the geometric straight line characteristic.
The method specifically comprises the following steps:
step 1: calculating coordinate-centered image space, corresponding coordinate spaceThe center coordinates of (a);
step 2: calculating an average center according to the central coordinates of pixels in the fuzzy digital straight-line segment BDSS, and calculating the direction theta of the fuzzy digital straight-line segment BDSS by using linear regression;
and step 3: calculating the conversion coordinates of the pixels in the blurred digital straight line segment BDSS: centering coordinates into a corresponding coordinate spaceThe origin of (a) is translated to the average center, and the positive x-axis half shaft is rotated to coincide with theta;
and 4, step 4: calculating the conversion coordinate system of the fuzzy digital straight-line segment BDSS according to the conversion coordinates of the pixels in the fuzzy digital straight-line segment BDSSFour boundary points in (1);
and 5: generating a boundary line l parallel to the direction theta1And l2And calculating its transformation coordinates, boundary line l1And l2Respectively passing through two boundary points in the step 4;
step 6: generating a boundary line l perpendicular to the direction theta3And l4And calculating its transformation coordinates, boundary line l3And l4Respectively passing through the other two boundary points, line l, in step 41,l2,l3And l4Intersecting to form a rectangular frame;
and 7: calculating the center coordinates of the transformation coordinates generated in the steps 5 and 6;
and 8: and calculating the offset of the center coordinate generated in the step 7, and saving the offset as a result to be output.
The set of pixels determined from the offset is a rectangular frame, and finally, the values of the pixels contained in the rectangular frame can be modified in the digital image identifying the BDSS using a pixel modification method to identify the blurred digital straight line segment BDSS.
In steps 1 and 2, the digital image of the identified blurred digital straight line segment BDSS is mapped intoCoordinate centeringFor any pixel p e BDSS,if the offset of p is d, its center coordinate is calculated according to equation (1):
calculating the average center of BDSS according to the center coordinates of BDSS pixels
According to the linear regression theory, the direction θ ∈ [0, π) of BDSS is calculated by equation (2):
where i is 1,2 … n, and n is the total number of pixels contained in the BDSS.
In step 3, forWhich converts coordinates thereofCalculating according to equation (3):
in step 4, the coordinate system is convertedIs obtained by comparing all the abscissa x and ordinate y of the transformed coordinates.
Coordinate spaceHas the origin of the transformation coordinates of In step 7, forCenter coordinates thereofCalculated according to equation (7):
in step 8, forThe shift amount d of the pixel is calculated by equation (8):
in thatIn (2), since the origin is located at the average center of the BDSS, four extreme values exist in the BDSS pixel conversion coordinate, namely, the maximum value x 'of the abscissa'lmaxAbscissa minimum value x'lminMaximum value y 'of ordinate'wmaxAnd ordinate minimum value y'wmin;In which there is a corresponding converted coordinate (x'lmax,0),(x′lmin,0),(0,y′wmax) And (0, y'wmin) The pixels are the boundary points in the step 4;
wherein,representing rectangular bordersIs given by formula (4):
whereinm=1,2,3,4,Represents from p'(x′,y′)Do and lmStraight vertical line, perpendicular line andmfrom point of intersection to p'(x′,y′)Euclidean distance of.
Rectangular frameActually, the expression (4) is composed of four line segments, and the expression (5) and the expression (6) can be replaced by the expression (5) and the expression (6), wherein the expression (5) and the expression (6) are respectively l1And l2Upper, l3And l5On the upper partTransformed coordinates of the pixel:
the method for identifying the given fuzzy digital straight line segment in the digital image has the advantages that the geometric straight line characteristic of a pixel set consisting of scattered or continuous pixels of the given digital straight line segment, the fuzzy digital straight line segment and the like is calculated, and the given pixel set is identified by using a rectangular frame with the slope meeting the calculated characteristic, so that the method has the following advantages:
(1) the method clearly marks the given fuzzy digital straight line segment without greatly modifying the background pixel. With the increase of the resolution of the identified digital image, the ratio of the number of the modified pixels to all the pixels of the image is rapidly reduced, the visual effect of the image is presented in a high-resolution image, and the BDSS background identified by the method is easier to observe; even if the image is a small-resolution image, the method has limited occupation on the image background.
(2) The method is simple to implement, the time consumption and the resolution ratio are basically increased in a linear and stable manner, and the performance is high.
Drawings
The invention is further illustrated with reference to the following figures and examples.
Fig. 1 shows a conventional marking method. (a) An end point identification method, (b) a color line segment identification method, and (c) a slope coverage identification method.
FIG. 2 is a schematic diagram of a method of the present invention for identifying a given blurred digital straight segment in a digital image. (a) Rotating the original coordinate system to the conversion coordinate system, and (b) rotating the conversion coordinate system back to the original coordinate system.
FIG. 3 is a data structure of a Point class in a method of the present invention for identifying a given blurred digital straight segment in a digital image.
FIG. 4 is a functional block diagram of a method of the present invention for identifying a given blurred digital straight segment in a digital image.
FIG. 5 is a functional block diagram of step 2 of a method of the present invention for identifying a given blurred digital straight-line segment in a digital image.
FIG. 6 is a functional block diagram of step 5 of a method of the present invention for identifying a given blurred digital straight-line segment in a digital image.
FIG. 7 is a functional block diagram of step 6 of a method of the present invention for identifying a given blurred digital straight-line segment in a digital image.
Fig. 8 is a graph of the results of the present invention identifying straight line segments of a given blurred number in a 128 x 128 resolution image. (a) Image camera, (b) image house, (c) image lena, and (d) image puzzle.
Fig. 9 is a graph of the results of the present invention identifying straight line segments of a given blurred number in an image of 256 x 256 resolution. (a) Image camera, (b) image house, (c) image lena, and (d) image puzzle.
Fig. 10 is a graph of the results of the present invention identifying straight line segments of a given blurred number in an image at 512 x 512 resolution. (a) Image camera, (b) image house, (c) image lena, and (d) image puzzle.
Fig. 11 is an analysis of the average elapsed time for the completion of rendering all BDSS bounding boxes in a picture at various steps of a method of the present invention for identifying straight line segments in a given blurred digital image.
Fig. 12 is a time consuming analysis of the various steps of a method of the present invention for identifying straight line segments in a given blurred digital image to complete the rendering of the longest BDSS bounding box in a single image.
FIG. 13 is a time consuming analysis of the different steps of a method of the present invention for identifying straight line segments in a given blurred digital image to complete the rendering of the shortest BDSS bounding box in a single image.
FIG. 14 is a plot of an analysis of the total time taken by a method of the present invention for identifying a given blurred digital straight-line segment in a digital image as the resolution of the image increases.
Detailed Description
The present invention will now be described in further detail with reference to the accompanying drawings.
When BDSS recognition algorithm is completed for breadthHeight ofThe identification of blurred digital straight line segments (BDSS) in the digital image of (1), the BDSS being stored as an identification result in a set form.
For any BDSS, its morphology is similar to that shown in fig. 2(a) and 2(b) of the accompanying drawings, according to the BDSS definition. Fig. 2(a) and 2(b) show a BDSS for each of the pixel groups represented by squares, where fig. 2(a) shows the rotation of the original coordinate system to the transformed coordinate system and fig. 2(b) shows the rotation of the transformed coordinate system back to the original coordinate system. The object of the present invention is to obtain a curve l shown in FIG. 2(a) from a given BDSS by a mathematical principle-based calculation1,l2,l3And l4The rectangular borders formed by the intersections identify the offset of the corresponding pixels in the digital image of the BDSS. Each straight line passing through a boundary point, and1,l2parallel to the BDSS direction theta, |3,l4Perpendicular to theta.
The set of pixels determined from the offset is referred to as a rectangular border, and various pixel modification methods other than the present invention may be used to modify the values of the pixels contained in the rectangular border in a digital image that identifies the BDSS to identify the BDSS.
For a given one of the BDSSs, mapping the digital image identifying the BDSS intoCoordinate centering Coordinate system corresponding to center coordinates of middle pixelsIn fig. 2, the straight lines are indicated by arrows perpendicular to each other, and the arrow marked with x indicates the positive x-axis. For any pixel p ∈ BDSS, if p is offset by d, its center coordinate is calculated according to equation (1):
from the center coordinates of the BDSS pixels, the average center of the BDSS may be calculatedIn FIG. 2, solid dots and Chinese characters are markedAccording to the linear regression theory, the direction θ ∈ [0, π ] of BDSS is calculated by equation (2):
n is the total number of pixels contained in the BDSS.
In FIG. 2(a) < CHEM >1And l2Parallel,. l1And l2Andthe smaller included angle of the positive semi-axis of the middle x axis is theta. Although l can be directly calculated from the central coordinates of theta and BDSS pixels1,l2,l3And l4Parameters and intersections, but the calculation process is complex and the implementation difficulty is high.
The invention avoids directly calculating l1,l2,l3And l4The conventional method of intersection completes the calculation of the rectangular frame by translating and rotating the coordinate system and calculating the maximum and minimum coordinate values of BDSS in the transformed coordinate system. The translation isWill be provided withThe origin of (a) moves to the average center of the BDSS, and the rotation is counterclockwiseAnd ensuring that the included angle between the rotated positive x-axis half shaft and the original positive x-axis half shaft is theta, wherein a coordinate system obtained by the translation and the rotation is called a conversion coordinate system and is recorded as a conversion coordinate systemIn the context of figure 2(a),is represented by mutually perpendicular arrow lines, the arrow marked with x 'represents an x-axis positive half shaft, the arrow marked with y' represents a y-axis positive half shaft, and an arc-shaped arrow dotted line extends from the front end to the rear end of the motorPoint of origin is pointedOrigin pointShow thatIs translated toAndthe x-axis positive half axis of (a) is at an angle theta and the direction of rotation is indicated by the solid line of the arc arrow. BDSS pixel atThe coordinates in (1) are referred to as conversion coordinates. For theWhich converts coordinates thereofCalculating according to equation (3):
in thatIn (2), since the origin is located at the average center of the BDSS, four extreme values exist in the BDSS pixel conversion coordinate, namely, the maximum value x 'of the abscissa'lmaxAbscissa minimum value x'lminMaximum value y 'of ordinate'wmaxAnd ordinate minimum value y'wmin。In which there is a corresponding converted coordinate (x'lmax,0),(x′lmin,0),(0,y′wmax) And (0, y'wmin) The pixels of (a) are called boundary points, which are identified by solid dots and transformed coordinates in fig. 2 (a).
Passing the boundary point, [ theta ], l1And l2Parallel,. l3And l4Parallel and1and l3Vertical condition, for FIG. 2(a)In the case shown in (1), a rectangular frameIs given by formula (4):
wherein d ism=dist(p′(x′,y′),lm),m=1,2,3,4,dist(p′(x′,y′),lm) Represents from p'(x′,y′)Do and lmStraight vertical line, perpendicular line andmfrom point of intersection to p'(x′,y′)Euclidean distance of.
For FIG. 2(a)In the case of the situation shown in (a),actually consisting of four line segments, equation (4) can be replaced by equations (5) and (6):
formula (5) and formula (6) respectively give l1And l2Upper, l3And l4On the upper partThe transformed coordinates of the pixels. By passingThe transformed coordinates of the pixels may be calculated with their pixel offsets by which the values of the corresponding pixels in the digital image identifying the BDSS may be modified. The process of calculating the offset sequentially includes calculating a center coordinate from the transformed coordinates and calculating the offset from the center coordinate.
Calculating the center coordinates from the transformed coordinates, corresponding to the center coordinates obtained by transforming the center coordinates into the center coordinatesIs translated back to the originAnd rotate clockwiseMiddle x axis positive half axis toPositive x-axis half axis ofIs reduced toIn figure 2(b) of the accompanying drawings,indicated by mutually perpendicular arrow lines, the arrow marked x 'indicates the positive x-axis half, the arrow marked y' indicates the positive y-axis half,indicated by mutually perpendicular arrow lines, the arrow marked x indicating the positive x-axis half axis, fromOrigin pointPoint of directionThe dotted arc arrow at the origin represents the origin translation, fromX-axis positive semi-axis pointingThe solid line of the arc arrow for the positive x-axis half axis of (c) indicates counterclockwise rotation. The reduction process requiresThe transformed coordinates of the origin point asFor the Center coordinates thereofCalculated according to equation (7):
according toCenter coordinates of pixels, forThe shift amount d of the pixel is calculated by equation (8):
by passingOffset of pixels, i.e. modifiable in digital images used for BDSS recognitionThe value of the pixel, thereby accomplishing the purpose of identifying the ambiguous digital straight line segment BDSS.
In particular, the embodiment of the calculation method of the present invention is accomplished by writing a computer program.
The program input includes: BDSS, digital image for identifying BDSS and width thereofAnd heightWherein the pixels of the BDSS are represented in the data structure shown in figure 3 of the drawings. Fig. 3 illustrates a Point class whose attributes include development for storing offsets, an attribute XtoImageCenter for storing an attribute XtoImageCenter for center coordinate x and an attribute yoimegagnecenter for storing an attribute XtoImageCenter for center coordinate y, and an attribute yocollectioncenter for storing an attribute XtoCollectionCenter for converting coordinate x and an attribute yocollectioncenter for center coordinate y, respectively. The data type of the attribute development is an integer and is represented by integer, and the data types of other Point class attributes are double-precision floating Point numbers and are represented by double.
The program output is a set of pixels defined by equation (4) computed from the input BDSS.
The procedure comprises eight steps, see fig. 4 for an illustration of the figures. The eight steps will now be described in order.
Step 1: and calculating the center coordinates of the Point objects corresponding to the coordinate space in the coordinate-centered image space.
Mapping digital images to image spaceAccording toIndex value of middle pixel, inputAndthe offset of each Point object can be calculated and centered on the coordinatesFor a Point object with an offset d, its center coordinate is calculated according to equation (1), and the abscissa x and the ordinate y of the center coordinate are saved by attributes xtoimage center and ytoimage center, respectively.
Step 2: from the Point object coordinates in BDSS, the mean center is calculated and its direction θ is calculated using linear regression.
Calculating the average center of the BDSS according to the center coordinates of the Point objects in the BDSS calculated in the step 1Based on the linear regression theory, the direction θ of the BDSS is calculated according to equation (2). The specific process is shown in figure 6 of the attached drawing.
And step 3: and translating the origin of the coordinate space corresponding to the coordinate centralization to the average center, rotating the positive half axis of the x axis to coincide with theta, and calculating the conversion coordinate of the Point object in the BDSS.
The conversion coordinates of the Point object are calculated according to equation (3), and the abscissa x and the ordinate y of the conversion coordinates are saved as attributes XtoCollectionCenter and YtoCollectionCenter, respectively.
And 4, step 4: and calculating boundary points according to the conversion coordinates of the Point object in the BDSS.
And the BDSS coordinate extreme value is obtained by comparing the XtoCollectioncenter attribute value and the YtoCollectioncenter attribute value of all Point object conversion coordinates in the BDSS. According to the extreme values obtained by comparison, boundary points (x 'in the figure 2 similar to the description of the figure are generated'lmax,0),(x′lmax,0),(0,y′wmax) And (0, y'wmax) Point object of (2). These boundary points are the basis for completing the calculations of step 5 and step 6.
And 5: point objects parallel to the boundary line of the direction θ are generated and their transformed coordinates are calculated.
Generating the equation corresponding to l in FIG. 2 according to equation (5)1And l2See figure 6 for a detailed flow of Point objects. The coordinates of the boundary points are respectively represented by variable Xstart,Xend,YstartAnd YendAnd (5) storing. Boundary points (x ') in FIG. 2 illustrated by the drawing'lmax,0),(x′lmin,0),(0,y′wmax) And (0, y'wmin) For example, Xstart,Xend,YstartAnd YendAre each x'lmin,x′lmax,y′wminAnd y'wmaxI.e. the minimum and maximum values on the abscissa x and the minimum and maximum values on the ordinate y. In holding YstartAnd YendIs unchanged and XstarNot more than XendUnder the premise of (1), with XstartFor converting the initial value of the abscissa X of the coordinate and for each cycle XstartIn the mode of increasing 1, the circularly generated conversion coordinates are respectively (X)start,Ystart) And (X)end,Ystart) Two Point objects. And saving all Point objects generated by circulation in the rectangular frame.
Step 6: point objects of the boundary line perpendicular to the direction θ are generated, and the conversion coordinates thereof are calculated.
Generating the equation corresponding to l in FIG. 2 according to equation (6)3And l4See figure 7 for a detailed flow of Point objects. Reinitializing the variable X using the minimum of the abscissa X of the boundary pointstartIn maintaining XstartAnd XendIs unchanged and YstartNot more than YendUnder the premise of (1), with YstartFor converting the initial value of the abscissa Y of the coordinate and for cycling Y each timestartIn the mode of increasing 1, the circularly generated conversion coordinates are respectively (X)start,Ystart) And (X)start,Yend) Two Point objects. And saving all Point objects generated by circulation in the rectangular frame.
And 7: and calculating the center coordinates of the Point objects according to the conversion coordinates of the generated Point objects.
For all Point objects in the rectangular frame, the calculation of the center coordinates thereof is completed according to equation (7).
And 8: and calculating the offset of the Point object according to the center coordinate of the generated Point object, and saving the offset as a result to be output.
And (4) for all the Point objects in the rectangular frame, the calculation of the offset is completed according to the formula (8).
From the output results, the values of the pixels contained in the rectangular bounding box may be altered in the digital image identifying the BDSS using a pixel modification method to identify the blurred digital straight line segment BDSS.
The beneficial effects of the invention are described in two parts, the first part is the visual effect of the method of the invention; the second part is computational efficiency analysis:
1. visual effect:
fig. 8-10 show the results of identifying a given BDSS using the method of the present invention (the rectangular borders are represented by lines of 1 pixel wide black, white, and black superimposed in that order). In fig. 8 to 10, the resolution of the digital image is 128 × 128, 256 × 256, and 512 × 512 in this order. Note that the input BDSS will change after the image resolution is changed, and the output of the method of the present invention will change accordingly, not to amplify the same result. Fig. 8-10 are used to illustrate that as the resolution increases, the number of algorithm-contaminated background pixels decreases accordingly, the visual perception is that the bezel obscures less of the background, and the BDSS superimposed on each other are more easily resolved.
Comparing the results shown in fig. 8 to fig. 10 with the results shown in fig. 1, it is easy to find that the method of the present invention clearly identifies a given BDSS without greatly modifying the background pixels, and it can be assumed that if the algorithm shown in fig. 1(c) is used to identify an image with a lower resolution, for example, fig. 8, the BDSS identified by the method of the present invention is represented by a rectangle filled with a single color, so that the human eye cannot identify the background area of the BDSS. With the increase of the resolution of the identified digital image, the ratio of the number of the modified pixels to the total pixels of the image is rapidly reduced, the visual effect of the image is presented as a high resolution image, the BDSS background identified by the invention is easier to observe, such as fig. 10, and even if the image is a low resolution image, the occupation of the image background by the method is limited, such as fig. 8.
2. Calculating efficiency:
the bar graphs of fig. 11-13 illustrate the time consumed by the eight steps described in the embodiments, noting that the vertical axis of fig. 11-13 is in log numbers of CPU clock cycles. The horizontal axes of fig. 11 to 13 are first arranged from left to right in the order of images camera, lena, house and puzzle, and for each image, from left to right in the order of rates 128 × 128, 256 × 256 and 512 × 512, respectively. Taking fig. 11 as an example, the horizontal axis illustrates that the columns from left to right above the text "image camera" correspond to the time consumption rates of 128 × 128, 256 × 256, and 512 × 512, respectively. The areas with different colors in each upright post represent the consumed time of different steps, the larger the area is, the more the step is consumed, and the higher the upright post is, the more the total consumed time is. The blocks of the same column from bottom to top in fig. 11 to 13 sequentially represent the time consumed in each of steps 1 to 8 according to the embodiment. Fig. 11 shows the average elapsed time, i.e., the step-by-step and total elapsed time average for the identification of all given BDSSs in a digital image. Fig. 12 illustrates the maximum time consumption, i.e. the steps and total time consumption for a given BDSS identification with the most Point objects in a digital image. Fig. 13 shows the minimum time consumption, i.e. the steps and the total time consumption for a given BDSS identification with the fewest Point objects in a digital image. Fig. 11-13 show the time consumption distribution of different steps in different situations, and are used to illustrate that the algorithm core steps 5, 6, and 7 are less time consuming.
By observing fig. 11-13, step 8 occupies the most area of the plurality of pillars, i.e., the step is the most time consuming. This is due to the higher computational complexity of step 8 and the need to convert the rectangular bounding box to conform to the subsequent processing format. For each Point object, 4 multiplications and 6 additions are performed according to equation (7) step 7, while step 8 requiresComplete 1 multiplication, 2 division, 3 addition and 2 rounding operationsAlthough the number of operations in step 8 is somewhat small, it involves many more complex operations such as division and rounding. Steps 5 and 6 for computing the rectangular bounding box generally take less time than steps 3 and 4 in fig. 11 to 13, especially when the BDSS contains fewer Point objects, i.e. as shown in fig. 13. This reflects the simple implementation of the method of the present invention from efficiency, since steps 5 and 6 are the main steps for generating the rectangular frame, and since the implementation process does not involve complex operations or data structures, steps 5 and 6 are less time consuming than other steps, especially steps 7 and 8.
Fig. 14 is an analysis chart of the total time consumption, which is the sum of the time consumption for processing all BDSSs in one image, as the resolution of the image increases. Fig. 14 shows the total time consumption of the calculation method of the present invention at intervals of 32 × 32 from the resolution of 128 × 128 to 512 × 512, noting that the horizontal axis of fig. 14 shows only one dimension of the image. The time spent in the order of the above-mentioned resolution, i.e., 128, 160, 192 … …, the different resolution versions of images camera, lena, house and puzzle, is marked in fig. 14 with solid dots, and the dots for the same content but different resolution images are connected by straight line segments having the same line segment shape, and the detailed description of the line segment shape is shown in fig. 14. The four lines in fig. 14 are substantially linear, i.e. the time consumption is substantially proportional to the resolution, wherein typically the time consumption distribution of the image camera, and the time consumption distribution of the image lena and the image puzzle is small in difference from the ideal straight line when analyzed from the perspective of linear regression, although the fluctuation is large.
In fig. 14, the time-consuming distribution of the image house shows a tendency of falling down as the resolution increases, but since no other image shows such a tendency, the case of house is only an individual phenomenon. In summary, from the time consumption distribution in fig. 14, it is not found that the method of the present invention obviously shows a nonlinear rapid increase of time consumption with the increase of resolution, i.e., the time consumption and resolution of the method of the present invention basically increase linearly and steadily. This shows that the performance of the calculation method of the present invention is more efficient.
Claims (7)
1. A method for identifying straight line segments of a given blurred digital image,
when the fuzzy digital straight line segment BDSS recognition algorithm is completed, the width is widenedHeight ofIdentification of blurred digital straight line segments BDSS in digital imagesThe BDSS is stored as a recognition result in a pixel set mode;
calculating the geometric straight line characteristic of a given fuzzy digital straight line segment BDSS according to the recognition result, and identifying a given pixel set by using a rectangular frame with the slope meeting the geometric straight line characteristic;
the method specifically comprises the following steps:
step 1: calculating coordinate-centered image space, corresponding coordinate spaceThe center coordinates of (a);
step 2: calculating an average center according to the central coordinates of pixels in the fuzzy digital straight-line segment BDSS, and calculating the direction theta of the fuzzy digital straight-line segment BDSS by using linear regression;
and step 3: calculating the conversion coordinates of the pixels in the blurred digital straight line segment BDSS: centering coordinates into a corresponding coordinate spaceThe origin of (a) is translated to the average center, and the positive x-axis half shaft is rotated to coincide with theta;
and 4, step 4: calculating the conversion coordinate system of the fuzzy digital straight-line segment BDSS according to the conversion coordinates of the pixels in the fuzzy digital straight-line segment BDSSFour boundary points in (1);
and 5: generating a boundary line parallel to the direction thetaAndand calculating the transformed coordinates, boundary lines thereofAndrespectively passing through two boundary points in the step 4;
step 6: generating a boundary line perpendicular to the direction thetaAndand calculating the transformed coordinates, boundary lines thereofAndrespectively passing through the other two boundary points, straight lines, in step 4Andintersecting to form a rectangular frame;
and 7: calculating the center coordinates of the transformation coordinates generated in the steps 5 and 6;
and 8: and calculating the offset of the center coordinate generated in the step 7, and saving the offset as a result to be output.
2. The method for identifying a given blurred digital straight line segment in a digital image as recited in claim 1, wherein: in steps 1 and 2, the digital image of the identified blurred digital straight line segment BDSS is mapped intoCoordinate centeringFor arbitrary imagesThe element p belongs to BDSS, if the offset of p is d, the central coordinate is calculated according to the formula (1):
calculating the average center of BDSS according to the center coordinates of BDSS pixels
According to the linear regression theory, the direction θ ∈ [0, π) of BDSS is calculated by equation (2):
n, where i is 1, 2.. n, and n is the total number of pixels included in the BDSS.
3. The method for identifying a given blurred digital straight line segment in a digital image as recited in claim 2, wherein: in step 3, forWhich converts coordinates thereofCalculating according to equation (3):
<mrow> <mfenced open = "{" close = ""> <mtable> <mtr> <mtd> <mrow> <msup> <mi>x</mi> <mo>&prime;</mo> </msup> <mo>=</mo> <mrow> <mo>(</mo> <mi>x</mi> <mo>-</mo> <mover> <mi>x</mi> <mo>&OverBar;</mo> </mover> <mo>)</mo> </mrow> <mi>cos</mi> <mi>&theta;</mi> <mo>+</mo> <mrow> <mo>(</mo> <mi>y</mi> <mo>-</mo> <mover> <mi>y</mi> <mo>&OverBar;</mo> </mover> <mo>)</mo> </mrow> <mi>sin</mi> <mi>&theta;</mi> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <msup> <mi>y</mi> <mo>&prime;</mo> </msup> <mo>=</mo> <mo>-</mo> <mrow> <mo>(</mo> <mi>x</mi> <mo>-</mo> <mover> <mi>x</mi> <mo>&OverBar;</mo> </mover> <mo>)</mo> </mrow> <mi>sin</mi> <mi>&theta;</mi> <mo>+</mo> <mrow> <mo>(</mo> <mi>y</mi> <mo>-</mo> <mover> <mi>y</mi> <mo>&OverBar;</mo> </mover> <mo>)</mo> </mrow> <mi>cos</mi> <mi>&theta;</mi> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>3</mn> <mo>)</mo> </mrow> <mo>.</mo> </mrow>
4. a method for identifying a given blurred digital straight line segment in a digital image as defined in claim 3 wherein: in step 4, the coordinate system is convertedIs obtained by comparing all the abscissa x and ordinate y of the transformed coordinates.
5. The method for identifying a given blurred digital straight line segment in a digital image as recited in claim 4, wherein: coordinate spaceHas the origin of the transformation coordinates of
In step 7, forCenter coordinates thereofCalculated according to equation (7):
6. the method for identifying a given blurred digital straight line segment in a digital image as recited in claim 5, wherein: in step 8, forThe shift amount d of the pixel is calculated by equation (8):
in thatSince the origin is located at the average center of the BDSS, the BDSSThere are four extreme values of pixel conversion coordinates, namely, maximum value x 'of abscissa'lmaxAbscissa minimum value x'lminMaximum value y 'of ordinate'wmaxAnd ordinate minimum In which there is a corresponding converted coordinate (x'lmax,0),(x′lmax,0),(0,y′wmax) And (0, y'wmax) The pixels are the boundary points in the step 4;
wherein,representing rectangular bordersIs given by formula (4):
whereinRepresents from p'(x′,y′)Do and doPerpendicular straight line, perpendicular line andfrom point of intersection to p'(x′,y′)Euclidean distance of.
7. The method for identifying a given blurred digital straight line segment in a digital image as recited in claim 6, wherein: formula (A), (B) and5) and formula (6) are eachAndin the above-mentioned manner,andon the upper partTransformed coordinates of the pixel:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510137710.3A CN104751177B (en) | 2015-03-26 | 2015-03-26 | A kind of method for being used in reference numbers image give fuzzy digit straightway |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510137710.3A CN104751177B (en) | 2015-03-26 | 2015-03-26 | A kind of method for being used in reference numbers image give fuzzy digit straightway |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104751177A CN104751177A (en) | 2015-07-01 |
CN104751177B true CN104751177B (en) | 2018-01-12 |
Family
ID=53590830
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510137710.3A Active CN104751177B (en) | 2015-03-26 | 2015-03-26 | A kind of method for being used in reference numbers image give fuzzy digit straightway |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104751177B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105513044B (en) * | 2015-11-20 | 2018-07-17 | 常州大学 | A kind of digital direct straight line segments recognition method based on statistical measures linear feature |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4901365A (en) * | 1988-12-19 | 1990-02-13 | Ncr Corporation | Method of searching binary images to find search regions in which straight lines may be found |
CN102156884A (en) * | 2011-04-25 | 2011-08-17 | 中国科学院自动化研究所 | Straight segment detecting and extracting method |
CN102819743A (en) * | 2012-08-14 | 2012-12-12 | 常州大学 | Detection method for quickly identifying straight-line segments in digital image |
CN103150741A (en) * | 2012-11-30 | 2013-06-12 | 常州大学 | Method for rapidly skeletonizing graph of binary digital image |
-
2015
- 2015-03-26 CN CN201510137710.3A patent/CN104751177B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4901365A (en) * | 1988-12-19 | 1990-02-13 | Ncr Corporation | Method of searching binary images to find search regions in which straight lines may be found |
CN102156884A (en) * | 2011-04-25 | 2011-08-17 | 中国科学院自动化研究所 | Straight segment detecting and extracting method |
CN102819743A (en) * | 2012-08-14 | 2012-12-12 | 常州大学 | Detection method for quickly identifying straight-line segments in digital image |
CN103150741A (en) * | 2012-11-30 | 2013-06-12 | 常州大学 | Method for rapidly skeletonizing graph of binary digital image |
Non-Patent Citations (1)
Title |
---|
一种新的不规则直线段识别方法;李沛等;《光学技术》;20100315;第295-301页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104751177A (en) | 2015-07-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Klette et al. | Digital geometry: Geometric methods for digital picture analysis | |
CN102833460B (en) | Image processing method, image processing device and scanner | |
CN102236789B (en) | The method and device being corrected to tabular drawing picture | |
US9007373B2 (en) | Systems and methods for creating texture exemplars | |
CN103810729B (en) | A kind of based on isocontour raster image vector quantized method | |
Gustavson et al. | Anti-aliased Euclidean distance transform | |
CN112100795A (en) | Method and device for comparing computer aided design drawings | |
CN106062824A (en) | Edge detection device, edge detection method, and program | |
Shen et al. | A new approach to simplifying polygonal and linear features using superpixel segmentation | |
CN105447452A (en) | Remote sensing sub-pixel mapping method based on spatial distribution characteristics of features | |
CN111583398B (en) | Image display method, device, electronic equipment and computer readable storage medium | |
Müller Arisona et al. | Increasing detail of 3D models through combined photogrammetric and procedural modelling | |
CN105023288B (en) | Collimation error removing method of the two-dimensional vector solid line in three-dimensional scenic | |
CN104751177B (en) | A kind of method for being used in reference numbers image give fuzzy digit straightway | |
Ciomaga et al. | Level lines shortening yields an image curvature microscope | |
CN108898679A (en) | A kind of method of component serial number automatic marking | |
CN101764940A (en) | Subtitle rendering method based on pixel space mask matrix model | |
CN105741335A (en) | Fast drawing method of multi-level war-game map based on blocking structure | |
CN110458951A (en) | A kind of the modeling data acquisition methods and relevant apparatus of power grid shaft tower | |
Forsythe et al. | Convex constrained meshes for superpixel segmentations of images | |
CN115719414A (en) | Target detection and accurate positioning method based on arbitrary quadrilateral regression | |
CN102074004B (en) | Method and device for determining type of barrier of spatial entity | |
dos Passos et al. | Sample-based synthesis of illustrative patterns | |
Ren et al. | A new and fast contour-filling algorithm | |
Wefers et al. | SIVT–Processing, viewing, and analysis of 3D scans of the porthole slab and slab b2 of Züschen I |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230414 Address after: Room 306, Block C, Tianrun Technology Building, Changzhou Science and Education City, No. 18-3 Changwu Middle Road, Wujin District, Changzhou City, Jiangsu Province, 213000 Patentee after: Changzhou Jingxun Micro Information Technology Co.,Ltd. Address before: Gehu Lake Road Wujin District 213164 Jiangsu city of Changzhou province No. 1 Patentee before: CHANGZHOU University |