CN107204022B - Method for acquiring machining path according to machining curve - Google Patents

Method for acquiring machining path according to machining curve Download PDF

Info

Publication number
CN107204022B
CN107204022B CN201710399940.6A CN201710399940A CN107204022B CN 107204022 B CN107204022 B CN 107204022B CN 201710399940 A CN201710399940 A CN 201710399940A CN 107204022 B CN107204022 B CN 107204022B
Authority
CN
China
Prior art keywords
coordinate
point
curve
path
machining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710399940.6A
Other languages
Chinese (zh)
Other versions
CN107204022A (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.)
Tongren Wanshan Danfeng Cinnabar Handicraft Research And Development Detection Identification Center Co ltd
Original Assignee
Tongren Wanshan Danfeng Cinnabar Handicraft Research And Development Detection Identification Center Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tongren Wanshan Danfeng Cinnabar Handicraft Research And Development Detection Identification Center Co ltd filed Critical Tongren Wanshan Danfeng Cinnabar Handicraft Research And Development Detection Identification Center Co ltd
Priority to CN201710399940.6A priority Critical patent/CN107204022B/en
Publication of CN107204022A publication Critical patent/CN107204022A/en
Application granted granted Critical
Publication of CN107204022B publication Critical patent/CN107204022B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Numerical Control (AREA)
  • Image Processing (AREA)

Abstract

The invention provides a method for acquiring a processing path according to a processing curve, which comprises the following steps: firstly, obtaining a curve: acquiring a curve path to be processed from an incoming parameter in a function calling mode from a system; curve decoding: projecting a curve path to be processed into a plane coordinate system, and decoding the curve path into a coordinate point set of the plane coordinate system in sequence; ③ segmenting the curve: dividing the set of coordinate points into a plurality of coordinate subsets based on differences between adjacent coordinate points; fourthly, generating section by section: performing linear fitting on each coordinate subset to obtain a plurality of fitting curves; synthesizing the path. The invention provides sufficient premise for the technical realization of automatically generating the operation codes before the machining starts by a mode of obtaining the machining path by section-by-section processing, so that the technical realization of automatically generating the operation codes before the machining starts becomes possible.

Description

Method for acquiring machining path according to machining curve
Technical Field
The invention relates to a method for acquiring a machining path according to a machining curve.
Background
For the design of the self-designed cinnabar artware, after the design is generally finished, the cinnabar artware can only be processed step by referring to a drawing by a special technician, and an operation code for automatic processing cannot be directly generated.
Disclosure of Invention
In order to solve the technical problems, the invention provides a method for acquiring a processing path according to a processing curve, which acquires the processing path by processing segment by segment, provides sufficient premise for the technical realization of automatically generating an operation code before the processing starts, and enables the technical realization of automatically generating the operation code before the processing starts.
The invention is realized by the following technical scheme.
The invention provides a method for acquiring a processing path according to a processing curve, which comprises the following steps:
firstly, obtaining a curve: acquiring a curve path to be processed from an incoming parameter in a function calling mode from a system;
curve decoding: projecting a curve path to be processed into a plane coordinate system, and decoding the curve path into a coordinate point set of the plane coordinate system in sequence;
③ segmenting the curve: dividing the set of coordinate points into a plurality of coordinate subsets based on differences between adjacent coordinate points;
fourthly, generating section by section: performing linear fitting on each coordinate subset to obtain a plurality of fitting curves;
synthesizing path: and arranging the fitted curves into a processing curve path set in sequence, and returning data by taking the processing curve path set as a function.
The curve path to be processed obtained in the first step is an RGB pixel map;
in the second step, during decoding, for each unit pixel point, the coordinate of the center position of the image-taking pixel point is the coordinate of the unit pixel point.
The third step includes the following steps:
3.1: reading a difference value set value from the parameter table, and setting a first coordinate point as a current coordinate point;
3.2: calculating a coordinate difference value between the current coordinate point and the next coordinate point until no next coordinate point exists in the coordinate point set;
3.3: calculating the difference between each coordinate difference value and the next coordinate difference value, and if the calculated difference value is greater than a difference value set value, marking the current coordinate point corresponding to the coordinate difference value as a breakpoint;
3.4: taking the next coordinate point as the current coordinate point, returning to the step 3.2, and entering the next step if the next coordinate point does not exist in the coordinate point set;
3.5: and taking the first coordinate point as a starting point and the breakpoint as an ending point, adding all coordinate points between the starting point and the ending point into a first coordinate subset, then taking the next coordinate point of each breakpoint as the starting point, taking the breakpoint or the last coordinate point as the ending point, and respectively adding all coordinate points between the starting point and the ending point of each segment into the coordinate subset in sequence.
In the fourth step, linear fitting adopts a quadratic equation of one element as a linear model.
And packaging the first step to the fifth step into a C language function library.
In the second step, the first point in the order of the coordinate point set is the first point from the bottom to the top on the leftmost side.
The invention has the beneficial effects that: the mode of obtaining the processing path by section processing provides sufficient premise for the technical realization of automatically generating the operation codes before the processing starts, so that the technical realization of automatically generating the operation codes before the processing starts becomes possible.
Drawings
FIG. 1 is a schematic flow diagram of the present invention.
Detailed Description
The technical solution of the present invention is further described below, but the scope of the claimed invention is not limited to the described.
A method for obtaining a machining path according to a machining curve as shown in fig. 1 includes the following steps:
firstly, obtaining a curve: acquiring a curve path to be processed from an incoming parameter in a function calling mode from a system;
curve decoding: projecting a curve path to be processed into a plane coordinate system, and decoding the curve path into a coordinate point set of the plane coordinate system in sequence;
③ segmenting the curve: dividing the set of coordinate points into a plurality of coordinate subsets based on differences between adjacent coordinate points;
fourthly, generating section by section: performing linear fitting on each coordinate subset to obtain a plurality of fitting curves;
synthesizing path: and arranging the fitted curves into a processing curve path set in sequence, and returning data by taking the processing curve path set as a function.
The curve path to be processed obtained in the first step is an RGB pixel map;
in the second step, during decoding, for each unit pixel point, the coordinate of the center position of the image-taking pixel point is the coordinate of the unit pixel point.
The third step includes the following steps:
3.1: reading a difference value set value from the parameter table, and setting a first coordinate point as a current coordinate point;
3.2: calculating a coordinate difference value between the current coordinate point and the next coordinate point until no next coordinate point exists in the coordinate point set;
3.3: calculating the difference between each coordinate difference value and the next coordinate difference value, and if the calculated difference value is greater than a difference value set value, marking the current coordinate point corresponding to the coordinate difference value as a breakpoint;
3.4: taking the next coordinate point as the current coordinate point, returning to the step 3.2, and entering the next step if the next coordinate point does not exist in the coordinate point set;
3.5: and taking the first coordinate point as a starting point and the breakpoint as an ending point, adding all coordinate points between the starting point and the ending point into a first coordinate subset, then taking the next coordinate point of each breakpoint as the starting point, taking the breakpoint or the last coordinate point as the ending point, and respectively adding all coordinate points between the starting point and the ending point of each segment into the coordinate subset in sequence.
In the fourth step, linear fitting adopts a quadratic equation of one element as a linear model.
And packaging the first step to the fifth step into a C language function library.
In the second step, the first point in the order of the coordinate point set is the first point from the bottom to the top on the leftmost side.
In practice, even if the accuracy is higher in the previous image recognition process, only a graph is obtained, and a regular curve which is not operable by the processing equipment is obtained, so that in order to realize automatic code generation, the curve of the image must be firstly processed into a processing path, namely, a regular curve.
On the other hand, in order to ensure the original concept of the highly reduced artwork processing highly reduced designer, high-precision image acquisition is required during image recognition, but the computing capability of the processing equipment is limited, and the computing efficiency is seriously affected due to too many pixel points in the high-precision image, so that the high-precision graph needs to be converted into a processing path with lower computing requirement, namely a regular curve.
The steps adopted by the invention can well solve the problem of processing the curve of the image into a regular curve.

Claims (5)

1. A method of obtaining a machining path from a machining curve, comprising: the method comprises the following steps:
firstly, obtaining a curve: acquiring a curve path to be processed from an incoming parameter in a function calling mode from a system;
curve decoding: projecting a curve path to be processed into a plane coordinate system, and decoding the curve path into a coordinate point set of the plane coordinate system in sequence; during decoding, for each unit pixel point, the coordinate of the central position of the image-taking pixel point is the coordinate of the unit pixel point;
③ segmenting the curve: dividing the set of coordinate points into a plurality of coordinate subsets based on differences between adjacent coordinate points;
fourthly, generating section by section: performing linear fitting on each coordinate subset to obtain a plurality of fitting curves;
synthesizing path: arranging the fitted curves into a processing curve path set in sequence, and taking the processing curve path set as a function to return data;
the third step includes the following steps:
3.1: reading a difference value set value from the parameter table, and setting a first coordinate point as a current coordinate point;
3.2: calculating a coordinate difference value between the current coordinate point and the next coordinate point until no next coordinate point exists in the coordinate point set;
3.3: calculating the difference between each coordinate difference value and the next coordinate difference value, and if the calculated difference value is greater than a difference value set value, marking the current coordinate point corresponding to the coordinate difference value as a breakpoint;
3.4: taking the next coordinate point as the current coordinate point, returning to the step 3.2, and entering the next step if the next coordinate point does not exist in the coordinate point set;
3.5: and taking the first coordinate point as a starting point and the breakpoint as an ending point, adding all coordinate points between the starting point and the ending point into a first coordinate subset, then taking the next coordinate point of each breakpoint as the starting point, taking the breakpoint or the last coordinate point as the ending point, and respectively adding all coordinate points between the starting point and the ending point of each segment into the coordinate subset in sequence.
2. The method of claim 1 for obtaining a machining path from a machining curve, comprising: the curve path to be processed obtained in the step (i) is an RGB pixel map.
3. The method of claim 1 for obtaining a machining path from a machining curve, comprising: in the fourth step, linear fitting adopts a quadratic equation of one element as a linear model.
4. The method of claim 1 for obtaining a machining path from a machining curve, comprising: and packaging the first step to the fifth step into a C language function library.
5. The method of claim 1 for obtaining a machining path from a machining curve, comprising: in the second step, the first point in the order of the coordinate point set is the first point from the bottom to the top on the leftmost side.
CN201710399940.6A 2017-05-31 2017-05-31 Method for acquiring machining path according to machining curve Active CN107204022B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710399940.6A CN107204022B (en) 2017-05-31 2017-05-31 Method for acquiring machining path according to machining curve

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710399940.6A CN107204022B (en) 2017-05-31 2017-05-31 Method for acquiring machining path according to machining curve

Publications (2)

Publication Number Publication Date
CN107204022A CN107204022A (en) 2017-09-26
CN107204022B true CN107204022B (en) 2021-01-05

Family

ID=59906869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710399940.6A Active CN107204022B (en) 2017-05-31 2017-05-31 Method for acquiring machining path according to machining curve

Country Status (1)

Country Link
CN (1) CN107204022B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105652800A (en) * 2014-11-28 2016-06-08 发那科株式会社 Tool path curve generation method and tool path curve generation apparatus
CN106133628A (en) * 2014-03-26 2016-11-16 三菱电机株式会社 For determining the method and system in the path of the cutter of processing groove shapes

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7881556B2 (en) * 2007-10-10 2011-02-01 Himax Technologies Limited Method of image processing and device thereof
CN101957609B (en) * 2010-08-11 2012-12-19 北京数码大方科技有限公司 C-axis code generation method and device for multiple-section characteristic processing
CN104714477B (en) * 2015-03-13 2017-06-20 江俊逢 A kind of generation method of processed file planning system and processed file
CN105446269B (en) * 2016-01-15 2018-11-02 广东工业大学 Contour curve numerical control code generating method based on genetic algorithm and its numerically-controlled machine tool
CN106020120A (en) * 2016-07-29 2016-10-12 芜湖哈特机器人产业技术研究院有限公司 Method for generating G code by using image based on ios system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106133628A (en) * 2014-03-26 2016-11-16 三菱电机株式会社 For determining the method and system in the path of the cutter of processing groove shapes
CN105652800A (en) * 2014-11-28 2016-06-08 发那科株式会社 Tool path curve generation method and tool path curve generation apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
应用Auto CAD实现数控加工曲线拟合的研究;张国栋 等;《全国第十四届计算机科学及其在仪器仪表中的应用学术交流会论文集》;20011201;64-67 *

Also Published As

Publication number Publication date
CN107204022A (en) 2017-09-26

Similar Documents

Publication Publication Date Title
JP6710483B2 (en) Character recognition method for damages claim document, device, server and storage medium
AU2017302250A1 (en) Optical character recognition in structured documents
KR20170137170A (en) Method and apparatus for text image processing
US20200410688A1 (en) Image Segmentation Method, Image Segmentation Apparatus, Image Segmentation Device
US20200184682A1 (en) Object pose tracking method and apparatus
CN104239909A (en) Method and device for recognizing images
CN107369176B (en) System and method for detecting oxidation area of flexible IC substrate
CN110598333B (en) Determination method and device for light source position and electronic equipment
CN112529018A (en) Training method and device for local features of image and storage medium
CN104202448A (en) System and method for solving shooting brightness unevenness of mobile terminal camera
CN104200204A (en) Picture processing device and method
CN112560468A (en) Meteorological early warning text processing method, related device and computer program product
CN104077557B (en) A kind of method and apparatus obtaining card image
CN110991520A (en) Method and device for generating training sample
CN110867243B (en) Image annotation method, device, computer system and readable storage medium
US20220122281A1 (en) Depth information processing method, apparatus, and storage medium
CN107204022B (en) Method for acquiring machining path according to machining curve
TW201933179A (en) Image data retrieving method and image data retrieving device
CN116309963B (en) Batch labeling method and device for images, electronic equipment and storage medium
CN110580462B (en) Natural scene text detection method and system based on non-local network
US20150051724A1 (en) Computing device and simulation method for generating a double contour of an object
CN103793365A (en) Method for converting SVG image into Visio image
CN109697693B (en) Method for realizing operation based on big data space
CN108492345B (en) Data block dividing method based on scale transformation
CN113269153B (en) Form identification method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant