A kind of roughness calculation method on two-dimensional cutting surface, computer readable storage medium
And terminal
Technical field
The present invention relates to the fields that surface roughness in graphite machining calculates technology, and in particular to a kind of two-dimensional cutting
Roughness calculation method, computer readable storage medium and the terminal on surface.
Background technique
Graphite material is easy in the cutting process because local plastic deformation occurs, and cause the increase of surface roughness,
And then it is used for performance and generates certain negative effect.Therefore there is certain reality to the research of graphite machining roughness
Border meaning, existing research trend are processed piece surface using different cutting parameters, then in adopting experimentally
Roughness concentration is carried out to the piece surface after processing using measuring instrument, to obtain on the basis of many experiments optimal
Technological parameter.But cutting process is influenced by many variable factors simultaneously, this is excellent to graphite cutting technology parameter
Change experiment out tape and carry out very big difficulty, while this experimental method also needs to expend a large amount of money and time cost.
Summary of the invention
It is an object of the invention to provide a kind of efficient, accurate and inexpensive two dimension to overcome the shortcomings of existing technologies
Roughness calculation method, computer readable storage medium and the terminal of cutting surface, the purpose of the present invention pass through following technical side
Case is realized:
A kind of roughness calculation method on two-dimensional cutting surface, method the following steps are included:
(1) image on two-dimensional cutting surface is subjected to contour edge extraction;
(2) contour edge noise reduction is smoothly bonded by filtering;
(3) contour edge curve is digitized;
(4) profile middle line and contour edge curve matching;
(5) gauging surface roughness;
Wherein, by the digitized process of contour edge curve, first contour edge is plotted in polar coordinate system, carries out numerical value
Change, then choose profile, finally converts rectangular coordinate system for polar coordinate system.
Preferably, the process at two-dimensional cutting surface profile edge is extracted, first reading emulating image colour profile diagram, then will
Colored profile diagram is converted into profile grayscale image, then converts binary map for profile grayscale image, and segmentation contour finally extracts profile
Edge.
Preferably, contour edge process is extracted using the edge function in software Matlab, canny operator.
Preferably, the filtering of contour edge noise reduction is used into median filter method.
Preferably, profile middle line and contour edge curve fitting process, by the profile side of profile middle line and selected range
Edge curve is drawn in the same rectangular co-ordinate and fastens.
Preferably, profile middle line in Matlab by using least square method to determine its position.
Preferably, gauging surface roughness process asks the mean absolute error i.e. surface of contour curve and profile middle line thick
Rugosity.
Preferably, filtering carries out intermediate value filter according to the size of the degree selection filter window of noise jamming in data
Wave, noise jamming is strong, then the filter window selected is also big;Noise jamming is weak, then filter window is small.
Preferably, profile grayscale image is before carrying out binaryzation, and degree of comparing stretches enhancing processing, to improve image clearly
Degree,
And then it promotes roughness and calculates reliability.
A kind of computer readable storage medium is stored with computer program, when the computer program is executed by processor
The step of realizing the roughness calculation method on above-described two-dimensional cutting surface.
A kind of terminal, comprising: memory, processor and be stored on the memory and can run on the processor
Computer program, when the computer program is executed by the processor realize the process described above the step of.
Beneficial effects of the present invention: the contour curve after median filtering is plotted on polar coordinates by the present invention, is convenient for
Profile is chosen within the scope of 360 °;Contours extract in graphite cutting process simulation picture is come out, then is quantized, more
Convenient for the processing on mathematical angle;Contour curve is filtered, exceptional data point is removed, keeps calculated result more reliable
Property;
The roughness calculation method on this two-dimensional cutting surface provided by the invention, the method for passing through field experiment with the prior art
It compares, the influence of factor can not be surveyed by avoiding many other of cutting process, by directly to stabilization, reliable cutting simulation image
Roughness calculate, without devoting considerable time, energy and money under the premise of provide it is a kind of efficient, accurate and inexpensive
Graphite Cutting Process parameter optimization approach.
Detailed description of the invention
Invention is described further using attached drawing, but the embodiments in the accompanying drawings do not constitute any limitation to the present invention,
For those of ordinary skill in the art, without creative efforts, it can also be obtained according to the following drawings
Its attached drawing.
Fig. 1 is a kind of flow chart of the roughness calculation method on two-dimensional cutting surface.
Fig. 2 is graphite two-dimensional cutting grayscale image.
Fig. 3 is segmentation contour binary map.
Fig. 4 is contour edge extraction figure.
Fig. 5 is contour edge numeralization polar diagram.
Fig. 6 is that surface roughness calculates rectangular coordinate system figure.
Specific embodiment
The invention will be further described with the following Examples, a kind of roughness on two-dimensional cutting surface of the present embodiment
Calculation method calculates software by a emulating image surface roughness based on Matlab exploitation to realize.The present embodiment is answered
It is easy to user with GUI in Maltab R2015a (Graphical Us-er Interfaces, GUI) exploitation Environment Design to hand over
Mutual graphical interfaces, and the call back function by writing control, achievable graphite cutting simulation getImage is located in advance in interface
Reason, image outline extracts and digitlization, system initialization, surface roughness calculate and all operations of the detection process such as output.
And calculated result is compared with roughmeter (TR100S) actual measured results, verify the feasibility of calculation method.
Software main interface mainly includes " Loading Image ", and " calculating roughness " and " initialization " (system calibrating) function are pressed
Button." Loading Image " button, for being loaded into the emulation picture for needing gauging surface roughness;" calculating roughness " button,
It is shown on interface for calculating the surface roughness of the picture for the system that is already loaded into, and by the picture being related in the process, most
Calculated result is shown on interface afterwards.The wherein image polar coordinates range of the adjustable load of Xmin and Xmax button, it is convenient
The data of imaging surface profile are extracted, Xmin value is inputted and Xmax value is used to select the range of contour curve in polar coordinates, generally
Select top profile.Complete to click " calculate roughness " button after image load and Coordinate Adjusting, system background program automatically into
Row operation original image is converted into profile diagram, median filtering, contour curve digitlization, generates evaluation reference line, and is shown by image
Out, last to obtain calculated result.Wherein, the original image display box on interface, for showing the emulation picture of loaded system,
It is only able to display one, if the emulation picture of change loading system, this display box can also follow automatic change;Profile diagram display box,
For showing the profile successfully extracted;Profile polar diagram display box, is plotted on polar coordinates with by the profile of specified range
And it here it is shown that is shown in frame;Profile rectangular plots display box is plotted in rectangular co-ordinate with by the profile of specified range
Above and here it is shown that being shown in frame.
As shown in Figure 1, its calculation method the following steps are included:
(1) emulating image colour profile diagram is read first;As shown in Fig. 2, converting profile grayscale image for the colored profile diagram;
As shown in figure 3, converting binary map for the profile grayscale image again, and profile in the binary map is split;Such as Fig. 4 institute
Show, extracts contour edge;
(2) the contour edge noise reduction is smoothly bonded by filtering, removes exceptional data point, keeps calculated result more reliable
Property;
(3) it as shown in figure 5, the contour edge is plotted in polar coordinate system, quantizes, chooses profile, it will
The polar coordinate system is converted into rectangular coordinate system;
(4) as shown in fig. 6, the contour edge curve of profile middle line and the selected range is drawn in the same rectangular coordinate system
On;
(5) the contour edge curve of the selected range and the mean absolute error of profile middle line are calculated.
Preferably, profile grayscale image is before carrying out binaryzation, and degree of comparing stretches enhancing processing, to improve image clearly
Degree,
And then it promotes roughness and calculates reliability.
Preferably, the contour edge noise reduction is smoothly bonded using the method for median filtering.
Preferably, filtering carries out intermediate value filter according to the size of the degree selection filter window of noise jamming in data
Wave, noise jamming is strong, then the filter window selected is also big;Noise jamming is weak, then filter window is small.
Preferably, the contour edge process of extracting is using the edge function in software Matlab, canny operator.
Preferably, the profile middle line in Matlab by using least square method to determine its position.
Mean absolute error, that is, surface roughness of gained contour curve and least squares.
The present embodiment comes out the contours extract in graphite cutting process simulation picture, then quantizes, and is more convenient for
Processing on mathematical angle;Contour curve after median filtering is plotted on polar coordinates, convenient for choosing wheel within the scope of 360 °
Wide range;
The roughness calculation method on this two-dimensional cutting surface provided in this embodiment, avoid cutting process it is many other can not
The influence of survey factor is calculated by the roughness directly to stabilization, reliable cutting simulation image, without when putting into a large amount of
Between, a kind of efficient, accurate and inexpensive graphite Cutting Process parameter optimization approach is provided under the premise of energy and money.
The present embodiment also provides a kind of computer readable storage medium, is stored with computer program, the computer program
The step of roughness calculation method on above-described two-dimensional cutting surface is realized when being executed by processor.
The present embodiment also provides a kind of terminal, comprising: memory, processor and is stored on the memory and can be in institute
The computer program run on processor is stated, the computer program realizes the process described above when being executed by the processor
The step of.
Finally it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than the present invention is protected
The limitation of range is protected, although explaining in detail referring to preferred embodiment to the present invention, those skilled in the art are answered
Work as understanding, it can be with modification or equivalent replacement of the technical solution of the present invention are made, without departing from the reality of technical solution of the present invention
Matter and range.