CN103593860B - A kind of cut-out method for the most irregular blank - Google Patents

A kind of cut-out method for the most irregular blank Download PDF

Info

Publication number
CN103593860B
CN103593860B CN201310521155.5A CN201310521155A CN103593860B CN 103593860 B CN103593860 B CN 103593860B CN 201310521155 A CN201310521155 A CN 201310521155A CN 103593860 B CN103593860 B CN 103593860B
Authority
CN
China
Prior art keywords
blank
coordinate
rectangle
formula
profile
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.)
Expired - Fee Related
Application number
CN201310521155.5A
Other languages
Chinese (zh)
Other versions
CN103593860A (en
Inventor
袁哲
赵民
秦自放
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenyang Jianzhu University
Original Assignee
Shenyang Jianzhu University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenyang Jianzhu University filed Critical Shenyang Jianzhu University
Priority to CN201310521155.5A priority Critical patent/CN103593860B/en
Publication of CN103593860A publication Critical patent/CN103593860A/en
Application granted granted Critical
Publication of CN103593860B publication Critical patent/CN103593860B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

A kind of cut-out method for the most irregular blank, relates to a kind of blank manufacture field.Step is: gather the data treating tailored blank;Genetic algorithm is utilized to determine the rectangular profile of blank, as the border that blank is cut out;This is cut out scheme input control system, the blank to be processed of step 1 is cut out, it is thus achieved that meet blank flat needed for the stock layout of technique.The present invention is directed to irregular blank shape and find maximum area rectangle therein, can obtain in irregular blank available or can the part of stock layout rapidly and accurately, just as an interface, both being combined closely, the rectangle obtained can directly utilize nesting and carry out stock layout.The substantial amounts of artificial stock layout time saved, improve the utilization rate of productivity ratio and material, saved cost of labor and material cost for factory, created economic benefit.

Description

A kind of cut-out method for the most irregular blank
Technical field
The present invention relates to a kind of blank manufacture field, particularly to a kind of cut-out method for the most irregular blank.
Background technology
The problem of cutting out on arbitrarily irregular blank border be widely present in boats and ships, furniture, clothing, machine-building, large stone material plate, And the industry such as light industry.Currently mainly using artificial repeated measurement to be cut out after testing for cutting out of irregular obstacle body, this is right The technical merit of workman requires the highest, depends on the experience of workman, and efficiency is the lowest, and the workman that level is different can obtain Different blank utilization rate, causes the waste of material.For this problem present invention, a kind of cutting for irregular blank border is proposed Sanction method, obtains the most available maximum area rectangle.
Summary of the invention
The deficiency existed for prior art, the present invention proposes a kind of cut-out method for the most irregular blank, to reach joint The substantial amounts of artificial stock layout time about, improve the utilization rate of productivity ratio and material, saved cost of labor for factory and become with material This, create economic benefit
The technical scheme is that and be achieved in that: a kind of cut-out method for the most irregular blank, comprise the following steps:
Step 1: gather the data treating tailored blank, including:
Step 1-1: shoot blank to be processed, shoots two width images;
First width is the blank drawing picture that band is had powerful connections;
Second width is the background image identical with the first width background;
Step 1-2: deduct the second width image with the first sub-picture, remove background, obtain blank drawing picture;
Step 1-3: the blank drawing picture utilizing Sobel operator to obtain step 1-2 carries out rim detection, determines blank profile Border;
Step 1-4: the edge image obtaining step 1-3 progressively scans, in units of pixel, with image lower-left angle point As initial point, setting up coordinate system, the pixel coordinate matrix [u, v] obtaining edge image is:
[ u , v ] = x 1 y 1 x 2 y 2 . . . . . . x n y n - - - ( 1 )
In formula, u, v are pixel coordinate value in camera coordinates system, and n is the pixel quantity of profile;x1, x2..., xnRepresent profile The abscissa of point;y1, y2..., ynRepresent the vertical coordinate of profile point;
Step 1-5: the profile matrix under blank pixel coordinate is converted into the profile matrix under world coordinates, comprises the following steps that;
Step 1-5-1: the scaling method provided by industrial camera supplier obtains the internal reference f of video camerax、fy、cx、cyWith Outer ginseng R, T, wherein: R is the spin matrix of a 3*3, T is the translation matrix of a 3*1;
Step 1-5-2: calculating transition matrix A, the computing formula of A is as follows:
A = f x 0 c x 0 0 f y c y 0 0 0 1 0 R T 0 1 - - - ( 2 )
Step 1-5-3: the blank profile obtained by step 1-3 is the profile under camera coordinates, its actual profile with its at image In corresponding point between relation be to be determined by the geometric model of video camera, between pixel coordinate value and real world coordinates value Functional relationship meet equation below:
X w Y w Z w 1 = A - 1 * Z w * u v 1 - - - ( 3 )
In formula, ZWFor conversion coefficient, XW、YW、ZWIt it is the coordinate in world coordinate system;
Pixel coordinate profile step 1-4 obtained brings formula (3) into, thus calculates the world coordinates of blank profile;
Step 1-6: the profile matrix coordinate points utilizing step 1-5 to obtain determines 4 boundary extremum points of blank profile, i.e. X The maximum X of coordinate axesmax, minima X of X-coordinate axlemin, the maximum Y of Y coordinate axlemaxAnd minima Y of Y coordinate axlemin
Four coordinate points utilizing the circumscribed rectangle that aforementioned four extreme value is combined into blank profile are respectively as follows:
RP1(Xmin, Ymin), RP2(Xmax, Ymin), RP3(Xmax, Ymax) and RP4(Xmax, Ymin)
Aforementioned four coordinate points line i.e. obtains the circumscribed rectangle being parallel to coordinate axes of blank profile;
Step 2: utilize genetic algorithm to determine the rectangular profile of blank, as the border that blank is cut out, comprise the following steps:
Step 2-1: in circumscribed rectangular extent determined by step 1-6, stochastic generation m little rectangle as initial population, Specific as follows:
Step 2-1-1: take two coordinate points P the most at random1(x1, y1) and P2(x2, y2) so that coordinate points meets such as simultaneously Lower three conditions:
Condition 1: coordinate points P randomly selected1Abscissa x1、P2Abscissa x2Can not exceed circumscribed rectangle abscissa border:
Xmin<x1, x2<Xmax
Condition 2: coordinate points P randomly selected1Vertical coordinate y1、P2Vertical coordinate y2Can not exceed circumscribed rectangle vertical coordinate border:
Ymin<y1, y2<Ymax,
Condition 3: preventing exceed blank profile border too much at other 2 of little rectangle, length of side L being formed little rectangle should meet:
L<max{Ymax-Ymin, Xmax-Xmin}
According to coordinate points P1And P2Coordinate figure and length of side L, be calculated the coordinate figure P thirdly of little rectangle3(x3, y3), Formula is:
( y 3 - y 1 ) &times; ( y 2 - y 1 ) + ( x 3 - x 1 ) &times; ( x 2 - x 1 ) = 0 ( y 3 - y 1 ) 2 + ( x 3 - x 1 ) 2 - L 2 = 0 - - - ( 4 )
In formula, x3Represent P3Abscissa, y3Represent P3Vertical coordinate;
Solved by formula (4) and obtain two coordinate figures and meet equation, randomly choose wherein as little rectangle coordinate thirdly Value;
Then according to P1、P2、P3Calculate little rectangle the 4th point coordinates P4(x4, y4), formula is:
x 4 = x 1 + x 3 - x 2 y 4 = y 1 + y 3 - y 2 - - - ( 5 )
In formula, x4Represent P4Abscissa, y4Represent P4Vertical coordinate;
Step 2-1-2: coordinate and the step 1-5 blank profile coordinate to four points of the little rectangle obtained by step 2-1-1, Use ray method to differentiate the relation of these four points of randomly generating and blank profile, confirm four points of little rectangle and little rectangle Within four edges is entirely located in the border of blank profile, if not within blank profile border, utilizing step 2-1-1 again to give birth to Become another little rectangle;
Cheng Shengyi, four summits chromogene CH of the little rectangle that recycling is formed, the coding rule of chromogene CH For: by four coordinate points according to { x1y1x2y2x3y3x4y4} order arranges;
Step 2-1-3: utilizing step 2-1-1 and m little rectangle of step 2-1-2 generation as initial population N, N is a m*8 Matrix, and have N >=100;
The coding rule of population N is:
Every a line of N represents a chromogene CH, and the columns of N represents scale m of population;
Step 2-2: the initial population produced step 2-1 on the basis of meeting rectangle constraint and area maximum is evaluated, The degree the least expression chromogene retrained owing to the area of little rectangle is the biggest, violate rectangle is the most outstanding, the face of arbitrary quadrilateral Long-pending formula is:
S=0.5×|x1×y2-x2×y1+x2×y3-x3×y2+x3×y4-x4×y3+x4×y1-x1×y4| (6)
In formula, S represents the area of tetragon;
What little rectangle should meet is constrained to:
Parallel Constraint: any opposite side of rectangle should be parallel, and formula is as follows:
( y 4 - y 1 ) &times; ( x 3 - x 2 ) - ( y 3 - y 2 ) &times; ( x 4 - x 1 ) = 0 ( y 2 - y 1 ) &times; ( x 4 - x 3 ) - ( y 4 - y 3 ) &times; ( x 2 - x 1 ) = 0 - - - ( 7 )
Vertical constraint: rectangle arbitrary neighborhood both sides angle is 90 degree, and formula is as follows:
(y2-y1)×(y4-y1)-(x2-x1)×(x1-x4)=0 (8)
Arbitrary quadrilateral is violated the degree of rectangle constraint and is defined as penalty term, and formula is:
penatly1=|(y4-y1)×(x3-x2)-(y3-y2)×(x4-x1)|
penatly2=|(y2-y1)×(x4-x3)-(y4-y3)×(x2-x1) | (9)
penatly3=|(y2-y1)×(y4-y1)-(x2-x1)×(x1-x4)|
In formula: penatly1 represents first penalty term, penatly2 represents second penalty term, and penatly3 represents that the 3rd is punished Penalize item;
In area formula, add penalty term obtain the fitness function of population and be:
Fitness=S-100 × (penatly1+penatly2+penatly3)/max{penatly1, penatly2, penatly3} (10)
In formula: fitness represents fitness function;
Bring the initial population that step 2-1 produces into fitness function formula (10) and chromogene is carried out fitness evaluation, and It is ranked up according to the size of fitness value;
Step 2-3: set up selection opertor, uses the mode of roulette to select adaptive value high in the colony that step 2-2 obtains Chromogene, as the population of next step cross-reference, is embodied as:
The mode using roulette selects to produce a new generation population: the selected desired amt of each chromogene and its adaptive value The ratio of shared colony adaptive value summation, as select probability, generates a new generation population;
For the colony N (Ch that given scale is m1, CH2..., CHm), individual fitness is fitness (Chi), it selects Probability is:
P ( CH i ) = fitness ( CH i ) &Sigma; j = 1 n fitness ( CH j ) , j = 1,2 , . . . , m - - - ( 11 )
In formula: P (Chi) represent the selected probability of this chromogene;Fitness (Chi) represents the adaptive value of this chromosome;
I.e. calculate the ratio that each individual fitness is shared in colony's adaptive value summation, represent this chromosome in the selection process Selected probability;Then the random number rand between [0,1] is generated, if met:
∑[P(CH1)+P(CH2)+.......+P(CHi-1)]≤rand≤∑[P(CH1)+P(CH2)+.......+P(CHi)]
Then select i-th chromosome CHi;Selected population N is obtained after repetitive operation m timech, footmark ch represents the meaning of English selection;
Step 2-4;The selected population N that step 2-3 is obtainedchCarry out intersecting and operate, use single-point to intersect, by adjacent dyeing Body gene C hiAnd Chi+1Intersect, randomly generate the random number P between [0,1]cIf, Pc< 0.3 in interval [1,7] In randomly generate a crossover location, by chromogene ChiAnd Chi+1Genetic fragment after being positioned at crossover location swaps, If Pc>=0.3 chromogene does not do and intersects, the selected population N so obtained step 2-4chCarry out the friendship of gene two-by-two Fork obtains cross-species Ncr, footmark cr represents the meaning of English intersection;
Step 2-5: the population obtaining step 2-4 carries out mutation operation, arbitrarily produces the random number P between [0,1]m, as Really Pm< 0.7 randomly generates a variable position in interval [1,8], the number of variable position becomes step 1-6 and produces Circumscribed rectangle in a random number;If Pm>=0.7 chromogene does not carry out mutation operation, so to step 2-4 The cross-species N obtainedcrEach genome walking obtain make a variation population Nva, footmark ch represents the meaning of English variation;
Step 2-6: the population N that step 2-3,2-4 and 2-5 are obtainedch、Ncr、NvaForm a gene pool Ngp, to gene 3 × m chromogene in pond utilizes ray method to carry out little rectangular dots, minor matrix four edges differentiates with the relation of blank profile, Chromogene for being positioned at outside blank profile makes fitness function value be zero, to the chromogene in blank profile according to step Rapid 2-2 is evaluated and sorts;
Step 2-7: before chromosome step 2-6 obtained selects, m is individual as follow-on initial population, and will come first The chromosome of position, as elite gene, is not made any change and is directly entered follow-on gene pool NgpIn guarantee the most excellent of every generation Gene will not be destroyed;
Step 2-8: repeated execution of steps 2-3 step 2-7, until cycle-index reaches default iterations It, stops seeking Excellent, It >=100;
Step 2-9: the chromogene that gene pool step 2-8 obtained makes number one as optimal base because of output, it is thus achieved that Optimum blank cutting scheme;
Step 3: this is cut out scheme input control system, is cut out the blank to be processed of step 1, it is thus achieved that meet work Blank flat needed for the stock layout of skill.
Beneficial effects of the present invention: most nesting is all based on what rectangular plate just can be carried out, and the blank shape of reality Shape is all irregular, needs manually to participate in, and the present invention is directed to irregular blank shape and finds largest face product moment therein Shape, can obtain rapidly and accurately in irregular blank available or can the part of stock layout, just as an interface, will both be tight Close combination, the rectangle obtained can directly utilize nesting and carry out stock layout.The substantial amounts of artificial stock layout time saved, improve life Productivity and the utilization rate of material, saved cost of labor and material cost for factory, created economic benefit.
Accompanying drawing explanation
Fig. 1 is the embodiment of the present invention cut-out method flow chart for the most irregular blank;
Fig. 2 is that the stone material blank drawing of embodiment of the present invention band background is as schematic diagram;
Fig. 3 is embodiment of the present invention background blank schematic diagram;
Fig. 4 is that the bright embodiment of this law blank drawing that background is black after treatment is as schematic diagram;
Fig. 5 is this law bright embodiment blank edge image schematic diagram after rim detection;
Fig. 6 is this law bright embodiment blank profile circumscribed rectangle schematic diagram;
Fig. 7 is that the imperial palace of this law bright embodiment blank irregular figure connects rectangle schematic diagram.
Detailed description of the invention
Below in conjunction with the accompanying drawings embodiments of the present invention are described in further detail.
The cut-out method for the most irregular blank that present embodiment uses, its flow process is as it is shown in figure 1, comprise the following steps:
Step 1: gather blank data, including:
Step 1-1: shoot blank to be processed, shoots two width images;Use Microvision MV-500UC colour industrial digital Video camera obtains large stone material plate image and background image, as shown in Figures 2 and 3.
Step 1-2: with Fig. 2 image subtraction Fig. 3, remove background, obtain blank drawing picture as shown in Figure 4.
Step 1-3: the blank drawing picture utilizing Sobel operator to obtain step 1-2 carries out rim detection, Sobel operator is a kind of The edge detection algorithm of first order differential operator, utilize pixel up and down, the gray scale difference of left and right adjoint point, reach extremum extracting in edge Edge, removes part pseudo-edge, and it has certain smoothing effect to noise.The blank drawing picture obtaining step 1-2 directly should Use this operator, the blank edge image obtained.The blank edge image obtained is as shown in Figure 5.
Step 1-4: progressively scan Fig. 5, in units of pixel, using image lower-left angle point as initial point, with the length of image As x-axis, using the width of image as y-axis, the pixel coordinate obtaining edge image it is:
[ u , v ] = 1103 801 1104 800 . . . . . . 1103 801
Step 1-5: the profile matrix under blank pixel coordinate is converted into the profile matrix under world coordinates, and concrete mode is as follows;
Step 1-5-1: the calibration software provided by industrial camera supplier obtains the internal reference f of video camerax=2368.91440、 fy=2368.39288、cx=1448.11856、cy=881.75401 and outer parameter R and T, wherein, the formula of outer parameter R is:
R = 0.430810 0.902408 0.007913 0.902292 - 0.430882 0.014464 0.016462 0.000909 - 0.999864
The formula of outer parameter T is:
T = - 203.653609 32.256832 1938.387387 .
Step 1-5-2: calculating transition matrix A, formula is as follows:
A = f x 0 c x 0 0 f y c y 0 0 0 1 0 R T 0 1 = 1044.39094 2139.043645 - 1429.176396 2324576.784612 2151.49738 - 1019.696346 - 847.377656 1785577.70266 0.016462 0.000909 - 0.999864 1938.387387
Step 1-5-3: bringing the pixel coordinate array of step 1-4 into formula (3) and obtain the world coordinates of profile, formula is as follows:
[ X w , Y w ] = 0.6 317.4 1.4 318.2 . . . . . . 0.6 317.4
Step 1-6: utilize step 1-5 to utilize the profile matrix coordinate points obtained to seek the maximum X of X-coordinate axlemax=239.8 Hes Minima Xmin=0.6 and the maximum Y of Y coordinate axlemax=341.4 and minima Ymin=139.8, utilize X-axis and Y-axis These four extreme values can be combined into four coordinate points RP of rectangle1(0.6,139.8), RP2(239.8,139.8), RP3(239.8,341.4) And RP4(0.6,341.4), four coordinate points lines can obtain blank profile parallel in the circumscribed rectangle of coordinate axes, blank profile Circumscribed rectangle as shown in Figure 6.
Step 2: utilize genetic algorithm to determine the rectangular profile cutting out blank, comprise the following steps:
Step 2-1: in circumscribed rectangular extent determined by step 1-6, stochastic generation m=100 little rectangle is planted as initial Group, including:
Step 2-1-1: take two coordinate points P the most at random1(x1, y1) and P2(x2, y2) coordinate points is met the most about Bundle:
Constraint 1:Xmin< x1,x2<Xmax
Constraint 2:Ymin< y1,y2<Ymax
Constraint 3: each little rectangle length of side L so that length of side L < max{Ymax-Ymin, Xmax-Xmin}
Purpose is to prevent exceed blank profile border too much at other 2 of rectangle, calculates according to this coordinate figure of 2 and the length of side Obtain the coordinate figure P thirdly of rectangle3(x3, y3), formula is:
( y 3 - y 1 ) &times; ( y 2 - y 1 ) + ( x 3 - x 1 ) &times; ( x 2 - x 1 ) = 0 ( y 3 - y 1 ) 2 + ( x 3 - x 1 ) 2 - L 2 = 0 - - - ( 4 )
Can be solved by formula (4) and obtain two coordinate figures and meet equation, randomly choose wherein as rectangle thirdly Coordinate figure.Then according to P1、P2、P3Calculate rectangle the 4th point coordinates P4(x4, y4), formula is:
x 4 = x 1 + x 3 - x 2 y 4 = y 1 + y 3 - y 2 - - - ( 5 )
Step 2-1-2: coordinate and the data of step 1-5 blank profile to four summits of the rectangle obtained by step 2-1-1 Point, uses ray method to differentiate four summits of the rectangle randomly generated and the relation of blank profile, confirms four summits of little rectangle And within whether the four edges of little rectangle is entirely located in the border of blank profile, if not within blank profile border, utilized Step 2-1-1 regenerates another little rectangle and substitutes original little rectangle.
Four points utilizing little rectangle become a raw chromogene CH, and the coding rule of chromogene CH is: by four seats Punctuate is according to { x1y1x2y2x3y3x4y4} order arranges.
Step 2-1-3: utilizing step 2-1-1 and step 2-1-2 100 rectangles of generation as initial population N, N is one 100 The matrix of × 8, such as:
If population N is:
185 281 22 312 3.3165 213.7609 166.3165 192.7609 194 165 171 293 46.9862 270.7162 69.9862 142.7263 . . . . . . . . . . . . . . . . . . . . . . . . 95 291 107 229 107.9818 229.1900 95.9818 291.1900
Wherein, every a line represents four coordinates of a rectangle, is exactly by P for the first rectangle1(185,281), P2(22,312), P3(3.3165,213.7609) and P4(166.3165,192.7609) four some compositions;This matrix N has 100 row, with regard to table It is shown with 100 rectangle compositions.
Step 2-2: the initial population produced step 2-1 on the basis of meeting rectangle constraint and area maximum is evaluated.By The degree the least expression chromogene that area in little rectangle is the biggest, violate rectangle retrains is the most outstanding, the area of arbitrary quadrilateral Formula is:
S=0.5×|x1×y2-x2×y1+x2×y3-x3×y2+x3×y4-x4×y3+x4×y1-x1×y4| (6)
What rectangle should meet is constrained to:
Parallel Constraint: any opposite side of rectangle should be parallel, and formula is as follows:
( y 4 - y 1 ) &times; ( x 3 - x 2 ) - ( y 3 - y 2 ) &times; ( x 4 - x 1 ) = 0 ( y 2 - y 1 ) &times; ( x 4 - x 3 ) - ( y 4 - y 3 ) &times; ( x 2 - x 1 ) = 0 - - - ( 7 )
Vertical constraint: rectangle arbitrary neighborhood both sides angle is 90 degree, and formula is as follows:
(y2-y1)×(y4-y1)-(x2-x1)×(x1-x4)=0 (8)
Arbitrary quadrilateral is violated the degree of rectangle constraint and is defined as penalty term, and formula is:
penatly1=|(y4-y1)×(x3-x2)-(y3-y2)×(x4-x1)|
penatly2=|(y2-y1)×(x4-x3)-(y4-y3)×(x2-x1)| (9)
penatly3=|(y2-y1)×(y4-y1)-(x2-x1)×(x1-x4)|
In area formula, add penalty term obtain the fitness function of population and be:
Fitness=S-100 × (penatly1+penatly2+penatly3)/max{penatly1, penatly2, penatly3} (10)
Bring the initial population that step 2-1 produces into fitness function formula (10) and chromogene is carried out fitness evaluation, and It is ranked up according to the size of fitness value.
Step 2-3: set up selection opertor, sets up selection opertor, uses the mode of roulette to select in the colony that step 2-2 obtains Select the high chromogene of adaptive value as next step cross-reference, be embodied as:
The mode using roulette selects to produce a new generation population, the selected expectation of each chromogene in the new colony of generation Shared by quantity and its adaptive value, the ratio of colony's adaptive value summation is relevant.For the colony N (Ch that given scale is 1001, CH2..., CHm), individual fitness is fitness (Chi), its select probability is:
P ( CH i ) = fitness ( CH i ) &Sigma; j = 1 n fitness ( CH j ) , j = 1,2 , . . . , m - - - ( 11 )
In formula, P (Chi) represent the selected probability of this chromogene;fitness(Chi) represent the adaptive value of this chromosome;
I.e. calculate the ratio that each individual fitness is shared in colony's adaptive value summation, represent this chromosome in the selection process Selected probability;Then the random number rand between [0,1] is generated, if met:
∑[P(CH1)+P(CH2)+.......+P(CHi-1)]<rand<∑[P(CH1)+P(CH2)+.......+P(CHi)]
Then select i-th chromosome CHi;Selected population N is obtained after repetitive operation m timech
Step 2-4: the selected population N that step 2-3 is obtainedchCarry out intersecting and operate, use single-point to intersect, by adjacent dyeing Body gene C hiAnd Chi+1Intersect, randomly generate the random number P between [0,1]cIf, Pc< 0.3 in interval [1,7] In randomly generate a crossover location, by chromogene ChiAnd Chi+1Genetic fragment after being positioned at crossover location swaps, If Pc>=0.3 chromogene does not do and intersects, the selected population N so obtained step 2-4chCarry out the friendship of gene two-by-two Fork obtains cross-species Ncr
Step 2-5: the population obtaining step 2-4 carries out mutation operation, arbitrarily produces the random number P between [0,1]m, as Really Pm< 0.7 randomly generates a variable position in interval [1,8], and the number of variable position becomes what step 1-6 produced A random number in circumscribed rectangle;If Pm>=0.7 chromogene does not carry out mutation operation, so obtains step 2-4 The cross-species N arrivedcrEach genome walking obtain make a variation population Nva
Step 2-6: the population N that step 2-3,2-4 and 2-5 are obtainedch、Ncr、NvaForm a gene pool Ngp, to gene 300 chromogenes in pond utilize the relation of four edges that ray method carries out little rectangular dots and little rectangle and blank profile to sentence Not, the chromosome for being positioned at outside blank profile makes fitness function value be zero, to the chromogene in blank profile according to step Rapid 2-2 is evaluated and sorts.
Step 2-7: chromosome that step 2-6 is obtained select front 100 as follow-on initial population, and first will be come The chromosome of position, as elite gene, is not made any change and is directly entered follow-on gene pool NgpIn guarantee the optimum of every generation Well-founded is because being destroyed.
Step 2-8: repeated execution of steps 2-3 step 2-7, until cycle-index reaches default iterations 300, stops seeking Excellent.
Step 2-9: the chromogene that gene pool step 2-8 obtained makes number one is not advised as optimal base because of output blank Then the imperial palace of figure connects rectangle as shown in Figure 7, it is thus achieved that optimum blank cutting scheme.
Step 3: this is cut out scheme input control system, is cut out the blank to be processed of step 1, it is thus achieved that meet work Blank flat needed for the stock layout of skill.
Utilize formula (12) to calculate the area of blank profile and imperial palace connects the area of rectangle, and the ratio calculating them is worth to blank The utilization rate of profile, step 2-9 the data obtained and step 1-5 blank outline data are brought into and are obtained the utilization rate of blank and be 94.10%.Thus the effectiveness of embodiment of the present invention is described.
S = 0.5 &times; &Sigma; k = 1 m ( x k y k + 1 - x k + 1 y k ) - - - ( 12 )
Wherein: S represents area, xk, ykRepresent abscissa and the vertical coordinate of polygon vertex respectively, k=1,2 ..., m, is m Polygonal summit, polygonal according to counterclockwise arranging.
Although the foregoing describing the detailed description of the invention of the present invention, but the those skilled in the art in this area should be appreciated that this It is merely illustrative of, these embodiments can be made various changes or modifications, without departing from principle and the essence of the present invention. The scope of the present invention is only limited by the claims that follow.

Claims (1)

1. the cut-out method for the most irregular blank, it is characterised in that: comprise the following steps:
Step 1: gather the data treating tailored blank, including:
Step 1-1: shoot blank to be processed, shoots two width images;
First width is the blank drawing picture that band is had powerful connections;
Second width is the background image identical with the first width background;
Step 1-2: deduct the second width image with the first sub-picture, remove background, obtain blank drawing picture;
Step 1-3: the blank drawing picture utilizing Sobel operator to obtain step 1-2 carries out rim detection, determines blank profile Border;
Step 1-4: the edge image obtaining step 1-3 progressively scans, in units of pixel, with image lower-left angle point As initial point, setting up coordinate system, the pixel coordinate matrix [u, v] obtaining edge image is:
&lsqb; u , v &rsqb; = x 1 y 1 x 2 y 2 . . . . . . x n y n - - - ( 1 )
In formula, u, v are pixel coordinate value in camera coordinates system, and n is the pixel quantity of profile;x1,x2,……,xnRepresent profile The abscissa of point;y1,y2,……,ynRepresent the vertical coordinate of profile point;
Step 1-5: the pixel coordinate matrix conversion of blank edge image is become the profile matrix under world coordinates, and concrete steps are such as Under;
Step 1-5-1: the scaling method provided by industrial camera supplier obtains the internal reference f of video camerax、fy、cx、cyWith Outer ginseng R, T, wherein: R is the spin matrix of a 3*3, T is the translation matrix of a 3*1;
Step 1-5-2: calculating transition matrix A, the computing formula of A is as follows:
A = f x 0 c x 0 0 f y c y 0 0 0 1 0 R T 0 1 - - - ( 2 )
Step 1-5-3: the blank profile obtained by step 1-3 is the profile under camera coordinates, its actual profile with its at image In corresponding point between relation be to be determined by the geometric model of video camera, between pixel coordinate value and real world coordinates value Functional relationship meet equation below:
X w Y w Z w 1 = A - 1 * Z w * u v 1 - - - ( 3 )
In formula, ZWFor conversion coefficient, XW、YW、ZWIt it is the coordinate in world coordinate system;
The pixel coordinate matrix of edge image step 1-4 obtained brings formula (3) into, thus the world calculating blank profile sits Mark;
Step 1-6: the profile matrix coordinate points utilizing step 1-5 to obtain determines 4 boundary extremum points of blank profile, i.e. X The maximum X of coordinate axesmax, minima X of X-coordinate axlemin, the maximum Y of Y coordinate axlemaxAnd minima Y of Y coordinate axlemin
Four coordinate points utilizing the circumscribed rectangle that aforementioned four extreme value is combined into blank profile are respectively as follows:
RP1(Xmin, Ymin), RP2(Xmax, Ymin), RP3(Xmax, Ymax) and RP4(Xmax, Ymin)
Aforementioned four coordinate points line i.e. obtains the circumscribed rectangle being parallel to coordinate axes of blank profile;
Step 2: utilize genetic algorithm to determine the rectangular profile of blank, as the border that blank is cut out, comprise the following steps:
Step 2-1: in circumscribed rectangular extent determined by step 1-6, stochastic generation m little rectangle as initial population, Specific as follows:
Step 2-1-1: take two coordinate points P the most at random1(x1, y1) and P2(x2, y2) so that coordinate points meets such as simultaneously Lower three conditions:
Condition 1: coordinate points P randomly selected1Abscissa x1、P2Abscissa x2Can not exceed circumscribed rectangle abscissa border:
Xmin<x1,x2<Xmax
Condition 2: coordinate points P randomly selected1Vertical coordinate y1、P2Vertical coordinate y2Can not exceed circumscribed rectangle vertical coordinate border:
Ymin<y1,y2<Ymax,
Condition 3: preventing exceed blank profile border too much at other 2 of little rectangle, length of side L being formed little rectangle should meet:
L<max{Ymax-Ymin, Xmax-Xmin}
According to coordinate points P1And P2Coordinate figure and length of side L, be calculated the coordinate figure P thirdly of little rectangle3(x3, y3), Formula is:
( y 3 - y 1 ) &times; ( y 2 - y 1 ) + ( x 3 - x 1 ) &times; ( x 2 - x 1 ) = 0 ( y 3 - y 1 ) 2 + ( x 3 - x 1 ) 2 - L 2 = 0 - - - ( 4 )
In formula, x3Represent P3Abscissa, y3Represent P3Vertical coordinate;
Solved by formula (4) and obtain two coordinate figures and meet equation, randomly choose wherein as little rectangle coordinate thirdly Value;
Then according to P1、P2、P3Calculate little rectangle the 4th point coordinates P4(x4, y4), formula is:
x 4 = x 1 + x 3 - x 2 y 4 = y 1 + y 3 - y 2 - - - ( 5 )
In formula, x4Represent P4Abscissa, y4Represent P4Vertical coordinate;
Step 2-1-2: under the coordinate of four points of the little rectangle obtained by step 2-1-1 and step 1-5 world coordinates Blank profile coordinate, uses ray method to differentiate the relation of these four points and the blank profile randomly generated, confirms four of little rectangle Within the four edges of point and little rectangle is entirely located in the border of blank profile, if not within blank profile border, utilize step Rapid 2-1-1 regenerates another little rectangle;
Four summits of the little rectangle that recycling is formed generate a chromogene CH, the coding rule of chromogene CH For: by four coordinate points according to { x1y1x2y2x3y3x4y4} order arranges;
Step 2-1-3: utilizing step 2-1-1 and m little rectangle of step 2-1-2 generation as initial population N, N is a m*8 Matrix, and have N >=100;
The coding rule of population N is:
Every a line of N represents a chromogene CH, and the columns of N represents scale m of population;
Step 2-2: the initial population produced step 2-1 on the basis of meeting rectangle constraint and area maximum is evaluated, The degree the least expression chromogene retrained owing to the area of little rectangle is the biggest, violate rectangle is the most outstanding, the face of arbitrary quadrilateral Long-pending formula is:
S=0.5 × | x1×y2-x2×y1+x2×y3-x3×y2+x3×y4-x4×y3+x4×y1-x1×y4| (6)
In formula, S represents the area of tetragon;
What little rectangle should meet is constrained to:
Parallel Constraint: any opposite side of rectangle should be parallel, and formula is as follows:
( y 4 - y 1 ) &times; ( x 3 - x 2 ) - ( y 3 - y 2 ) &times; ( x 4 - x 1 ) = 0 ( y 2 - y 1 ) &times; ( x 4 - x 3 ) - ( y 4 - y 3 ) &times; ( x 2 - x 1 ) = 0 - - - ( 7 )
Vertical constraint: rectangle arbitrary neighborhood both sides angle is 90 degree, and formula is as follows:
(y2-y1)×(y4-y1)-(x2-x1)×(x1-x4)=0 (8)
Arbitrary quadrilateral is violated the degree of rectangle constraint and is defined as penalty term, and formula is:
p e n a t l y 1 = | ( y 4 - y 1 ) &times; ( x 3 - x 2 ) - ( y 3 - y 2 ) &times; ( x 4 - x 1 ) | p e n a t l y 2 = | ( y 2 - y 1 ) &times; ( x 4 - x 3 ) - ( y 4 - y 3 ) &times; ( x 2 - x 1 ) | p e n a t l y 3 = | ( y 2 - y 1 ) &times; ( y 4 - y 1 ) - ( x 2 - x 1 ) &times; ( x 1 - x 4 ) | - - - ( 9 )
In formula: penatly1 represents first penalty term, penatly2 represents second penalty term, and penatly3 represents that the 3rd is punished Penalize item;
In area formula, add penalty term obtain the fitness function of population and be:
Fitness=S-100 × (penatly1+penatly2+penatly3)/max{penatly1, penatly2, penatly3} (10)
In formula: fitness represents fitness function;
Bring the initial population that step 2-1 produces into fitness function formula (10) and chromogene is carried out fitness evaluation, and It is ranked up according to the size of fitness value;
Step 2-3: set up selection opertor, uses the mode of roulette to select adaptive value high in the colony that step 2-2 obtains Chromogene, as the population of next step cross-reference, is embodied as:
The mode using roulette selects to produce a new generation population: the selected desired amt of each chromogene and its adaptive value The ratio of shared colony adaptive value summation, as select probability, generates a new generation population;
For the colony N (CH that given scale is m1, CH2..., CHm), individual fitness is fitness (CHi), it selects Probability is:
P ( CH i ) = f i t n e s s ( CH i ) &Sigma; j = 1 n f i t n e s s ( CH j ) , j = 1 , 2 , ... , m - - - ( 11 )
In formula: P (CHi) represent the selected probability of this chromogene;fitness(CHi) represent the adaptive value of this chromosome;
I.e. calculate the ratio that each individual fitness is shared in colony's adaptive value summation, represent this chromosome in the selection process Selected probability;Then the random number rand between [0,1] is generated, if met:
∑[P(CH1)+P(CH2)+.......+P(CHi-1)]≤rand≤∑[P(CH1)+P(CH2)+.......+P(CHi)]
Then select i-th chromosome CHi;Selected population N is obtained after repetitive operation m timech, footmark ch represents the meaning of English selection;
Step 2-4: the selected population N that step 2-3 is obtainedchCarry out intersecting and operate, use single-point to intersect, by adjacent dyeing Body gene C HiAnd CHi+1Intersect, randomly generate the random number P between [0,1]cIf, Pc< 0.3 in interval [1,7] In randomly generate a crossover location, by chromogene CHiAnd CHi+1Genetic fragment after being positioned at crossover location swaps, If Pc>=0.3 chromogene does not do and intersects, the selected population N so obtained step 2-3chCarry out the friendship of gene two-by-two Fork obtains cross-species Ncr, footmark cr represents the meaning of English intersection;
Step 2-5: the population obtaining step 2-4 carries out mutation operation, arbitrarily produces the random number P between [0,1]m, as Really Pm< 0.7 randomly generates a variable position in interval [1,8], the number of variable position becomes step 1-6 and produces Circumscribed rectangle in a random number;If Pm>=0.7 chromogene does not carry out mutation operation, so to step 2-4 The cross-species N obtainedcrEach genome walking obtain make a variation population Nva, footmark ch represents the meaning of English variation;
Step 2-6: the population N that step 2-3,2-4 and 2-5 are obtainedch、Ncr、NvaForm a gene pool Ngp, to gene 3 × m chromogene in pond utilizes ray method to carry out little rectangular dots, minor matrix four edges differentiates with the relation of blank profile, Chromogene for being positioned at outside blank profile makes fitness function value be zero, to the chromogene in blank profile according to step Rapid 2-2 is evaluated and sorts;
Step 2-7: before chromosome step 2-6 obtained selects, m is individual as follow-on initial population, and will come first The chromosome of position, as elite gene, is not made any change and is directly entered follow-on gene pool NgpIn guarantee the most excellent of every generation Gene will not be destroyed;
Step 2-8: repeated execution of steps 2-3 to step 2-7, until cycle-index reaches default iterations It, stops Optimizing, It >=100;
Step 2-9: the chromogene that gene pool step 2-8 obtained makes number one as optimal base because of output, it is thus achieved that Optimum blank cutting scheme;
Step 3: this is cut out scheme input control system, is cut out the blank to be processed of step 1, it is thus achieved that meet work Blank flat needed for the stock layout of skill.
CN201310521155.5A 2013-10-27 2013-10-27 A kind of cut-out method for the most irregular blank Expired - Fee Related CN103593860B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310521155.5A CN103593860B (en) 2013-10-27 2013-10-27 A kind of cut-out method for the most irregular blank

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310521155.5A CN103593860B (en) 2013-10-27 2013-10-27 A kind of cut-out method for the most irregular blank

Publications (2)

Publication Number Publication Date
CN103593860A CN103593860A (en) 2014-02-19
CN103593860B true CN103593860B (en) 2016-08-17

Family

ID=50083984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310521155.5A Expired - Fee Related CN103593860B (en) 2013-10-27 2013-10-27 A kind of cut-out method for the most irregular blank

Country Status (1)

Country Link
CN (1) CN103593860B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105844615B (en) * 2016-03-17 2018-10-26 网易(杭州)网络有限公司 The method and device of recognition rule rectangular area
CN106216545A (en) * 2016-08-11 2016-12-14 成都柯博特自动化科技有限公司 A kind of production method based on intelligent vision feeder
CN107301634A (en) * 2017-06-28 2017-10-27 湖南瑞森可机器人科技有限公司 A kind of robot automatic sorting method and system
CN112140354B (en) * 2019-06-27 2023-08-22 厦门链石网络科技股份有限公司 Typesetting method for stone large plate

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0745473A2 (en) * 1995-05-29 1996-12-04 Toyo Boseki Kabushiki Kaisha Oriented film including polystyrene polymer having syndiotactic configuration
CN101908180A (en) * 2010-08-20 2010-12-08 秦皇岛首秦金属材料有限公司 MES (Manufacturing execution system) material deformation method for maximizing yield of specified steel plates

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0745473A2 (en) * 1995-05-29 1996-12-04 Toyo Boseki Kabushiki Kaisha Oriented film including polystyrene polymer having syndiotactic configuration
CN101908180A (en) * 2010-08-20 2010-12-08 秦皇岛首秦金属材料有限公司 MES (Manufacturing execution system) material deformation method for maximizing yield of specified steel plates

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于遗传算法的封闭轮廓最小面积凸包围盒生成算法;刘云 等;《孝感学院学报》;20070520;第27卷(第3期);64-66 *
基于遗传算法的数字曲线多边形逼近的实现;刘远洋;《黑龙江科技信息》;20090115(第2期);73-74 *

Also Published As

Publication number Publication date
CN103593860A (en) 2014-02-19

Similar Documents

Publication Publication Date Title
CN103593860B (en) A kind of cut-out method for the most irregular blank
CN107704801B (en) Curve lane line detection method based on segmented straight line and segmented Bezier curve
WO2016169286A1 (en) Workshop layout method for discrete manufacturing system
CN104626585B (en) A kind of plane dividing method and device for SLA3D printers
CN111410414B (en) Implementation method of glass cutting optimization technology
CN104463925B (en) Based on the digital camouflage method for designing of spotting template Automatic Combined
CN101377854B (en) Method for simulating Chinese characters hand-written handwriting by a computer
CN103400368B (en) Based on graph theory and the parallel rapid SAR image segmentation method of super-pixel
CN112084632B (en) Hardware digital production line layout optimization method combining man-machine engineering
CN105488562A (en) Irregular part stock layout method based on multi-factor particle swarm algorithm
CN103593511A (en) Cutting-off and layout method for natural stone slabs with defects
CN103337085A (en) Efficient portrait face distortion method
CN102354402B (en) Drawing rendering method based on style learning
CN105243137A (en) Draft-based three-dimensional model retrieval viewpoint selection method
CN103778655A (en) Color natural image calculation artifying method based on self-adaption ink painting spreading
CN102298788A (en) Interactive cartoon design realization method based on multi-target evaluation
Liu et al. Surface Defect Detection of Steel Products Based on Improved YOLOv5
Lin et al. Urban space simulation based on wave function collapse and convolutional neural network
CN102651137B (en) Algebraic curve rasterization method based on pixel precision
CN103971397A (en) Global illumination rendering method based on virtual point light source and sparse matrix regression
CN105205450A (en) SAR image target extraction method based on irregular marked point process
CN109359381A (en) A kind of voxel-based laser path planing method
CN113283495B (en) Aggregate particle grading method and device
CN102479266B (en) Method for generating structural surface by polishing
CN108062782A (en) A kind of shoe tree Planar Contours automatically generating device and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160817

Termination date: 20161027

CF01 Termination of patent right due to non-payment of annual fee