CN102704215B - Automatic cutting method of embroidery cloth based on combination of DST file parsing and machine vision - Google Patents

Automatic cutting method of embroidery cloth based on combination of DST file parsing and machine vision Download PDF

Info

Publication number
CN102704215B
CN102704215B CN 201210121892 CN201210121892A CN102704215B CN 102704215 B CN102704215 B CN 102704215B CN 201210121892 CN201210121892 CN 201210121892 CN 201210121892 A CN201210121892 A CN 201210121892A CN 102704215 B CN102704215 B CN 102704215B
Authority
CN
China
Prior art keywords
dst
image
cutting
file
sample
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
CN 201210121892
Other languages
Chinese (zh)
Other versions
CN102704215A (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.)
Southeast University
Original Assignee
Southeast 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 Southeast University filed Critical Southeast University
Priority to CN 201210121892 priority Critical patent/CN102704215B/en
Publication of CN102704215A publication Critical patent/CN102704215A/en
Application granted granted Critical
Publication of CN102704215B publication Critical patent/CN102704215B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Sewing Machines And Sewing (AREA)

Abstract

本发明公开一种基于DST文件解析与机器视觉结合的绣布自动切割方法,在毛绒玩具制造业,毛绒玩具的外形和图案是采用刺绣机器进行加工,然后采用激光切割机将整幅绣片进行逐一切割。本发明方法首先通过将DST文件(刺绣文件)解析为图像文件,选择其中的切割单元并提取其信息,获得其单元的内部参数。然后根据照相机拍照得到的切割样本的图像,对其进行相关的处理,将之前得到的切割单元信息与处理后的样本匹配,最终确定切割线位置并产生PLT文件,由切割机进行切割。不同于其它基于机器视觉的激光切割方法,本方法只需要拍照一次就可以完成整幅刺绣样本的切割,本方法具有工作效率高、残次率低的特点,对复杂刺绣样本有很强的切割能力。

Figure 201210121892

The invention discloses an embroidered cloth automatic cutting method based on the combination of DST file analysis and machine vision. In the plush toy manufacturing industry, the shape and pattern of the plush toy are processed by embroidery machines, and then the entire embroidery is cut by a laser cutting machine. slices are cut one by one. The method of the invention first parses the DST file (embroidery file) into an image file, selects a cutting unit therein and extracts its information, and obtains the internal parameters of the unit. Then, according to the image of the cutting sample taken by the camera, relevant processing is performed on it, the cutting unit information obtained before is matched with the processed sample, and the position of the cutting line is finally determined and a PLT file is generated, which is cut by the cutting machine. Different from other laser cutting methods based on machine vision, this method only needs to take a photo once to complete the cutting of the entire embroidery sample. This method has the characteristics of high work efficiency and low defect rate, and has a strong cutting ability for complex embroidery samples. ability.

Figure 201210121892

Description

The automatic cutting method of embroidery cloth of being combined with machine vision based on the DST document analysis
Technical field
The present invention relates to the automatic cutting method of a kind of embroidery cloth, based on the combination of DST document analysis and machine vision.
Background technology
Present embroidery cloth laser cutting system mainly contains two kinds: a kind of is earlier on blank sheet of paper cutting once will embroider the cloth sample then and be placed on the cut surface, cut once again after the profile that cuts out on colored type and the blank sheet of paper embroidered on the cloth is alignd; Another kind is at laser cutting head camera to be installed, and colored type unit of every cutting will extract sample and handle once, namely can only cut a colored type unit at every turn.Because so there is diced system to have inefficiency, therefore problems such as defect ware proportion height press for a kind of new cutting mode, in order to replace current mode.The develop rapidly of machine vision provides a kind of new thinking for we address the above problem.
Machine vision utilizes machine to replace human eye to do various measurements and judgement exactly.It is an important branch of computer subject, and it combines the technology of aspects such as optics, machinery, electronics, computer software and hardware, relates to a plurality of fields such as computer, image processing, pattern-recognition, artificial intelligence, signal processing, optical, mechanical and electronic integration.On production line, the people does this type of measurement and judgement meeting and produces the sum of errors mistake because of fatigue, person-to-person difference etc., but machine but can be tirelessly, stably go on.In general, NI Vision Builder for Automated Inspection has comprised illuminator, camera lens, camera system and image processing system.Use for each, we need the size of the speed of service of taking into account system and image processing velocity, detection target still to detect target that zero defect, visual field needs are much, height more than resolution ratio needs, contrast needs are much etc.Typical NI Vision Builder for Automated Inspection can be divided into: IMAQ part, image processing section and motion control part.
The groundwork process of a complete NI Vision Builder for Automated Inspection is as follows:
1, camera is taken pictures according to instruction, and its time for exposure preestablishes;
2, IMAQ partly receives the Digital Image Data after the video camera digitlization, and it is deposited in processor or the calculator memory;
3, measurement result or logic control value are handled, analyze, identify, obtained to processor to image;
4, the error of the action of result control streamline, location, correction campaign etc.
Summary of the invention
Goal of the invention: low in order to overcome the operating efficiency that exists in the prior art, stock utilization is low, and cost is than problems such as height.The present invention has solved the shortcoming that original diced system scientific and technological content and operating efficiency are low, defect ware proportion is high by using the method for machine vision.By using the method for machine vision, reduced the effect of people in cutting process, rely on the high accuracy of camera and cutting machine, can improve greatly product yield rate, reduce cost, increase work efficiency.
Technical scheme: for solving the problems of the technologies described above, the invention provides a kind of automatic cutting method of embroidery cloth of being combined with machine vision based on the DST document analysis, it is characterized in that this method uses a kind of laser cutting machine, set up camera directly over this laser cutting machine cut surface, the automatic cutting method of described embroidery cloth comprises the steps:
(1) DST document analysis obtains original embroidery document image information and internal feature information, for images match does homework;
(2) sample extraction and processing, taking pictures by camera obtains sample image information, and sample image is carried out distortion correction, binary conversion treatment and extracts the operation of sample internal feature, obtains the characteristic information of sample;
(3) coupling is mated the DST file that obtains and the characteristic information of sample, and the matching unit barycenter also carries out barycenter coupling and line of cut correction according to least square method;
(4) DST shines upon, and the line of cut coordinate after the coupling is mapped to by coordinate transform be used for cutting under the cut surface coordinate system, exports the PLT file that laser cutting machine can be carried out then, is cut by laser cutting machine.
The present invention will be input to treatment system and handle for embroidery cloth embroidery file (DST file) information of processing down toy by the DST analytical algorithm, obtain matched sample, extract by camera then and embroider cloth sample image, and information and the certain Processing Algorithm of using DST to resolve acquisition detect embroidery cloth, obtain the wherein position of each cutter unit, result is fed back to laser cutting machine carry out cutting operation, to improving cutting accuracy, reduce the work complexity, reducing workload and have very important significance.
The present invention utilizes machine vision to replace artificial method, utilize the performance of camera resolution height, working stability, by certain handling procedure, the image processing algorithm of uses advanced can improve cutting efficiency greatly, reduce cutting machine for people's degree of dependence, raise labour productivity, because high accuracy of the present invention, can effectively improve the utilization rate of cloth, reduce the defect ware proportion of cutting.Be different from other based on the laser cutting method of machine vision, this method only need be taken pictures and once just can be finished the cutting of view picture embroidery sample, has high efficiency, characteristics that inferior rate is low.Complexity embroidery sample there is very strong cutting power.
Description of drawings
Fig. 1, machine vision cutting flow chart
Fig. 2, the display frame of DST file;
Embroidery cloth after Fig. 3, the embroidery of corresponding DST file;
Fig. 4, the inner separate unit of DST file extract;
Fig. 5, frame extract flow chart;
Fig. 6, DST unit and frame intersect;
Fig. 7, be used for to obtain the circular image after the cutting of transformed coordinate system;
Fig. 8,9 casual water completion methods;
Fig. 9, MFC operation interface;
Figure 10, laser cutting machine schematic diagram;
The image that goes out in the MFC interface display after Figure 11, the images match;
Figure 12, line of cut location general image;
Figure 13, line of cut location topography;
Figure 14, laser cutting machine cutting process;
Figure 15, cutting back image.
The specific embodiment
Theoretical foundation: image recognition.The first step of image recognition is to extract effective characteristics of image, here, we mainly introduce moment characteristics amount and contour feature amount, and the moment characteristics amount comprises Hu square, normalization rotary inertia (NMI) and affine not bending moment, and the contour feature amount comprises profile discretization parameter and singular value decomposition.These 5 characteristic quantities all have good translation, rotation and constant rate, have obtained using widely in image object identification.
1 couple of the present invention does further explanation below in conjunction with accompanying drawing.
The 1DST document analysis
Because the embroidery file of computer design is the DST form, can not directly obtain its internal feature and image information, therefore the first step of the present invention is the DST document analysis, and the DST file is resolved, and obtains its image information and internal feature.The DST file is made up of header file and style file body, and two parts are used for depositing different information, and concrete resolving is as follows.
1.1DST header file is formed
The style file header is mainly used to deposit some about the descriptive information of style, the DST file has the file header of 512 bytes, preceding 128 bytes have been stored some fileinfos with the form of text, these information comprise message identification and the value of information, the value of information is used decimal code, untapped part is replaced by space character (ASCII character value 0x20), each section by character " " (ASCII character value 0x0D) isolate, specifically each section meaning is referring to table 1.
Table 1 DST form style file header structure
1.2 style file body structure
What deposit in the style file is the data of describing the whole needle trackings actions of style, has both comprised the displacement of every needle tracking, has also comprised the control of the actions such as trimming, colour changing of embroidery machine.The style file body of DST, form be since the 513rd byte to EOF, and per 3 bytes are used for representing a pin, and are as shown in table 2.
A 7A 6A 5A 4A 3A 2A 1A 0 B 7B 6B 5B 4B 3B 2B 1B 0 C 7C 6C 5C 4C 3C 2C 1C 0
Per three byte representation one pins in the table 2 style file
This paper arranges level and is the X forward to the right, is the Y forward vertically downward.We make △ x, and △ y represents the displacement of needle tracking on X, Y-direction respectively, and namely current pin is with respect to the relative step number of last needlework frame in X, Y-direction movement.DST is a kind of ternary coding form.△ x, △ y need calculate with reference to the weights shown in the table 3.
Figure GDA00003400349200041
The weights of every correspondence in one pin of table 3.DST form
Computing formula is as follows:
△x=A 3*(-9)+A 2*9+A 1*(-1)+A 0*1+B 3*(-27)+B 2*27+B 1*(-3)+B 0*3+C 3*(-81)+C 2*81
△y=A 7*1+A 6*(-1)+A 5*9+A 4*(-9)+B 7*3+B 6*(-3)+B 5*27+B 4*(-27)+C 5*81+C 4*(-81)
C among the DST 7, C 6, C 1, C 0This four constitute its function code, as shown in table 4.
Function Value
Make C 7=C 6=0,C 1=C 0=1
Bouncing pilotage C 7=C 1=C 0=1,C 6=0
Colour changing C 7=C 6=C 1=C 0=1, represent that other position of this pin is 0
Trimming The bouncing pilotage sign indicating number that several are continuous
Finish C 7=C 6=C 5=C 4=C 1=C 0=1, represent that other position of this pin is 0
The function code of table 4DST
Also have a termination character 0xlA at DST formatted file end, in addition, empty needle is the special pin of making, and value is equal to 0.
According to said process, all data messages of DST file are resolved, after parsing is finished, create a width of cloth blank image, the information that obtains according to parsing on this image delineates out in this blank image, thereby obtains the image information of DST file.
1.3 the unit in the justifying DST file extracts
Fig. 2 is the manufacturing DST file of the typical down toy of a width of cloth, and Fig. 3 is the embroidery cloth of its correspondence.The characteristic feature of this class DST file is:
1, a big outer rim is arranged in the DST file, be used for determining to embroider the size of cloth;
2, there are some separate units inside, and each unit is the embroidered square of making down toy;
3, separate unit has frame line separately, and this edge frame line is actual to be the line of cut of this unit;
4, be bouncing pilotage between the separate unit, do not have line to connect, perhaps have only single line to connect;
5, in order to save the space, often according to left-right symmetry, perhaps symmetry is arranged up and down between the internal element;
6, the separate unit inner element is no more than line of cut.
According to these features, we have adopted method as shown in Figure 4 to extract separate unit in the DST file.
1.4DST resolve
The parsing of DST file is handled just passable according to header file composition and the coded system of DST file in theory, but in the DST of reality file, file data tends to occur indivedual mistakes, typical problem is exactly to represent view picture DST size+X in the header file,-X ,+Y ,-Y data are mistake often, the calculating so need sort to the point among the DST obtains actual DST image size.
At first, obtain the offset coordinates of every pin according to DST document No. mode, i.e. △ x, △ y value then by progressively addition, obtains the coordinate of each pin of view picture DST.Because coordinate zero point is starting point in the DST file, handle conveniently for successive image, need handle coordinate, first on upper left side is made as coordinate zero point, be to the right x axle positive direction, be downwards y axle positive direction.When resolving, note each at the embroidery mode of operation of answering.
1.4.1 the judgement of outer rim
In general view picture is embroidered cloth all outer rim, and embroidering the cloth housing mainly is for the size of confirming the DST file substantially, and product does not need outer rim but we send out existing in the reality investigation.Therefore, the first step of DST format analysis has judged whether outer rim exactly.Judge the flow process of outer rim, as Fig. 5.
In order to save cloth, some DST unit may intersect with outer rim, as Fig. 6 in the DST of reality embroidered square.So the size of frame not necessarily with DST space of a whole page equal and opposite in direction.Outer rim is all once embroidered into by embroidery machine, so outer rim is a continuous closed data segment, and continuous data segment is very many in the DST file, therefore need carry out verification to the DST continuous data segment of collecting, and judges whether it is outer rim.Rule of judgment:
1. four end points are relevant with DST space of a whole page size;
2. the point between each end points all point-blank.
1.4.2DST the judgement of cell borders
There is following feature DST unit in the down toy DST file:
1, DST cell borders closure;
2, not thread-changing in the single DST cell borders embroidery process;
3, two adjacent edge frames are if close together may not thread-changing, generally all can thread-changing;
4, the DST unit is arranged uncertainly, and at present association area does not also have Automatic Typesetting software, all is the own random arrangement of designer, and randomness is bigger;
5, if outer rim is arranged, then the frame of DST unit is only surrounded by outer rim.If no outer rim does not then have other closed data segment to surround the DST cell borders.
According to above feature, at first need to determine all closed data segments, judge then whether certain closed data segment is cell borders.Can judge according to feature whether a closed data segment is the DST cell borders.In practical operation, the DST cell borders is irregular figure often, judges whether inside has comparatively difficulty of element, so we adopt the processing of advancing of the method for boundary rectangle.
1.4.3DST inner element is determined
DST unit inner element feature in the down toy DST file:
1, internal element has been embroidered several times.For the consideration that reduces the colour changing number of times, generally all be that color identical in the whole space of a whole page has all been embroidered afterwards just can colour changing, so internal element will repeatedly could have been embroidered in general, so inner element comparatively disperses.
2, inner element can not surpass cell borders.
According to above feature, our processing method mainly is to mate except continuous data and existing DST cell borders boundary rectangle outside outer rim (if existence), the cell borders, and which element can determine has in certain DST cell borders.
1.5 extract DST unit internal information
DST unit according to above DST document analysis obtains extracts its inner parameter, is used for next step images match.By calculating parameters such as obtaining internal feature figure, barycenter, characteristic vector.Because might there be too much feature in inside, DST unit, therefore when extracting DST unit internal information, can be set to automatic information extraction, also can namely select interesting areas with mouse by the mode of artificial extraction.The present invention tends to the latter, the better effects if of coupling some.
2 sample extraction and processing
A most important step of vision-based detection is exactly IMAQ and processing, can realize accurate vision measurement by high-resolution camera, native system adopts the Cannon550d camera, and this camera has 1,800 ten thousand pixels, resolution ratio is 5184*3456, and camera lens is for focusing the 50mm camera lens.Can comparatively comprehensively extract sample information by high-resolution camera, for the processing of sample image is laid a good foundation.Native system has stronger applicability, can be applied in other similar system.
2.1 system calibrating
Because embroidery cloth full-size to be processed is 60cm*40cm, consider the lens parameters of camera, camera frame is located at 1.4m place directly over the cut surface.In case camera is in place, with the cutting machine working face of camera lens perpendicular alignmnet below, adjust camera to pinpointed focus, locked then, no longer change camera parameter and position.The effective field of view of camera is about 62.98cm*42cm.
Carry out camera calibration according to the Zhang Zhengyou method, can obtain the distortion parameter of camera after the demarcation and then utilize the least square circle to detect the information such as mapping point that are tied to the cutting machine coordinate system by camera coordinates.Thereby finish following function:
1, carries out predistortion by distortion parameter, recover the real cloth sample image of embroidering as much as possible;
2, carry out camera coordinates and be tied to mapping under the physical coordinates system (coordinate system of machine), thereby instruct cutting machine correctly to cut.
Need demarcate when using for the first time, the distortion parameter, confidential reference items matrix and the camera coordinates that are used for the acquisition camera are tied to the mapping relations of cutting machine coordinate system.Calibration process is:
At first obtain lens distortion parameter and the confidential reference items matrix of camera by " Zhang Zhengyou gridiron pattern standardization ".Preserve parameter then, behind later every acquisition piece image, at first carry out distortion correction, to recover the information of original image as far as possible.
Next, adopt " based on the coordinate system standardization of least square method circle detection " to obtain the coordinate system transformation matrix, step is as follows:
(1) at first designs the PLT file of demarcating circle for cutting, be illustrated in fig. 7 shown below, cut out the circle of the different radii arrangement of 6*9 at the blank sheet of paper of a 70cm*55cm;
(2) from the PLT file, obtain accurate central coordinate of circle under the cutting machine coordinate system, P Ij=(x Ij, y Ij), x wherein Ij, y IjX axial coordinate and the y axial coordinate of the center of circle on the cutting machine coordinate system of representing the circle of the capable j row of i respectively;
(3) utilize camera to take one and demarcate circular image clearly, utilize existing distortion parameter then, carry out image and correct;
(4) adopt casual water completion method that the image after correcting is carried out binary conversion treatment, the circle in the image is become white, background becomes black;
(5) image after the binaryzation is carried out profile and extract, detect the point sequence C that each demarcates circle Ij
(6) each point sequence is carried out the match of RANSAC circle, obtain the central coordinate of circle Q of each circle Ij=(x' Ij, y' Ij), x' wherein Ij, y' IjRepresent x axial coordinate and the y axial coordinate that fasten in camera coordinates in the center of circle of the circle of the capable j of i row respectively;
(7) with the central coordinate of circle under the cutting machine coordinate system according to from left to right, form from top to bottom is arranged as homogeneous coordinates matrix P, with camera coordinates system down central coordinate of circle also be shown homogeneous coordinates matrix Q according to the race-card of correspondence;
P = x 11 , y 11 , 1 x 12 , y 12 , 1 · · · x 19 , y 19 , 1 x 21 , y 21 , 1 · · · · · · x 69 , y 69 , 1 Q = x ′ 11 , y ′ 11 , 1 x ′ 12 , y ′ 12 , 1 · · · x ′ 19 , y ′ 19 , 1 x ′ 21 , y ′ 21 , 1 · · · · · · x ′ 69 , y ′ 69 , 1
(8) adopt least square method, calculate the transform matrix M that is mapped to the cutting machine coordinate system from camera coordinate system, make it to satisfy following formula:
Q*M=P
(9) preserve matrix M, with it as later coordinate system mapping parameters.
2.2 sample extraction
The process of sample extraction is that sample is taken pictures, and carries out the process of distortion correction then.Put into when embroidering the cloth finished product at every turn and need guarantee that sample fully in the visual field of camera, prevents the situation that sample departs from the camera visual field.Be printed on the boundary line of workspace at the working face of cutting machine, place that the boundary line can guarantee to embroider the cloth position in valid analysing range as long as roughly align in the upper left corner when embroidering cloth at every turn.
2.3 sample process
Figure 3 shows that an embroidery cloth that adopts the full-automatic computer embroidery machine to finish, embroider and be covered with a lot of flower type unit (minimum unit in the sampler file) on the cloth, the position of arranging of these flower type unit is basic consistent with the DST design document, therefore there is a perspective transformation matrix from the DST file to embroidery cloth sample, with the DST coordinate system transformation to embroidering the cloth physical coordinates is.Computer embroidering machine is according to the embroidery data that comprises in the DST file, and embroidery such as execution is made, bouncing pilotage, colour changing, trimming are moved.Usually the precision of computer embroidering machine is 0.1mm, under the condition of ignoring the machine system error, can think DST file and actual embroidery cloth finished product, is man-to-man full scale mapping.In the time of on embroidering the cut surface that cloth is placed on cutting machine artificially, exists one from the DST file to the perspective transformation matrix of embroidering cloth sample image, the DST coordinate system transformation is arrived magazine embroidery cloth coordinate system.But in actual the use, it is soft yielding embroidering cloth, causes this conversion to have error.Especially when embroidering the perk of cloth part, have tangible distortion.Therefore need to adopt least square method, calculate the optimal transformation matrix.
A common colored type unit has comprised line of cut and inner a plurality of colored type elements of a closure.These flower type elements arranging and the shape machine of all embroider is embroidered out according to the DST file, therefore, can embroider the thorn embroidery type unit that roughly find correspondence on the cloth according to the position that obtains flower type unit in the DST file.
The basic step of sample process is:
1, cell location according to the arrange linear transformation of position and camera of DST unit, estimates the approximate location of colored type unit, orients a rectangle frame.In the position fixing process, resolve the size of the colored type unit obtain according to DST, choose a rectangle frame that can comprise colored type unit, basis draws the rectangle frame that transforms on the cutting machine by camera to the coordinate system transformation of cutting machine then.
2, binaryzation with the coloured image binaryzation in the flower type unit rectangle frame, arranges embroidery cloth background colour and becomes black, and other elements become white, keep the contour feature of flower type unit inner element.The follow-on casual water completion method in this part is used for improving the effect that casual water is filled.A plurality of as sample point by in the embroidery sample, selecting at random, by judging whether these points of selecting at random are background dot, be used as the seed point if then keep, if not then ignoring, increased the robustness of system after the improvement, the better effects if that the water that overflows is filled.
3, calculate the contour feature vector, calculate Hu square and the barycenter of binaryzation frame.
2.3.1 cell location
According to the DST analysis result, can obtain size and the corresponding bounding box of each DST unit.Also exist a kind of linear transformation between the embroidery cloth sample that DST file and camera collect, therefore can estimate each cell position of embroidering in the cloth according to the cell position that from the DST file, is resolved to.Because camera is fixed, and DST embroidery file and corresponding embroidery cloth can be regarded as basically identical.Just exist translation, rotation, three kinds of conversion of convergent-divergent between the coordinate in the DST file and the corresponding camera coordinates.
The putting position of embroidering cloth has tentatively determined shift factor T and twiddle factor R.Owing to embroider the constraint that is subjected to a certain degree of putting of cloth sample, namely embroider the effective field of view that cloth must be put into camera, therefore can estimate shift factor T'.Can embroider the zoom factor S' of cloth according to a preliminary estimate by the visual field size of camera.Can estimate twiddle factor R' by four angles of embroidering cloth, concrete steps are as follows:
(1) according to embroidering the position constraint that cloth is put: owing to embroider the visual field problem that need consider camera when cloth is put, native system is marked with effective coverage and orthogonal coordinate at cutting machine.To embroider cloth and substantially put into cutting machine as requested, then embroider the cloth anglec of rotation be generally less than ± 10 °.Can be obtained the barycenter homogeneous coordinates V of unit, 4 summits again by DST document analysis result k=(x k, y k, 1), k=1,2,3,4, and corresponding rectangular element frame R k=W k* H kThe unit, summit is numbered 1~4 according to clockwise direction.
Parameter: x wherein kFor obtaining the x axial coordinate of k summit units centre of mass of image after the DST parsing; y kFor obtaining the y axial coordinate of k summit units centre of mass of image after the DST parsing; R kFor obtaining the frame of the unit, k summit of image after the DST parsing; W kBe its border width; H kBe its frame length.
(2) adopt the Pan and Zoom conversion coefficient that estimates, obtained the initial barycenter homogeneous coordinates of unit, 4 summits in the sample image by following formula:
V' k=(x' k,y' k,1),k=1,2,3,4
The frame of unit, 4 summits in the image:
R' k=W' k×H' k=S'W k×S'H k
V ′ k T = S ′ 1 0 T ′ x 0 1 T ′ y 0 0 1 V k T
Parameter: x wherein k' be the x axial coordinate of k summit units centre of mass of sample image; y k' be the y axial coordinate of k summit units centre of mass of sample image; R k' be the frame of the unit, k summit of sample image; W k' be its border width; H k' be its frame length; T' xShift factor for x axle in the sample image; T' yShift factor for y axle in the sample image.
(3) it is level and smooth sample image to be carried out Gauss, and it is down-sampled to carry out 1/2 pyramid then, might as well get 1/4 rectangular area of embroidering the cloth size at the center of embroidering cloth, counts the highest color of the frequency of occurrences as embroidering the cloth background colour by color histogram.
(4) in sample image, with coordinate V' kCentered by, then with 1.5W k' * 1.5H k' fill binary conversion treatment for carrying out 11 casual water in the rectangular area of length and width.Shown in Fig. 8 (wherein Fig. 8 is that 9 casual water are filled), select 11 points as alternative seed point at first at random, seed point to each candidate, in the zone of 11 * 11 neighborhoods, calculate color mean value, if mean value approaches the background colour of embroidering cloth, and neighborhood color variance is less, then this point is classified as casual water and is filled the seed point.
(5) each seed point is carried out casual water filling algorithm, obtain unit V' kBinary image.Then, carry out sliding window search, in window, calculate contour area than and regional Hu square, and with DST in corresponding vertex V kContour feature carry out similitude relatively, be shown below:
I ( A , B ) = Σ p = 1 7 | m p A - m p B m p A |
m p A = sign ( h p A ) log | h p A |
m p B = sign ( h p B ) log | h p B |
I(A,B)<T hu
Wherein: A resolves the unit of back image for the DST that selects; B is the unit of the sample image of selection;
Figure GDA00003400349200098
With
Figure GDA00003400349200099
It is respectively the Hu square of A and B.T HuBe Hu square similarity threshold, generally be taken as 1.5.
(6) will satisfy the rectangular area of area ratio and Hu square similarity threshold as unit V' kThe boundary candidate frame, then, with the boundary candidate of Hu square similarity minimum as unit V' kThe real border frame.And obtain the true barycenter V'' of unit k
(7) by vertex vector in the image
Figure GDA00003400349200095
Vertex vector with DST embroidery file
Figure GDA00003400349200096
Between angle theta kAnd shift factor T', can obtain twiddle factor estimated value R'=θ.
(8) according to resolving each DST cell borders upper left corner homogeneous coordinates L that obtains in the DST file k=(x k, y k, 1) and estimate the transformation factor obtain, can estimate the frame upper left corner homogeneous coordinates L' of each flower type unit in the image kCorresponding DST frame scaled S' doubly.
L &prime; k T = S &prime; cos &theta; - sin &theta; T x &prime; sin &theta; cos &theta; T y &prime; 0 0 1 L k T
2.3.2 the binaryzation of embroidery sample
After carrying out cell location, can decide the home position of each flower type unit, local positioning is carried out in each frame inside then.Not only reduce treating capacity, accelerated processing speed, and improved positioning accuracy.The binaryzation of flower type unit is the basis of accurately extracting each unit inner element contour feature.By contrasting various binarization methods, the result of contrast binaryzation in order to guarantee the robustness of binaryzation, has improved original casual water filling algorithm, has designed a kind of adaptive casual water filling algorithm:
1, obtains the main background colour of embroidering cloth.According to DST file and camera parameter, select to embroider the cloth central area, the color histogram in computer center zone, with the highest color of frequency as embroidering cloth master color, i.e. background colour;
2, adopt 9 methods to calculate the seed point that casual water is filled.Sampling 9 points as shown in Figure 8 in image, whether be background colour, if background colour is then included it in the seed point if calculating this place neighborhood window;
3, adaptive threshold is chosen.Adopt basic thresholding method to obtain the threshold value that two-value is cut apart, and calculate crest to both sides, quantize the peak separation.By the discretization of quantized interval, realize adaptive threshold;
4, with adaptive threshold the seed point that remains is overflow water and fill, and add up the coverage of each seed point and the color average of covering;
5, filter casual water blank map by hsv color, realize embroidering the sample binaryzation.By the seed point coverage of adding up in 9 casual water filling process, can further upgrade background colour.Calculate the hsv color value of background colour then, filter out residual block of pixels in the binary map with this color value;
6, the UNICOM's territory area in the statistics bianry image, UNICOM's territory bounding box length-width ratio filters out the part zone errors;
7, fill the profile that remains, export complete binary map.
2.3.3 flower type element characteristic extracts
According to the cell location among the 2.3.1, regional Hu square and geometric properties in rectangle frame after the calculating embroidery unit binaryzation.
3 couplings
Calculated the internal feature of DST unit and the internal feature of colored type unit to be matched with top, next needed to mate.Coupling is divided into:
1, geometric properties coupling: a. comprises that area filters, and the profile that contour area is too big or too little is rejected; B. the bounding box length-width ratio is not satisfied the rejecting of threshold value.
2, outline contrasts the Hu square that each spends corresponding unit in type unit and the DST file, calculates matching result.Matching formula:
I ( A , B ) = &Sigma; p = 1 7 | m p A - m p B m p A |
m p A = sign ( h p A ) log | h p A |
m p B = sign ( h p B ) log | h p B |
I(A,B)<T hu
And successfully the units centre of mass of coupling remains, and further does the least square conversion;
3, least square conversion, the least square conversion of each corresponding unit center-of-mass coordinate can obtain a perspective transformation matrix C among the barycenter by flower type unit and the DST.
The 4DST mapping
According to the perspective transformation matrix that coupling obtains, the line of cut that the DST document analysis is obtained is mapped on the embroidery sample image, and shows the embroidery sample image after the mapping.The present invention also has been equipped with individual fine adjustment function, if the line of cut location is inaccurate, and can manual change's line of cut position.After the DST mapping is finished, preservation is mapped to the line of cut information of embroidery sample image, and this information is transformed on the cutting machine coordinate system: demarcate the transform matrix M that the camera coordinates that obtains is tied to the cutting machine coordinate system according to coordinate system, X is the line of cut coordinate of each unit among the DST, and Y is the coordinate of cutting machine coordinate system
Y=CMX
Line of cut image after the preservation conversion, this moment, this line of cut image was laser cutting machine movement locus line to the end.
Because the laser cutting machine control card is only accepted the movement locus of PLT form, therefore the line of cut image that need will obtain at last saves as the file of PLT form.
Operational instances
Be illustrated in figure 9 as the MFC interface that the present invention does, this interface mainly is divided into five parts: embroidery pattern, camera control, image detection, camera calibration and upper right corner display box.Wherein, the embroidery pattern is mainly used in the DST document analysis, by opening the DST file, shows the DST image that parses in the window thereunder; Camera control mainly is the input of control sample image, is used for obtaining sample image, by showing sample information on the cutting machine at upper right corner display box; Image detection is the further processing after the sample image input, mainly is work such as images match, line of cut location; Camera calibration is to be used for determining raw informations such as camera basic parameter, coordinate system transformation when using this invention for the first time.
Figure 10 is the cutting machine schematic diagram after the improvement of the present invention.As shown in FIG., camera frame is located at 1.4m place directly over the cut surface, can comparatively ideally obtain the cloth information of embroidering like this, because uneven illumination is even the image post-processed there is very big influence, therefore set up two fluorescent lamps on the cutting machine both sides, can reduce the inhomogeneous influence for post-processed of light so to greatest extent.The effective field of view of camera is about 62.98cm*42cm, therefore need consider visual field problem when placing embroidery cloth, and we have marked the desirable visual field on cut surface, only need put into marked region substantially when cloth is embroidered in placement and get final product.
Provide the operating procedure of an example below:
(1) need demarcate when of the present invention for the first time using.There are two buttons to be used for demarcating in the lower right corner at MFC interface, finish demarcation by clicking these two buttons, obtain the raw information of system.
(2) sample of will embroidering is put on the working face of cutting machine, is printed on the boundary line of workspace at working face, places that the boundary line can guarantee to embroider the cloth position at valid analysing range as long as roughly align in the upper left corner when embroidering cloth at every turn.
(3) click open button, input is DST file and the parsing of correspondence with it, shows the DST image after resolving in the display window of this part.
(4) click " finding a view " button at the camera control section, in top-right display box, show the visual field of camera, judge by observing whether the embroidery sample is placed in the effective field of view.
(5) clicking " taking pictures " button is used for sample image is imported into system.
(6) click " position probing " button this moment, obtain the matching result of DST image and embroidery sample, as shown in figure 11.Red square frame among the figure, the result of expression coupling namely searches out characteristic area.
(7) click " line of cut detections " and obtain the image that shows among Figure 12, Figure 13, the line of cut image that image obtains according to matching result, it is qualified that the result who locatees by the observation line of cut judges whether.
(8) judge that line of cut is qualified after, click " derivations " button and derive the PLT formatted file that cutting machine can read, begin to cut, cutting process is as shown in figure 14.
(9) Figure 15 is through the cloth after the laser cutting.

Claims (5)

1.一种基于DST文件解析与机器视觉结合的绣布自动切割方法,其特征在于该方法用到一种激光切割机,该激光切割机切割面正上方架设有相机,所述绣布自动切割方法包括如下步骤: 1. An embroidered cloth automatic cutting method based on DST file parsing and machine vision combination, it is characterized in that the method uses a kind of laser cutting machine, this laser cutting machine is set up with camera directly above the cutting surface, and described embroidered cloth is automatically cut The method includes the following steps: (1)DST文件解析,获得原始刺绣文件图像信息和内部特征信息,为图像匹配做准备工作; (1) DST file analysis, obtaining original embroidery file image information and internal feature information, and preparing for image matching; (2)样本提取与处理,通过相机拍照获得样本图像信息,并对样本图像进行畸变矫正、二值化处理以及提取样本内部特征操作,获得样本的特征信息; (2) Sample extraction and processing. The sample image information is obtained by taking photos with the camera, and the sample image is subjected to distortion correction, binarization processing, and internal feature extraction of the sample to obtain the feature information of the sample; (3)匹配,将得到的DST文件与样本的特征信息进行匹配,匹配单元质心并根据最小二乘法进行质心匹配与切割线校正; (3) Matching, matching the obtained DST file with the characteristic information of the sample, matching the centroid of the unit, and performing centroid matching and cutting line correction according to the least square method; (4)DST映射,将匹配后的切割线坐标通过坐标变换映射到切割面坐标系下用于切割,然后输出激光切割机能够执行的PLT文件,由激光切割机进行切割。 (4) DST mapping, the coordinates of the matched cutting line are mapped to the coordinate system of the cutting surface for cutting through coordinate transformation, and then output the PLT file that the laser cutting machine can execute, and the laser cutting machine cuts. 2.如权利要求1所述的基于DST文件解析与机器视觉结合的绣布自动切割方法,其特征在于DST文件解析的过程包括: 2. the embroidered cloth automatic cutting method based on DST file parsing and machine vision as claimed in claim 1 is characterized in that the process of DST file parsing comprises: (1.1)根据DST文件的编码方式解析每一针的功能,记录每一针的偏移坐标与操作,并且记录解析过程中所有出现的闭合数据段; (1.1) Analyze the function of each stitch according to the encoding method of the DST file, record the offset coordinates and operations of each stitch, and record all closed data segments that appear during the analysis process; (1.2)根据(1.1)解析得到的结果,创建一幅空白图像,在图像上将每一针的具体动作勾画出来,得到DST解析图像; (1.2) Create a blank image based on the analysis result of (1.1), draw the specific action of each needle on the image, and obtain the DST analysis image; (1.3)根据(1.1)得到的闭合数据段,判断闭合数据段是否为DST单元的边框,如果该闭合数据段是边界框,则提取其内部的信息作为DST单元的信息,如果不是则继续判断,直到得到DST单元的边界框。 (1.3) According to the closed data segment obtained in (1.1), judge whether the closed data segment is the border of the DST unit. If the closed data segment is a bounding box, extract its internal information as the information of the DST unit. If not, continue to judge , until the bounding box of the DST cell is obtained. 3.如权利要求1所述的基于DST文件解析与机器视觉结合的绣布自动切割方法,其特征在于从相机坐标系映射到切割机坐标系的变换矩阵采用“基于最小二乘法圆检测的坐标系标定法”获得,步骤如下: 3. The embroidered cloth automatic cutting method based on DST file parsing and machine vision as claimed in claim 1 is characterized in that the transformation matrix mapped to the cutting machine coordinate system from the camera coordinate system adopts "coordinates detected based on the least squares method circle". system calibration method", the steps are as follows: (1)首先设计好用于切割标定圆的PLT文件; (1) First design the PLT file for cutting the calibration circle; (2)从PLT文件中获取切割机坐标系下精确的圆心坐标                                               
Figure 2012101218921100001DEST_PATH_IMAGE001
,其中
Figure 950694DEST_PATH_IMAGE002
Figure 2012101218921100001DEST_PATH_IMAGE003
分别表示第i行第j列的圆的圆心在切割机坐标系上的x轴坐标和y轴坐标; 
(2) Obtain the precise circle center coordinates in the cutting machine coordinate system from the PLT file
Figure 2012101218921100001DEST_PATH_IMAGE001
,in
Figure 950694DEST_PATH_IMAGE002
,
Figure 2012101218921100001DEST_PATH_IMAGE003
Respectively represent the x -axis coordinates and y-axis coordinates of the circle center of the i- th row and j-th column on the cutting machine coordinate system;
(3)利用相机拍摄一张清晰的标定圆图像,然后利用已有的畸变参数,进行图像矫正; (3) Use the camera to take a clear calibration circle image, and then use the existing distortion parameters to correct the image; (4)采用漫水填充法对矫正后的图像进行二值化处理,将图像中的圆变成白色,背景变为黑色; (4) Binarize the rectified image by flood filling method, turning the circle in the image into white and the background into black; (5)对二值化后图像进行轮廓提取,检测出每个标定圆的轮廓点序列; (5) Extract the contour of the binarized image, and detect the contour point sequence of each calibration circle; (6)对每个轮廓点序列进行RANSAC圆拟合,获得相机坐标系下标定圆圆心坐标,其中
Figure 2012101218921100001DEST_PATH_IMAGE005
Figure 631522DEST_PATH_IMAGE006
分别表示第i行第j列的圆的圆心在相机坐标系上的x轴坐标和y轴坐标; 
(6) Perform RANSAC circle fitting on each contour point sequence to obtain the coordinates of the center of the calibration circle in the camera coordinate system ,in
Figure 2012101218921100001DEST_PATH_IMAGE005
,
Figure 631522DEST_PATH_IMAGE006
Respectively represent the x- axis coordinates and y-axis coordinates of the circle center of the i- th row and j-th column on the camera coordinate system;
(7)将切割机坐标系下的圆心坐标按照从左到右,从上往下的形式排列为齐次坐标矩阵P,将相机坐标系下圆心坐标也按照对应的次序排列为齐次坐标矩阵Q; (7) Arrange the coordinates of the center of the circle under the cutting machine coordinate system into a homogeneous coordinate matrix P from left to right and from top to bottom, and arrange the coordinates of the center of the circle under the camera coordinate system into a homogeneous coordinate matrix according to the corresponding order Q; (8)采用最小二乘法,计算出从相机坐标系映射到切割机坐标系的变换矩阵M,使之满足:Q*M=P。 (8) Use the least square method to calculate the transformation matrix M mapped from the camera coordinate system to the cutting machine coordinate system, so that it satisfies: Q*M=P.
4.如权利要求1所述的基于DST文件解析与机器视觉结合的绣布自动切割方法,其特征在于样本提取与处理过程中,采用改进的自适应漫水填充法对样本图像进行二值化处理,即通过在刺绣样本中随机选择多个点作为样本点,判断这些随机选择的点是否为背景点,如果是则保留当作种子点,如果不是则忽略。 4. The embroidered cloth automatic cutting method based on DST file parsing and machine vision as claimed in claim 1 is characterized in that in the sample extraction and processing process, the sample image is binarized by using the improved adaptive flood filling method Processing, that is, by randomly selecting multiple points in the embroidery sample as sample points, judging whether these randomly selected points are background points, if they are, they will be kept as seed points, and if not, they will be ignored. 5.如权利要求1所述的基于DST文件解析与机器视觉结合的绣布自动切割方法,其特征在于为了减小光照不均匀对图像后期处理产生的影响,在切割机两侧分别加装一盏日光灯。 5. The embroidered cloth automatic cutting method based on DST file parsing and machine vision as claimed in claim 1 is characterized in that in order to reduce the impact of uneven illumination on image post-processing, install a a fluorescent lamp.
CN 201210121892 2012-04-24 2012-04-24 Automatic cutting method of embroidery cloth based on combination of DST file parsing and machine vision Expired - Fee Related CN102704215B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201210121892 CN102704215B (en) 2012-04-24 2012-04-24 Automatic cutting method of embroidery cloth based on combination of DST file parsing and machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201210121892 CN102704215B (en) 2012-04-24 2012-04-24 Automatic cutting method of embroidery cloth based on combination of DST file parsing and machine vision

Publications (2)

Publication Number Publication Date
CN102704215A CN102704215A (en) 2012-10-03
CN102704215B true CN102704215B (en) 2013-09-25

Family

ID=46897249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201210121892 Expired - Fee Related CN102704215B (en) 2012-04-24 2012-04-24 Automatic cutting method of embroidery cloth based on combination of DST file parsing and machine vision

Country Status (1)

Country Link
CN (1) CN102704215B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107130376A (en) * 2016-02-26 2017-09-05 黄德林 Computer Three-dimensional embroidery calligraphy and painting process
WO2018035538A1 (en) 2016-08-19 2018-02-22 Levi Strauss & Co. Laser finishing of apparel
EP3704608A4 (en) 2017-10-31 2021-08-18 Levi Strauss & Co. Using neural networks in creating apparel designs
US10712922B2 (en) 2017-10-31 2020-07-14 Levi Strauss & Co. Laser finishing design tool with damage assets
CN107967697B (en) * 2017-11-23 2021-02-26 四川大学 Three-dimensional measurement method and system based on color random binary coding structure illumination
CN112272596B (en) 2018-02-27 2023-06-23 利惠商业有限公司 On-Demand Manufacturing of Laser Finished Garments
US11026461B2 (en) 2018-02-27 2021-06-08 Levi Strauss & Co. Substituting an existing collection in an apparel management system
CN108875740B (en) * 2018-06-15 2021-06-08 浙江大学 Machine vision cutting method applied to laser cutting machine
US10883223B2 (en) 2018-08-07 2021-01-05 Levi Strauss & Co. Laser finishing design tool
EP3881146A1 (en) 2018-11-16 2021-09-22 The North Face Apparel Corp. Systems and methods for end-to-end article management
US11632994B2 (en) 2018-11-30 2023-04-25 Levi Strauss & Co. Laser finishing design tool with 3-D garment preview
WO2021016497A1 (en) 2019-07-23 2021-01-28 Levi Strauss & Co. Three-dimensional rendering preview of laser-finished garments
CN111144160B (en) * 2019-12-27 2023-10-20 杭州爱科科技股份有限公司 Full-automatic material cutting method and device and computer readable storage medium
CN111611721A (en) * 2020-05-29 2020-09-01 全球能源互联网集团有限公司 Computer arrangement method of solar cell array
CN111932491B (en) * 2020-06-23 2022-02-08 联宝(合肥)电子科技有限公司 Component detection method, device and storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01289591A (en) * 1988-05-16 1989-11-21 Shinko Kogyo Co Ltd Multi head laser beam machine
JPH03138092A (en) * 1989-10-24 1991-06-12 Toshiba Corp Laser beam machine
JP2971327B2 (en) * 1993-07-28 1999-11-02 株式会社 タナベ刺繍 Sewing machine with laser cutter and embroidery method
EP0753372B1 (en) * 1995-01-13 2002-04-17 Tokai Kogyo Mishin Kabushiki Kaisha Laser processing machine and sewing machine with laser processing function
JPH0957473A (en) * 1995-08-25 1997-03-04 Kesami Hasegawa Method for marking identification bar code of needle
ITTO20030263A1 (en) * 2003-04-04 2004-10-05 Fiat Ricerche PROCEDURE FOR THE QUALITY CONTROL OF A
CN2734440Y (en) * 2004-07-06 2005-10-19 东莞市粤铭激光技术有限公司 Full-automatic camera shooting brand cutting machine
DE102005050482B3 (en) * 2005-10-21 2007-01-11 Saurer Hamel Ag Continuously embroidering and cutting materials, especially appliques, in embroidering machine with laser cutting head, with cutting unit operated during frame shut-down and/or material advancement stage
CN201087267Y (en) * 2007-07-04 2008-07-16 东莞市粤铭激光技术有限公司 Multi-head computer embroidery machine with laser pattern carved device
US8024060B2 (en) * 2008-06-16 2011-09-20 Electro Scientific Industries, Inc. Method for defining safe zones in laser machining systems
CN201567495U (en) * 2009-08-14 2010-09-01 武汉金运激光股份有限公司 Laser cutting head and integrated laser embroidery machine using the same

Also Published As

Publication number Publication date
CN102704215A (en) 2012-10-03

Similar Documents

Publication Publication Date Title
CN102704215B (en) Automatic cutting method of embroidery cloth based on combination of DST file parsing and machine vision
Deng et al. Automatic indoor construction process monitoring for tiles based on BIM and computer vision
CN111474184B (en) AOI character defect detection method and device based on industrial machine vision
CN111223133B (en) Registration method of heterogeneous images
CN105067638B (en) Tire fetal membrane face character defect inspection method based on machine vision
CN105913093B (en) A Template Matching Method for Character Recognition Processing
CN102176228B (en) A Machine Vision Method for Recognizing Information on Multiple Analog Instrument Dials
CN105095958B (en) A kind of silk cocoon method of counting
CN103646249B (en) A kind of greenhouse intelligent mobile robot vision navigation path identification method
CN106951905A (en) A method for identifying and locating apples on a tree based on a TOF camera
CN107657639A (en) A kind of method and apparatus of quickly positioning target
CN109580630A (en) A kind of visible detection method of component of machine defect
CN102760228B (en) Specimen-based automatic lepidoptera insect species identification method
CN107230203A (en) Casting defect recognition methods based on human eye vision attention mechanism
CN105913013A (en) Binocular vision face recognition algorithm
CN102930251A (en) Two-dimensional collection data recording and discriminating device and method
CN110852315A (en) Method and device for quickly identifying annular characters
CN110490826B (en) Fog drop sample image processing method in camera
CN111161295B (en) Dish image background stripping method
CN109389165A (en) Oil level gauge for transformer recognition methods based on crusing robot
CN113657339A (en) A machine vision-based meter pointer counting reading method and medium
CN103699876A (en) Method and device for identifying vehicle number based on linear array CCD (Charge Coupled Device) images
CN114219753A (en) Power equipment surface defect detection method based on deep learning and terminal
CN110097540A (en) The visible detection method and device of polygon workpeace
CN110263784A (en) The English paper achievement of intelligence identifies input method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130925

Termination date: 20170424