CN105761256B - The sub-pixel edge straight line acquisition methods and device of image - Google Patents

The sub-pixel edge straight line acquisition methods and device of image Download PDF

Info

Publication number
CN105761256B
CN105761256B CN201610082414.2A CN201610082414A CN105761256B CN 105761256 B CN105761256 B CN 105761256B CN 201610082414 A CN201610082414 A CN 201610082414A CN 105761256 B CN105761256 B CN 105761256B
Authority
CN
China
Prior art keywords
gray scale
pixel
intersecting lens
scale difference
difference value
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
CN201610082414.2A
Other languages
Chinese (zh)
Other versions
CN105761256A (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.)
Chengdu Kangye Technology Co Ltd
Original Assignee
Chengdu Kangye Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Kangye Technology Co Ltd filed Critical Chengdu Kangye Technology Co Ltd
Priority to CN201610082414.2A priority Critical patent/CN105761256B/en
Publication of CN105761256A publication Critical patent/CN105761256A/en
Application granted granted Critical
Publication of CN105761256B publication Critical patent/CN105761256B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Abstract

The embodiment of the invention provides the sub-pixel edge straight line acquisition methods and device of a kind of image, are applied to field of image processing.This method obtains the edge line of described image including the use of edge detection algorithm;Obtain a plurality of intersecting lens intersected with the edge line;Multiple pixels adjacent on every intersecting lens of a plurality of intersecting lens are obtained, the multiple pixel includes being located at each intersecting lens and the intersection point pixel of the point of intersection of the edge line and the multiple pixels that are located at the edge line two sides adjacent with the intersection point pixel;Obtain the maximum sub-pix point of gray-value variation between the multiple pixel of every intersecting lens;The sub-pix point of a plurality of intersecting lens is fitted, the sub-pixel edge straight line of described image is obtained.

Description

The sub-pixel edge straight line acquisition methods and device of image
Technical field
The present invention relates to field of image processings, in particular to a kind of sub-pixel edge straight line acquisition methods of image And device.
Background technique
Edge detection is the basic problem in image procossing and computer vision, and its essence is extracted by some algorithms The discontinuous edge pixel of gray scale in image.In certain image processing problems, the edge of image is straight line, detects corresponding side Edge straight line passes through also with existing edge detection algorithm, such as Sobel operator, Laplacian operator and Robert operator The variation of each pixel gray scale in some region of image is observed, form is simple, it is easy to accomplish, but positioning accuracy is poor, usually The only precision of integer pixel grade.But in the picture, the gray-value variation between the different color region of two gray values is not It is directly directly to change to the corresponding gray value of another color region from the corresponding gray value of a color region, but it is intermediate There is the process of a gradual change, so, the edge line for the integer pixel grade that existing edge detection algorithm obtains retouches edge Stating can not accurate enough, bigger error.
Summary of the invention
In view of this, the embodiment of the invention provides the sub-pixel edge straight line acquisition methods and device of a kind of image, On the basis of existing edge detection algorithm, according to the variation characteristic of image border gray value, image is further processed, is obtained Precision is less than the edge line of the sub-pixel of Pixel-level, not quasi- enough to the description at edge to improve edge line in the prior art Really, the problem of bigger error.
To achieve the goals above, The technical solution adopted by the invention is as follows:
A kind of sub-pixel edge straight line acquisition methods of image, which comprises obtain institute using edge detection algorithm State the edge line of image;Obtain a plurality of intersecting lens intersected with the edge line;Obtain every of a plurality of intersecting lens Adjacent multiple pixels on intersecting lens, the multiple pixel include being located at each intersecting lens and the edge line Point of intersection intersection point pixel and adjacent with the intersection point pixel be located at the multiple of the edge line two sides Pixel;Obtain the maximum sub-pix point of gray-value variation between the multiple pixel of every intersecting lens;It will be described The sub-pix point of a plurality of intersecting lens is fitted, and obtains the sub-pixel edge straight line of described image.
A kind of sub-pixel edge straight line acquisition device of image, described device includes: that edge line obtains module, for benefit The edge line of described image is obtained with edge detection algorithm;Intersecting lens obtains module, for obtaining and the edge line phase The a plurality of intersecting lens handed over;Pixel obtains module, adjacent multiple on every intersecting lens for obtaining a plurality of intersecting lens Pixel, the multiple pixel include the intersection point pixel positioned at the point of intersection of each intersecting lens and the edge line And the multiple pixels that are located at the edge line two sides adjacent with the intersection point pixel;Sub-pix point obtains mould Block, the maximum sub-pix point of gray-value variation between the multiple pixel for obtaining every intersecting lens;Sub-pix Edge line obtains module and obtains the sub-pix of described image for the sub-pix point of a plurality of intersecting lens to be fitted Edge line.
The sub-pixel edge straight line acquisition methods and device of image provided in an embodiment of the present invention are examined using traditional edge Method of determining and calculating obtains preliminary edge line, then obtains a plurality of intersecting lens intersected with edge line, according to edge line two sides The characteristic that the gray value of pixel successively changes, there are the maximum point of gray-value variation on intersecting lens, which may be non-integer Sub-pix point, obtain every intersecting lens on edge line two sides adjacent multiple pixels, every intersecting lens gray value Change maximum sub-pix point to be present between multiple pixel, by the sub-pix point of a plurality of intersecting lens be fitted to get It is accurate to the description at edge to sub-pixel edge straight line.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
The sub-pixel edge for the image that the present pre-ferred embodiments that Fig. 1 shows first embodiment of the invention offer provide The block diagram of straight line acquisition device;
Fig. 2 shows a kind of images of the sub-pixel edge straight line acquisition methods of the image of first embodiment of the invention offer Schematic diagram;
Fig. 3 shows the edge enlarged diagram of correspondence image in Fig. 2 of first embodiment of the invention offer;
Fig. 4 shows the flow chart of the sub-pixel edge straight line acquisition methods of the image of first embodiment of the invention offer;
Fig. 5 shows the edge line schematic diagram of the corresponding diagram 3 of first embodiment of the invention offer;
Fig. 6 shows the step 140 of the sub-pixel edge straight line acquisition methods of the image of first embodiment of the invention offer Flow chart;
Fig. 7 shows corresponding in the sub-pixel edge straight line acquisition methods of the image of first embodiment of the invention offer The serial number for multiple pixels that the C1 of Fig. 5 chooses and the table schematic diagram of corresponding gray value;
Fig. 8 is shown in the sub-pixel edge straight line acquisition methods of the image of first embodiment of the invention offer corresponding to figure 7 pixel-gray value corresponding relationship;
Fig. 9 is shown in the sub-pixel edge straight line acquisition methods of the image of first embodiment of the invention offer corresponding to figure 7 gray scale difference value table schematic diagram;
Figure 10 show first embodiment of the invention offer image sub-pixel edge straight line acquisition methods in correspond to The pixel of Fig. 9-gray scale difference value corresponding relationship;
Figure 11 shows a kind of Asia in the sub-pixel edge straight line acquisition methods of the image of first embodiment of the invention offer The position acquisition schematic diagram of pixel;
Figure 12 shows the structural frames of the sub-pixel edge straight line acquisition device of the image of first embodiment of the invention offer Figure;
Figure 13 shows the sub-pix of the sub-pixel edge straight line acquisition device of the image of first embodiment of the invention offer Point obtains the structural block diagram of module.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, is not intended to limit claimed invention to the detailed description of the embodiment of the present invention provided in the accompanying drawings below Range, but it is merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art are not doing Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile of the invention In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
As shown in Figure 1, being the block diagram for the server/computer that present pre-ferred embodiments provide.The service Device/computer includes the sub-pixel edge straight line acquisition device 200, memory 101, storage control of the image in image transmitting process Device 102 processed, processor 103, Peripheral Interface 104, input-output unit 105.
The memory 101, storage control 102, processor 103, Peripheral Interface 104, each element of input-output unit It is directly or indirectly electrically connected between each other, to realize the transmission or interaction of data.For example, these elements can lead between each other It crosses one or more communication bus or signal wire is realized and is electrically connected.Data processing equipment in described image transmission process includes At least one can be stored in the software function module in the memory 101 in the form of software or firmware (firmware).Institute It states processor 103 to be used to execute the executable module stored in memory 101, such as at the data in described image transmission process The software function module or computer program that reason device includes.
Wherein, memory 101 may be, but not limited to, random access memory 101 (Random Access Memory, RAM), read-only memory 101 (Read Only Memory, ROM), 101 (Programmable of programmable read only memory Read-Only Memory, PROM), (the Erasable Programmable Read-Only of erasable read-only memory 101 Memory, EPROM), (the Electric Erasable Programmable Read-Only of electricallyerasable ROM (EEROM) 101 Memory, EEPROM) etc..Wherein, memory 101 is for storing program, the processor 103 after receiving and executing instruction, Execute described program, side performed by the server/computer that the stream process that any embodiment of the embodiment of the present invention discloses defines Method can be applied in processor 103, or be realized by processor 103.
Processor 103 may be a kind of IC chip, the processing capacity with signal.Above-mentioned processor 103 can To be general processor 103, including central processing unit 103 (Central Processing Unit, abbreviation CPU), network processes Device 103 (Network Processor, abbreviation NP) etc.;It can also be digital signal processor 103 (DSP), specific integrated circuit (ASIC), ready-made programmable gate array (FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components.It may be implemented or execute disclosed each method, step and the logic diagram in the embodiment of the present invention.It is general Processor 103 can be microprocessor 103 or the processor 103 is also possible to any conventional processor 103 etc..
Various input/output devices are couple processor 103 and memory 101 by the Peripheral Interface 104.Some In embodiment, Peripheral Interface 104, processor 103 and storage control 102 can be realized in one single chip.Other one In a little examples, they can be realized by independent chip respectively.
Input-output unit 105 realizes user and the server (or local terminal) for being supplied to user input data Interaction.The input-output unit may be, but not limited to, mouse and keyboard etc..
The sub-pixel edge straight line acquisition methods of image provided in an embodiment of the present invention, mainly for gray level image.If needing The color image can be converted to grayscale image as color image by the image for carrying out edge detection to obtain sub-pixel edge straight line Picture, then sub-pixel edge acquisition is carried out to the gray level image obtained after conversion.
As shown in Fig. 2, when image is smaller, edge in image between the different region of bright darkness is in clearly demarcated straight of color Line, but when amplifying image, as shown in Figure 3, it can be seen that, the gray value between the different region of bright darkness is not great-jump-forward Variation, i.e., bright darkness does not change from light to dark not instead of directly between different regions, in the ash of the corresponding pixel of juncture area Angle value has the process of a gradual change.In the picture, the position of each pixel is expressed as integral point, and corresponding pixel precision is Integer pixel grade, but the edge line of actual image refers to Fig. 3 not necessarily by the center of pixel, if with integer grade Pixel precision indicate image edge line, i.e., describe edge line with integer, miss by a mile.
The embodiment of the present invention provides a kind of sub-pix of image according to the characteristic of color gray value gradual change at image border Edge line acquisition methods.The program is described in detail below in conjunction with specific embodiments.
First embodiment
Fig. 4 shows the flow chart of the sub-pixel edge straight line acquisition methods of the image of first embodiment of the invention offer, Referring to figure 4., this method comprises:
Step S110: the edge line of described image is obtained using edge detection algorithm;
Before the intersecting lens intersected in obtaining image with edge line, first image is pre-processed, is mainly utilized The edge line of edge detection algorithm acquisition image.
As shown in figure 5, L1 is the edge line of the image obtained using edge detection algorithm for image shown in Fig. 3, The edge line is the edge line that the pixel precision of integer grade indicates, which describes the general presence of image border Position, the gray value of the pixel of the two sides of the edge line is in roll-off characteristic, i.e., brighter to color from the darker side of color Region, gray value from color darker area it is corresponding it is the smallest value to the corresponding gray value of color brighter areas it is maximum value according to Secondary variation.
Also, in the present embodiment, the edge detection algorithm of use can be Cany boundary operator, be also possible to other sides Edge operator, such as Roberts, Sobel, Prewitt etc. are not intended as limiting in the present embodiment.
Step S120: a plurality of intersecting lens intersected with the edge line is obtained;
It crosses edge line and does a plurality of intersecting lens intersected with the edge line, due to every intersecting lens of a plurality of intersecting lens A part be located at the side of edge line, another part is located at the other side of edge line, so leaning on every intersecting lens The gray value of pixel of the part of proximal edge straight line from side to the other side is all in the process of a gradual change.
Also, it is further, in the present embodiment, a plurality of intersecting lens can be made to be parallel to each other, then a plurality of intersecting lens The gray scale progressive formation of upper pixel is consistent.
Further, in the present embodiment, acquired intersecting lens can be with the orthogonal straight line of edge line, As shown in figure 5, in Fig. 5, what C1, C2 and Cn were indicated is and the orthogonal intersecting lens of edge line L1.When intersecting lens and side Edge straight line is vertical, then the variation of gray value is more evenly in gray value gradation zone on intersecting lens.
Certainly, in the present embodiment, the quantity of intersecting lens is not intended as limiting, and at least two, or be greater than two Item it is a plurality of.
Step S130: multiple pixels adjacent on every intersecting lens of a plurality of intersecting lens, the multiple picture are obtained Vegetarian refreshments include the point of intersection positioned at each intersecting lens and the edge line intersection point pixel and with the intersection point picture The adjacent multiple pixels for being located at the edge line two sides of vegetarian refreshments;
Every intersecting lens of a plurality of intersecting lens is all corresponding there are a pixel with edge line intersection, which is For intersection point pixel.For every intersecting lens, obtains and be located at intersection point picture on its intersection point pixel and corresponding intersecting lens Multiple adjacent pixels of vegetarian refreshments two sides obtain the multiple adjacent pictures for being located at edge line side that is, on corresponding intersecting lens Vegetarian refreshments, and obtain the multiple neighbor pixels for being located at the edge line other side.Meanwhile in the present embodiment, it is located at intersection point The pixel near intersection point pixel of pixel two sides is adjacent with intersection point pixel, that is, what is obtained includes intersection point pixel And multiple pixels of intersection point pixel two sides are pixel adjacent to each other.
Further, in the present embodiment, it obtains on every intersecting lens and is located at the edge line side at least Two neighbor pixels obtain at least two neighbor pixels for being located at the edge line other side on the intersecting lens.
Step S140: the maximum sub-pix of gray-value variation between the multiple pixel of every intersecting lens is obtained Point;
In the present embodiment, sub-pix point is i.e. with point, i.e. picture represented by expression method more higher than pixel accuracy Vegetarian refreshments is integer grade, and sub-pix point is small several levels.Generally, if a pixel is divided into more parts, wherein each Part is a sub-pix point.In the present embodiment, the specific levels of precision of sub-pix point is set according to actual conditions.I.e. by a picture The number that vegetarian refreshments is divided into is not intended as limiting.
The maximum sub-pix point of the gray-value variation i.e. previous sub-pix point of the sub-pix point arrives between multiple pixels Gray-value variation between the sub-pix point is maximum in gray-value variation between all adjacent sub-pix points.
Further, as shown in fig. 6, this step includes:
Step S141: between the every two adjacent pixel for calculating the multiple pixel of every intersecting lens The difference of gray value obtains multiple gray scale difference values;
Step S142: the first gray scale difference value and second in the multiple gray scale difference value of every intersecting lens is obtained Gray scale difference value, first gray scale difference value and second gray scale difference value are the multiple gray scale difference value of every intersecting lens Middle maximum two gray scale difference values of difference;
In multiple gray scale difference values, maximum two gray scale difference values of gray scale difference value, i.e. two gray scale difference values are certainly existed Greater than other all gray scale difference values.
Step S143: the corresponding pixel-gray scale difference value corresponding relationship of the intersecting lens of acquisition every;
In the present embodiment, multiple pixel editor serial numbers to be obtained on every intersecting lens.Pixel-gray scale difference value pair Answering relational graph can be with pixel serial number abscissa, and gray scale difference value is the coordinate relational graph of ordinate.
For example, giving 11 pixels from darker as shown in fig. 7, intersecting lens C1 chooses 11 pixels in corresponding diagram 5 First pixel of side starts number consecutively, also, the number of corresponding each pixel obtains the gray value of the pixel, Shown in Figure 7, the corresponding serial number of each pixel of serial number, f (x) is the corresponding gray scale of pixel of corresponding serial number Value.
Meanwhile as shown in figure 8, gray value is that ordinate establishes coordinate system, in the coordinate with pixel serial number abscissa Each pixel is indicated to get pixel-gray value is arrived with the serial number of each pixel and the corresponding gray value of the serial number in system Corresponding relationship.Fig. 8 is referred to, as can be seen that gray value is in the process of a gradual change within a certain area from the coordinate system.
Corresponding C1 calculates the difference of the gray value between the every two adjacent pixel of multiple pixels, as shown in figure 9, f ' (x) indicate to be the gray scale difference value between each two pixels, such as ash between first pixel and second pixel point Spending difference is 0, and gray scale difference value between second pixel point and third pixel is 1 etc., also, by each gray scale difference value and The serial number for obtaining the biggish pixel of gray value in two pixels of the gray scale difference value is corresponding, refers to Fig. 9, due to The successively gradual change from side to the other side of the gray value of the pixel of selection, then each gray scale difference value uniquely corresponds to a pixel Serial number.
For intersecting lens C1, the pixel-gray scale difference value corresponding relationship for corresponding to above-mentioned 11 pixels is then such as to scheme Shown in 10.
Fig. 9 and Figure 10 is referred to, for intersecting lens C1, in 11 pixels of above-mentioned selection, the pixel of serial number 6 Point and the corresponding pixel value difference of pixel of serial number 7 are maximum two gray scale difference values.
Step S144: first described in the corresponding pixel-gray scale difference value corresponding relationship of the intersecting lens of acquisition every The first of the adjacent gray scale difference value formation in addition to second gray scale difference value of gray scale difference value and first gray scale difference value Straight line, the second gray scale difference value and institute described in the corresponding pixel-gray scale difference value corresponding relationship of the intersecting lens of acquisition every State the second straight line that the adjacent gray scale difference value in addition to first gray scale difference value of the second gray scale difference value is formed;
In embodiments of the present invention, due to the spy of the color gradient between two adjacent bright dark different color regions Property, in pixel-gray scale difference value corresponding relationship, maximum two gray scale difference values of acquisition are adjacent, i.e. the first gray scale difference value Adjacent with the second gray scale difference value, corresponding, in the picture, the corresponding pixel of the first gray scale difference value is corresponding with the second gray scale difference value Pixel it is adjacent.
Another for doing the first gray scale difference value and the first gray scale difference value in pixel-gray scale difference value corresponding relationship is adjacent The straight line that is formed of gray scale difference value, be first straight line, which shows another adjacent ash of the first pixel value difference Difference is spent to gray scale difference value variation tendency between the first gray scale difference value.Similarly, second straight line shows the second gray scale difference value to Gray scale difference value variation tendency between another adjacent gray scale difference value of two gray scale difference values.
Step S145: the first straight line of every intersecting lens and the intersection point of the second straight line are obtained;
Step S146: corresponding sub-pix point in the corresponding intersecting lens is obtained according to the intersection point.
Further, this step further include:
According to the corresponding pixel-gray scale difference value corresponding relationship of intersecting lens described in every, the intersection point pair is determined Positional relationship of the sub-pix point pixel corresponding with the adjacent gray scale difference value of the intersection point answered on corresponding intersecting lens;
According to the positional relationship, determine that the intersection point corresponding location point on corresponding intersecting lens is the sub-pix Point.
The intersection point of first straight line and second straight line is done in pixel-gray scale difference value corresponding relationship, then the intersection point is located at Between first gray scale difference value and the second gray scale difference value, then, the corresponding abscissa of the intersection point is the corresponding picture of the first gray scale difference value Between the serial number of vegetarian refreshments serial number pixel corresponding with the second gray scale difference value, due to the corresponding pixel of the first gray scale difference value and The corresponding pixel of two gray scale difference values is adjacent, then the abscissa of intersection point is not integer, is decimal.Then, in the picture, intersection point pair The position answered should be then sub-pix point, also, the specific decimal digits of the abscissa of intersection point can be by the sub-pix point that needs Specific value precision determine, be not intended as limiting in embodiments of the present invention.
In pixel-gray scale difference value corresponding relationship, the corresponding sub-pix point of available intersection point is with respect to the first gray scale Offset between the corresponding pixel of difference.In the present embodiment, using the center of each pixel as the pixel The corresponding position of integer serial number, with the center of a pixel to the center of the adjacent next pixel of the pixel The distance between position is as a unit.Then the position of the corresponding sub-pix point of intersection point should be in the corresponding picture of the first gray scale difference value On the center of vegetarian refreshments to the line of the center of the corresponding pixel of the second gray scale difference value, specifically, intersection point is corresponding The position of sub-pix point is the center of the corresponding pixel of the first gray scale difference value to the corresponding pixel of the second gray scale difference value Center direction add the obtained position of offset.As shown in figure 11, if the abscissa of intersection point is 5.2, the first gray scale The serial number 5 of the corresponding pixel of difference, the serial number 6 of the corresponding pixel of the second gray scale difference value, the corresponding sub-pix of intersection point The position of point is then the center of the pixel of the corresponding serial number 5 of the first gray scale difference value to the corresponding sequence of the second gray scale difference value Number for 6 pixel Centre position deviation 0.2 to get arrive the intersection point corresponding sub-pix point position, as in figure 5.2 The center of the pixel of serial number 5 corresponding position into the line segment 56 of the center formation of the pixel of serial number 6. The sub-pix point is the maximum point of gray-value variation, which is located on sub-pixel edge straight line.Figure 11 is to adjacent The schematic diagram of the pixel of the pixel and serial number 6 of serial number 5, is not offered as the specific color of pixel, and it is possible to manage Solution, the black box outside each pixel is the expression to the edge of pixel, to distinguish the pixel and sequence of serial number 5 Number be 6 pixel.
Certainly, in pixel-gray scale difference value corresponding relationship, also the corresponding sub-pix point of available intersection point is with respect to The corresponding sub-pix point of the offset or intersection point of the corresponding pixel of two gray scale difference values picture corresponding with respect to other gray scale difference values The offset of vegetarian refreshments.
For example, in the present embodiment, as shown in Figure 10, for intersecting lens C1, first straight line is the l1 in figure, second straight line It is the intersection point of first straight line l1 and second straight line l2 for the l2 in figure, D1, intersection point D1 is corresponding between serial number 6 and serial number 7 In image, the sub-pix point in intersecting lens C1 is then in the center of the pixel of serial number 6 and the pixel of serial number 7 Between heart position.Available by calculating, the abscissa of intersection point isThe specific value of intersection point is determined according to the actual situation It is fixed.Such as, if intersection point value is 6.2, show that the sub-pix point precision is 0.1, if intersection point value is 6.28, show the Asia picture Vegetarian refreshments precision is 0.01.The specific location of the corresponding sub-pix point of intersection point is obtained according to intersection point abscissa.
Step S150: the sub-pix point of a plurality of intersecting lens is fitted, the sub-pixel edge of described image is obtained Straight line.
Specifically, since the gray value of the pixel on every intersecting lens from side to the other side is all in the mistake of a gradual change Journey certainly exists a sub-pix point in sub-pixel edge straight line on intersecting lens, finds being somebody's turn to do at least two intersecting lenses Sub-pix point, then can be fitted sub-pixel edge straight line.
Then, since sub-pix point is on sub-pixel edge straight line, and since one can be fitted directly according to multiple points The sub-pix point of obtained a plurality of intersecting lens is fitted, sub-pixel edge straight line can be obtained by line.As shown in figure 5, L2 is The sub-pixel edge straight line of fitting, L2 are with the sub-pix point that the point that C1, C2 and Cn intersect is on corresponding intersecting lens, point A There are the sub-pix points on intersecting lens C1.
Present embodiments provide a kind of sub-pixel edge straight line acquisition device 200 of image, as shown in figure 12, the device packet It includes:
Edge line obtains module 210, for obtaining the edge line of described image using edge detection algorithm;
Intersecting lens obtains module 220, for obtaining a plurality of intersecting lens intersected with the edge line;
Pixel obtains module 230, adjacent multiple pixels on every intersecting lens for obtaining a plurality of intersecting lens Point, the multiple pixel include the point of intersection positioned at each intersecting lens and the edge line intersection point pixel and The multiple pixels that are located at the edge line two sides adjacent with the intersection point pixel;
Sub-pix point obtains module 240, gray value between the multiple pixel for obtaining every intersecting lens Change maximum sub-pix point;
Sub-pixel edge straight line obtains module 250, for the sub-pix point of a plurality of intersecting lens to be fitted, obtains The sub-pixel edge straight line of described image.
Further, as shown in figure 13, in the present embodiment, the sub-pix point acquisition module 240 includes:
First gray scale difference value acquiring unit 241, every two of the multiple pixel for calculating every intersecting lens The difference of gray value between a adjacent pixel, obtains multiple gray scale difference values;
Second gray scale difference value acquiring unit 242, in the multiple gray scale difference value for obtaining every intersecting lens First gray scale difference value and the second gray scale difference value, first gray scale difference value and second gray scale difference value are every intersection Maximum two gray scale difference values of difference in the multiple gray scale difference value of line;
Relational graph acquiring unit 243, for obtaining the corresponding pixel-gray scale difference value corresponding relationship of every intersecting lens Figure;
Straight line acquiring unit 244, for obtaining the corresponding pixel-gray scale difference value corresponding relationship of every intersecting lens Described in the first gray scale difference value and first gray scale difference value the adjacent gray scale difference value in addition to second gray scale difference value The first straight line of formation,
Straight line acquiring unit 244 is also used to obtain the corresponding pixel-gray scale difference value corresponding relationship of every intersecting lens The adjacent gray scale difference in addition to first gray scale difference value of second gray scale difference value described in figure and second gray scale difference value It is worth the second straight line formed;
Intersection point acquiring unit 245, for obtaining the first straight line and the second straight line of every intersecting lens Intersection point;
Sub-pix point acquiring unit 246, for obtaining corresponding sub- picture in the corresponding intersecting lens according to the intersection point Vegetarian refreshments.
Further, referring to Figure 13, in the present embodiment, sub-pix point acquiring unit 246 includes:
Positional relationship obtains subelement 247, for according to the corresponding pixel-gray scale difference value of intersecting lens described in every Corresponding relationship determines the corresponding sub-pix point of intersection point pixel corresponding with the adjacent gray scale difference value of the intersection point right The positional relationship on intersecting lens answered;
Sub-pix point obtains subelement 248, for determining the intersection point in corresponding intersecting lens according to the positional relationship Upper corresponding location point is the sub-pix point.
Also, in the present embodiment, it is a plurality of vertical with the edge line for obtaining to obtain module 220 for the intersecting lens Straight line as intersecting lens.
In conclusion the sub-pixel edge straight line acquisition methods and device of image provided in an embodiment of the present invention, utilize biography The edge detection algorithm of system obtains preliminary edge line, then obtains a plurality of intersecting lens intersected with edge line, according to edge The characteristic that the gray value of the pixel of straight line two sides successively changes, there are the maximum point of gray-value variation on intersecting lens, which can It can be the sub-pix point of non-integer, obtain adjacent multiple pixels on every intersecting lens in edge line two sides, every phase The maximum sub-pix point of intersection gray-value variation is present between multiple pixel, and the sub-pix point of a plurality of intersecting lens is carried out It is fitted to get sub-pixel edge straight line is arrived, it is accurate to the description at edge.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through Other modes are realized.The apparatus embodiments described above are merely exemplary, for example, flow chart and block diagram in attached drawing Show the device of multiple embodiments according to the present invention, the architectural framework in the cards of method and computer program product, Function and operation.In this regard, each box in flowchart or block diagram can represent the one of a module, section or code Part, a part of the module, section or code, which includes that one or more is for implementing the specified logical function, to be held Row instruction.It should also be noted that function marked in the box can also be to be different from some implementations as replacement The sequence marked in attached drawing occurs.For example, two continuous boxes can actually be basically executed in parallel, they are sometimes It can execute in the opposite order, this depends on the function involved.It is also noted that every in block diagram and or flow chart The combination of box in a box and block diagram and or flow chart can use the dedicated base for executing defined function or movement It realizes, or can realize using a combination of dedicated hardware and computer instructions in the system of hardware.
In addition, each functional module in each embodiment of the present invention can integrate one independent portion of formation together Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory 301 (ROM, Read-Only Memory), deposits at random Various Jie that can store program code such as access to memory 301 (RAM, Random Access Memory), magnetic or disk Matter.It should be noted that, in this document, relational terms such as first and second and the like be used merely to an entity or Operation is distinguished with another entity or operation, and without necessarily requiring or implying between these entities or operation, there are any This actual relationship or sequence.Moreover, the terms "include", "comprise" or its any other variant be intended to it is non-exclusive Property include so that include a series of elements process, method, article or equipment not only include those elements, but also Further include other elements that are not explicitly listed, or further include for this process, method, article or equipment it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described There is also other identical elements in the process, method, article or equipment of element.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should also be noted that similar label and letter exist Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing It is further defined and explained.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. a kind of sub-pixel edge straight line acquisition methods of image, which is characterized in that the described method includes:
The edge line of described image is obtained using edge detection algorithm;
Obtain a plurality of intersecting lens intersected with the edge line;
Multiple pixels adjacent on every intersecting lens of a plurality of intersecting lens are obtained, the multiple pixel includes being located at often A intersecting lens and the intersection point pixel of the point of intersection of the edge line and the difference adjacent with the intersection point pixel Multiple pixels positioned at the edge line two sides;
Obtain the maximum sub-pix point of gray-value variation between the multiple pixel of every intersecting lens;
The sub-pix point of a plurality of intersecting lens is fitted, the sub-pixel edge straight line of described image is obtained.
2. the method according to claim 1, wherein the multiple pixel for obtaining every intersecting lens The maximum sub-pix point of gray-value variation between point, comprising:
The difference for calculating the gray value between the every two adjacent pixel of the multiple pixel of every intersecting lens, is obtained Obtain multiple gray scale difference values;
The first gray scale difference value and the second gray scale difference value in the multiple gray scale difference value of every intersecting lens are obtained, it is described First gray scale difference value and difference in the multiple gray scale difference value that second gray scale difference value is every intersecting lens are maximum Two gray scale difference values;
Obtain the corresponding pixel-gray scale difference value corresponding relationship of every intersecting lens;
Obtain the first gray scale difference value described in the corresponding pixel-gray scale difference value corresponding relationship of every intersecting lens with it is described The first straight line that the adjacent gray scale difference value in addition to second gray scale difference value of first gray scale difference value is formed, obtains every institute State the second gray scale difference value described in the corresponding pixel of intersecting lens-gray scale difference value corresponding relationship and second gray scale difference value The second straight line that adjacent gray scale difference value in addition to first gray scale difference value is formed;
Obtain the first straight line of every intersecting lens and the intersection point of the second straight line;
Corresponding sub-pix point in the corresponding intersecting lens is obtained according to the intersection point.
3. according to the method described in claim 2, it is characterized in that, described obtain the corresponding intersecting lens according to the intersection point In corresponding sub-pix point the step of include:
According to the corresponding pixel-gray scale difference value corresponding relationship of intersecting lens described in every, determine that the intersection point is corresponding Positional relationship of the sub-pix point pixel corresponding with the adjacent gray scale difference value of the intersection point on corresponding intersecting lens;
According to the positional relationship, determine that the intersection point corresponding location point on corresponding intersecting lens is the sub-pix point.
4. the method according to claim 1, wherein on every intersecting lens for obtaining a plurality of intersecting lens The step of adjacent multiple pixels includes:
At least two neighbor pixels for being located at the edge line side on every intersecting lens are obtained, the intersection is obtained It is located at least two neighbor pixels of the edge line other side on line.
5. the method according to claim 1, wherein described obtain a plurality of intersection intersected with the edge line Line includes:
The a plurality of straight line being parallel to each other intersected with the edge line is obtained as intersecting lens.
6. according to the method described in claim 4, it is characterized in that, described obtain a plurality of intersection intersected with the edge line Line includes:
The a plurality of straight line vertical with the edge line is obtained as intersecting lens.
7. a kind of sub-pixel edge straight line acquisition device of image, which is characterized in that described device includes:
Edge line obtains module, for obtaining the edge line of described image using edge detection algorithm;
Intersecting lens obtains module, for obtaining a plurality of intersecting lens intersected with the edge line;
Pixel obtains module, and adjacent multiple pixels, described on every intersecting lens for obtaining a plurality of intersecting lens Multiple pixels include positioned at each intersecting lens and the point of intersection of the edge line intersection point pixel and with it is described The adjacent multiple pixels for being located at the edge line two sides of intersection point pixel;
Sub-pix point obtains module, and gray-value variation is maximum between the multiple pixel for obtaining every intersecting lens Sub-pix point;
Sub-pixel edge straight line obtains module and obtains the figure for the sub-pix point of a plurality of intersecting lens to be fitted The sub-pixel edge straight line of picture.
8. device according to claim 7, which is characterized in that the sub-pix point obtains module and includes:
First gray scale difference value acquiring unit, for calculate every intersecting lens the multiple pixel it is every two adjacent The difference of gray value between pixel obtains multiple gray scale difference values;
Second gray scale difference value acquiring unit, the first gray scale in the multiple gray scale difference value for obtaining every intersecting lens Difference and the second gray scale difference value, first gray scale difference value are the described of every intersecting lens with second gray scale difference value Maximum two gray scale difference values of difference in multiple gray scale difference values;
Relational graph acquiring unit, for obtaining the corresponding pixel-gray scale difference value corresponding relationship of every intersecting lens;
Straight line acquiring unit, for obtaining described in the corresponding pixel-gray scale difference value corresponding relationship of every intersecting lens What the adjacent gray scale difference value in addition to second gray scale difference value of the first gray scale difference value and first gray scale difference value was formed First straight line,
The straight line acquiring unit is also used to obtain the corresponding pixel-gray scale difference value corresponding relationship of every intersecting lens Described in the second gray scale difference value and second gray scale difference value the adjacent gray scale difference value in addition to first gray scale difference value The second straight line of formation;
Intersection point acquiring unit, for obtaining the first straight line of every intersecting lens and the intersection point of the second straight line;
Sub-pix point acquiring unit, for obtaining corresponding sub-pix point in the corresponding intersecting lens according to the intersection point.
9. device according to claim 8, which is characterized in that the sub-pix point acquiring unit includes:
Positional relationship obtains subelement, for closing according to the corresponding pixel of intersecting lens described in every-gray scale difference value is corresponding System's figure, determines the corresponding sub-pix point of intersection point pixel corresponding with the adjacent gray scale difference value of the intersection point in corresponding phase Positional relationship on intersection;
Sub-pix point obtains subelement, for determining that the intersection point is corresponding on corresponding intersecting lens according to the positional relationship Location point be the sub-pix point.
10. device according to claim 7, which is characterized in that the intersecting lens obtains module for obtaining a plurality of and institute The vertical straight line of edge line is stated as intersecting lens.
CN201610082414.2A 2016-02-05 2016-02-05 The sub-pixel edge straight line acquisition methods and device of image Active CN105761256B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610082414.2A CN105761256B (en) 2016-02-05 2016-02-05 The sub-pixel edge straight line acquisition methods and device of image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610082414.2A CN105761256B (en) 2016-02-05 2016-02-05 The sub-pixel edge straight line acquisition methods and device of image

Publications (2)

Publication Number Publication Date
CN105761256A CN105761256A (en) 2016-07-13
CN105761256B true CN105761256B (en) 2019-02-26

Family

ID=56330735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610082414.2A Active CN105761256B (en) 2016-02-05 2016-02-05 The sub-pixel edge straight line acquisition methods and device of image

Country Status (1)

Country Link
CN (1) CN105761256B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107424128B (en) * 2017-06-20 2020-12-29 南京泰立瑞信息科技有限公司 Method and system for extracting clear image frame from recorded eye fundus video
CN109215068B (en) * 2017-07-06 2021-05-28 深圳华大智造科技股份有限公司 Image magnification measuring method and device
CN109934820B (en) * 2019-03-22 2020-10-09 大连大学 Method for detecting linear edge sub-pixels in laser tailor-welded workpiece image
CN109934819B (en) * 2019-03-22 2021-02-05 大连大学 Method for detecting curve edge sub-pixel in laser tailor-welded workpiece image
CN111192324B (en) * 2019-12-26 2023-05-09 广东星舆科技有限公司 Line segment intersection point position determining method and device and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101635050A (en) * 2009-06-26 2010-01-27 武汉大学 Image restoration method
CN103136758A (en) * 2013-03-25 2013-06-05 长春工业大学 Rapid edge detecting method based on orthogonal polynomial fitting
CN104331896A (en) * 2014-11-21 2015-02-04 天津工业大学 System calibration method based on depth information
CN104359403A (en) * 2014-11-21 2015-02-18 天津工业大学 Plane part size measurement method based on sub-pixel edge algorithm
CN104715487A (en) * 2015-04-01 2015-06-17 大连理工大学 Method for sub-pixel edge detection based on pseudo Zernike moments

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101635050A (en) * 2009-06-26 2010-01-27 武汉大学 Image restoration method
CN103136758A (en) * 2013-03-25 2013-06-05 长春工业大学 Rapid edge detecting method based on orthogonal polynomial fitting
CN104331896A (en) * 2014-11-21 2015-02-04 天津工业大学 System calibration method based on depth information
CN104359403A (en) * 2014-11-21 2015-02-18 天津工业大学 Plane part size measurement method based on sub-pixel edge algorithm
CN104715487A (en) * 2015-04-01 2015-06-17 大连理工大学 Method for sub-pixel edge detection based on pseudo Zernike moments

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种新的快速通用二维图像亚像素边缘检测算法;林欣堂 等;《应用科技》;20100831;第37卷(第8期);第35-39页
通用亚像素边缘检测算法;盛遵冰 等;《上海交通大学学报》;20070630;第41卷(第6期);第911-915页

Also Published As

Publication number Publication date
CN105761256A (en) 2016-07-13

Similar Documents

Publication Publication Date Title
CN105761256B (en) The sub-pixel edge straight line acquisition methods and device of image
US11120254B2 (en) Methods and apparatuses for determining hand three-dimensional data
EP3309703B1 (en) Method and system for decoding qr code based on weighted average grey method
CN107424160B (en) System and method for finding image central line by visual system
CN109844809B (en) Image processing method and device and computer readable storage medium
WO2020252920A1 (en) Picture correction method and apparatus, computer device and computer-readable storage medium
CN106934806B (en) It is a kind of based on text structure without with reference to figure fuzzy region dividing method out of focus
CN109005368B (en) High dynamic range image generation method, mobile terminal and storage medium
CN103714327A (en) Method and system for correcting image direction
US10942567B2 (en) Gaze point compensation method and apparatus in display device, and display device
KR102153962B1 (en) System and method for finding lines in an image with a vision system
CN109214996B (en) Image processing method and device
CN109348731A (en) A kind of method and device of images match
CN110009615B (en) Image corner detection method and detection device
WO2019061659A1 (en) Method and device for removing eyeglasses from facial image, and storage medium
CN112991374A (en) Canny algorithm-based edge enhancement method, device, equipment and storage medium
JP2014164528A (en) Character recognition device, character recognition method, and program
Devadethan et al. Face detection and facial feature extraction based on a fusion of knowledge based method and morphological image processing
CN111800579B (en) Lens focusing method and system and related equipment
CN104881663A (en) Method and device for discriminating selected result of check box
Lim et al. A census transform-based robust stereo matching under radiometric changes
CN109359632A (en) Highway sideline detection method and device
CN116579968A (en) Identification method and device for food material image, steaming and baking equipment and storage medium
Yang et al. A novel binarization approach for license plate
CN112508925A (en) Electronic lock panel quality detection method, system, computer device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Zheng Bo

Inventor after: Du Houqi

Inventor after: Wei Zhengjie

Inventor before: Zheng Bo

Inventor before: Wang Maofan

Inventor before: Du Houqi

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant