CN109087370A - A kind of spongy defect image generation method of casting - Google Patents

A kind of spongy defect image generation method of casting Download PDF

Info

Publication number
CN109087370A
CN109087370A CN201810697178.4A CN201810697178A CN109087370A CN 109087370 A CN109087370 A CN 109087370A CN 201810697178 A CN201810697178 A CN 201810697178A CN 109087370 A CN109087370 A CN 109087370A
Authority
CN
China
Prior art keywords
image
random
skeleton
spongy
defect
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.)
Granted
Application number
CN201810697178.4A
Other languages
Chinese (zh)
Other versions
CN109087370B (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.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
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 South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN201810697178.4A priority Critical patent/CN109087370B/en
Publication of CN109087370A publication Critical patent/CN109087370A/en
Application granted granted Critical
Publication of CN109087370B publication Critical patent/CN109087370B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation

Abstract

The invention discloses a kind of spongy defect image generation methods of casting, comprising steps of (1) generates spongy defect skeleton image at random, step is first to define an initial scaffold, then branched backbone is generated according to preset skeleton number at random, determine the datum curve of skeleton, then each skeleton generates offset compared to the datum curve at random, sets initial gray at random for all skeletons;Random offset certain distance between uplink and downlink in every skeleton, gray scale adjusts a difference at random between uplink and downlink;(2) skeleton image is filtered;(3) superimposed noise in image after the filtering;(4) by the image superposition to casting image after addition noise, spongy defect image is obtained.The method of the present invention, which generates defect, has diversity, and shape, size can be by state modulators, and have certain randomness, and image effect is closer to true picture, by the human eye subjective judgement of expert, can have been received as defect image sample.

Description

A kind of spongy defect image generation method of casting
Technical field
The present invention relates to defect image generation technique field, in particular to a kind of spongy defect image generation side of casting Method.
Background technique
In the actual production of casting, although substantially reducing defect rate by improving the approach such as casting technique and material, But rejected casting cannot be completely eliminated, it is still desirable to all detect to each cast article internal flaw, just can guarantee The quality of factory product.
Automation defects detection becomes the demand of casting industry gradually at present, and a good detection algorithm generally requires greatly The defect sample of amount is trained and tests, and low defect rate can make the more difficult a large amount of collections of some defect sample, can largely generate The algorithm of emulating image similar with real defect becomes the important solutions for increasing sample size.Very due to casting defect type It is more, such as shrinkage porosite, be mingled with, be bubble, spongy, the method that every kind of defect generates is all different.Wherein, spongy defect is state One of casting flaw type defined in the standard of border is not closely knit enough the material contracting for forming similar sponge shape of material after casting Pine, shape and stomata and crackle difference are very big.
There are two main classes for defect image generation method at present, and one kind is to be calculated based on CAD software according to attenuation coefficient The depth map of casting perspective out, i.e., go out the perspective view of defect according to the Strength co-mputation of radiation absorption.Since there are poles for defect shape Big arbitrariness and randomness, this method needs the shape of artificial pre-defined defect, further according to the suction of shape measuring and calculating ray Intensity is received, therefore the shape for being equivalent to each defect need to be gone out by engineer, this will greatly limit to this method and largely generate Shape has the application of random variation characteristic.Another kind is based on the radioscopic image signature analysis to defect, with different from vector The nonparametric method that image calculates generates a variety of characteristic features of defect, then by way of Fusion Features and background fusion, Defect image is finally generated on workpiece.But the generally existing form of defect image obtained in this way at present is more single One, image effect and the larger problem of true picture gap, cannot be identified as training and test of the sample for subsequent algorithm.
For this purpose, the generation of spongy defect image can be fast implemented by studying one kind, and keep the defect generated more true Method has important research significance and practical value.
Summary of the invention
The purpose of the present invention is to overcome the shortcomings of the existing technology and deficiency, and it is raw to provide a kind of spongy defect image of casting At method, this method, which generates defect, has diversity, and shape, size can be by state modulators, and have certain randomness, And image effect is closer to true picture, by the human eye subjective judgement of expert, can receive for defect map it is decent This.
The purpose of the present invention is realized by the following technical solution: a kind of spongy defect image generation method of casting, packet Include step:
(1) spongy defect skeleton image is generated at random, and step is first to define an initial scaffold, then according to preset bone Frame number generates branched backbone at random, determines the datum curve of skeleton, and then each skeleton is random compared to the datum curve Offset is generated, sets initial gray at random for all skeletons;Random offset certain distance between uplink and downlink in every skeleton, on Gray scale adjusts a difference at random between downlink;
(2) skeleton image is filtered;
(3) superimposed noise in image after the filtering;
(4) by the image superposition to casting image after addition noise, spongy defect image is obtained.
Preferably, in the step (1), initial scaffold length is defined, i.e., skeleton is in the number of pixels longitudinally embodied;At random The branched backbone length of generation is less than or equal to 1/10th of initial scaffold length.To can more construct the effect of branch.
Preferably, in the step (1), if each skeleton generates offset b compared to datum curve at randomi(1), should Offset is the difference of initial position and datum curve in the abscissa of same a line, and value range is-L1/ 10 arrive L1Between/10 Integer, L1Indicate initial scaffold length, i.e., the origin coordinates of i-th branched backbone is (xyi+bi(1), yi), wherein xyiOn the basis of Curve is in yiCapable abscissa, yiIndicate the starting ordinate of i-th branched backbone.
Preferably, in order to guarantee the authenticity of image, next line offset is the offset of its lastrow in the every skeleton For amount plus the random integers between-a m1 to m2, gray scale is also lastrow gray scale plus random between-a n1 to n2 Integer.M1, m2, n1, n2 herein is empirical value, can be comprehensive according to the shape of defect, size, gray scale etc. in current acquired image It closes and considers to obtain.
Preferably, in the step (2), the characteristics of according to spongy defect image, gaussian filtering is carried out to skeleton image.
Preferably, in the step (3), according to the non-zero pixels position of filtered image, random Berlin noise pattern is generated Then noise image is added on filtered image by picture, the image after obtaining addition noise.
Further, after the progress gaussian filtering to skeleton image, in order to control the gray scale of image, make image superposition As a result more like actual defects, the gray value of filtered image is mapped to 0 between G, random Berlin noise image is mapped to 0 To between a, then the two images after mapping are overlapped, the image after obtaining addition noise.G, a herein is experience Value, can be set according to the feature of currently practical image.
Preferably, in the step (4), superposed positions are first selected on casting image, then by the figure after addition noise As the above-mentioned position that is added to again after carrying out the rotation of certain angle.
Compared with the prior art, the invention has the following advantages and beneficial effects:
1, in generating spongy defect skeleton process, shape, size can be controlled directly by parameter the present invention, Also there is certain randomness simultaneously, so that generating defect has diversity, do not depended in terms of gray scale or other geometries Actual defects sample.
2, the characteristics of present invention is for the spongy defect skeleton and practical casting spongy defect image generated, selects Be further processed mode using what gaussian filtering and Berlin noise combined, treated image and true picture more closely, By the human eye subjective judgement of expert, can receive as defect image sample.
3, then the present invention is filtered and the processing mode of plus noise by building skeleton, and operand is small, generates sample This speed is quickly.
Detailed description of the invention
Fig. 1 is the flow chart that the present embodiment generates the spongy defect image of casting.
Fig. 2 is the datum curve figure that the present embodiment generates.
Fig. 3 is the spongy defect skeleton drawing that the present embodiment generates at random.
Fig. 4 is that the present embodiment carries out the figure after gaussian filtering to skeleton.
Fig. 5 is Berlin noise pattern that the present embodiment generates at random.
Fig. 6 is the spongy defect map that the present embodiment generates.
Fig. 7 is the comparison diagram of the spongy defect map that the present embodiment generates and practical spongy defect map.
Specific embodiment
The attached figures are only used for illustrative purposes and cannot be understood as limitating the patent;In order to better illustrate this embodiment, attached Scheme certain components to have omission, zoom in or out, does not represent the size of actual product;To those skilled in the art, The omitting of some known structures and their instructions in the attached drawings are understandable.The present invention is made below with reference to examples and drawings Further detailed description, embodiments of the present invention are not limited thereto.
Embodiment
As shown in Figure 1, a kind of spongy defect image generation method of casting of the present embodiment, comprising the following steps:
One, spongy defect skeleton image is generated at random.
In the present embodiment the characteristics of defect image spongy according to practical casting, a spongy defect skeleton is constructed, it is subsequent The generation of defect image is carried out on the basis of this skeleton.The skeleton is maximum innovative point of the invention, the specific steps are as follows:
(1) suitable skeleton number N is selected, initial scaffold can be used as by first, remaining is as branched backbone, this reality Apply the random number between N takes 40 to 80 in example.
(2) initial scaffold length L is determined1, i.e., initial scaffold is in the number of pixels longitudinally embodied.The present embodiment L1=400.
(3) the starting ordinate y of all branched backbones is generated at randomiAnd length Li.Branched backbone is long in the present embodiment Degree is less than or equal to 1/10th of initial scaffold length.
(4) datum curve that skeleton is drawn according to the actual conditions of application can be one section of camber line as shown in Fig. 2, can also be with It is arbitrary curve section or straightway.
(5) the start offset amount b of all skeletons is generated at randomi(1), which is initial position and datum curve same The difference of the abscissa of a line, value range are-L1/ 10 arrive L1Integer between/10.The origin coordinates of i.e. i-th skeleton is (xyi+bi(1), yi), wherein for xyiDatum curve is in yiCapable abscissa.
(6) initial gray a is set at random for all skeletonsi(1), i.e., (x in imageyi+bi(1), yi) pixel gray scale.
(7) all skeletons are drawn line by line from top to bottom, i-th skeleton next line offset is that its lastrow offset adds Random integers between one -2 to 2, gray scale are also lastrow gray scale plus the random integers between one -10 to 10.Most The spongy defect skeleton image result drawn afterwards is as shown in Figure 3.
Two, skeleton image is filtered.
In the present embodiment, gaussian filtering is carried out to spongy defect skeleton image, as shown in figure 4, and reflecting its gray value It is mapped between 0 to 20.
Three, superimposed noise in image after the filtering.
According to the non-zero pixels position of filtered image, random Berlin noise image is generated, as shown in Figure 5.Then it will make an uproar Acoustic image is mapped between 0 to 5, is added on filtered image, the image after addition noise shown in fig. 6 can be obtained.
Four, by the image rotation proper angle after addition noise, then adduction is added on the suitable position of casting image, Spongy defect image can be obtained.
It include the spongy defect map and practical spongy defect map that the present embodiment generates in Fig. 7, by the two Comparison, it is seen that the spongy defect map and practical spongy defect generated using the present embodiment method relatively, can be by Regard as training and test of the sample for subsequent algorithm.
The above embodiment is a preferred embodiment of the present invention, but embodiments of the present invention are not by above-described embodiment Limitation, other any changes, modifications, substitutions, combinations, simplifications made without departing from the spirit and principles of the present invention, It should be equivalent substitute mode, be included within the scope of the present invention.

Claims (8)

1. a kind of spongy defect image generation method of casting, which is characterized in that comprising steps of
(1) spongy defect skeleton image is generated at random, and step is first to define an initial scaffold, then according to preset skeleton number Mesh generates branched backbone at random, determines the datum curve of skeleton, and then each skeleton generates at random compared to the datum curve Offset sets initial gray for all skeletons at random;Random offset certain distance, uplink and downlink between uplink and downlink in every skeleton Between gray scale adjust a difference at random;
(2) skeleton image is filtered;
(3) superimposed noise in image after the filtering;
(4) by the image superposition to casting image after addition noise, spongy defect image is obtained.
2. the spongy defect image generation method of casting according to claim 1, which is characterized in that in the step (1), Initial scaffold length is defined, i.e., skeleton is in the number of pixels longitudinally embodied;The branched backbone length generated at random is less than or equal to just / 10th of beginning backbone length.
3. the spongy defect image generation method of casting according to claim 1, which is characterized in that in the step (1), If each skeleton generates offset b compared to datum curve at randomi(1), which is that initial position and datum curve exist With the difference of the abscissa of a line, value range is-L1/ 10 arrive L1Integer between/10, L1Indicate initial scaffold length, i.e., the The origin coordinates of i branched backbone is (xyi+bi(1),yi), wherein xyiIt is benchmark curve in yiCapable abscissa, yiIndicate the The starting ordinate of i branched backbone.
4. the spongy defect image generation method of casting according to claim 1, which is characterized in that in the every skeleton Next line offset is its lastrow offset plus the random integers between-a m1 to m2, and gray scale is also lastrow ash Degree is plus the random integers between-a n1 to n2.
5. the spongy defect image generation method of casting according to claim 1, which is characterized in that in the step (2), Gaussian filtering is carried out to skeleton image.
6. the spongy defect image generation method of casting according to claim 5, which is characterized in that in the step (3), According to the non-zero pixels position of filtered image, random Berlin noise image is generated, then noise image is added to after filtering Image on image, after obtaining addition noise.
7. the spongy defect image generation method of casting according to claim 6, which is characterized in that described to skeleton image After carrying out gaussian filtering, the gray value of filtered image is mapped to 0 between G, random Berlin noise image is mapped to 0 and is arrived Between a, then the two images after mapping are overlapped, the image after obtaining addition noise.
8. the spongy defect image generation method of casting according to claim 1, which is characterized in that in the step (4), Superposed positions are first selected on casting image, are added to again then the image after addition noise to be carried out to the rotation of certain angle after Above-mentioned position.
CN201810697178.4A 2018-06-29 2018-06-29 Method for generating spongy defect image of casting Active CN109087370B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810697178.4A CN109087370B (en) 2018-06-29 2018-06-29 Method for generating spongy defect image of casting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810697178.4A CN109087370B (en) 2018-06-29 2018-06-29 Method for generating spongy defect image of casting

Publications (2)

Publication Number Publication Date
CN109087370A true CN109087370A (en) 2018-12-25
CN109087370B CN109087370B (en) 2020-10-27

Family

ID=64834803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810697178.4A Active CN109087370B (en) 2018-06-29 2018-06-29 Method for generating spongy defect image of casting

Country Status (1)

Country Link
CN (1) CN109087370B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110223277A (en) * 2019-05-28 2019-09-10 深圳新视智科技术有限公司 Method, apparatus, terminal device and the storage medium that image generates
CN110689477A (en) * 2019-09-07 2020-01-14 创新奇智(重庆)科技有限公司 Universal flaw image simulation method
CN111429411A (en) * 2020-03-16 2020-07-17 东南大学 Method for generating X-ray defect image sample of carbon fiber composite core wire
CN113643406A (en) * 2021-08-12 2021-11-12 北京的卢深视科技有限公司 Image generation method, electronic device, and computer-readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070265091A1 (en) * 2006-04-25 2007-11-15 Aguilar Jr Maximino Method to generate virtual world event notifications from within a persistent world game
CN106530267A (en) * 2016-11-30 2017-03-22 长沙全度影像科技有限公司 Fusion method for avoiding panoramic picture misalignment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070265091A1 (en) * 2006-04-25 2007-11-15 Aguilar Jr Maximino Method to generate virtual world event notifications from within a persistent world game
CN106530267A (en) * 2016-11-30 2017-03-22 长沙全度影像科技有限公司 Fusion method for avoiding panoramic picture misalignment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
汪玉琳: "基于语义描述的铸造缺陷图像生成研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
詹银燕: "基于定性视觉特征语义描述的裂纹缺陷仿真", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110223277A (en) * 2019-05-28 2019-09-10 深圳新视智科技术有限公司 Method, apparatus, terminal device and the storage medium that image generates
CN110689477A (en) * 2019-09-07 2020-01-14 创新奇智(重庆)科技有限公司 Universal flaw image simulation method
CN110689477B (en) * 2019-09-07 2023-01-10 创新奇智(重庆)科技有限公司 Universal flaw image simulation method
CN111429411A (en) * 2020-03-16 2020-07-17 东南大学 Method for generating X-ray defect image sample of carbon fiber composite core wire
CN111429411B (en) * 2020-03-16 2023-04-25 东南大学 X-ray defect image sample generation method for carbon fiber composite core wire
CN113643406A (en) * 2021-08-12 2021-11-12 北京的卢深视科技有限公司 Image generation method, electronic device, and computer-readable storage medium

Also Published As

Publication number Publication date
CN109087370B (en) 2020-10-27

Similar Documents

Publication Publication Date Title
CN109087370A (en) A kind of spongy defect image generation method of casting
CN103955905B (en) Based on the single image to the fog method that fast wavelet transform and weighted image merge
CN109214990A (en) A kind of depth convolutional neural networks image de-noising method based on Inception model
CN109118435A (en) A kind of depth residual error convolutional neural networks image de-noising method based on PReLU
CN109615611A (en) A kind of insulator self-destruction defect inspection method based on inspection image
CN109300090A (en) A kind of single image to the fog method generating network based on sub-pix and condition confrontation
CN103295191A (en) Multi-scale vision self-adaptation image enhancing method and evaluating method
CN105095581B (en) A kind of casting shrinking hole defect image generation method
CN111179189A (en) Image processing method and device based on generation countermeasure network GAN, electronic equipment and storage medium
CN108022223A (en) A kind of tone mapping method based on the processing fusion of logarithmic mapping function piecemeal
CN106691505B (en) Method and device for processing uniformity and contrast of ultrasonic image
CN105913451B (en) A kind of natural image superpixel segmentation method based on graph model
CN106709888A (en) High-dynamic-range image generation method based on human eye visual model
CN110060326A (en) A kind of model Texture Generating Approach based on generation confrontation network
CN114565537B (en) Infrared imaging device based on local information entropy
CN107403448A (en) Cost function generation method and cost function generating means
CN116310005A (en) Holographic cabinet, dynamic virtual image video processing method and image processing method
CN103700066B (en) Method for processing video image of portable night vision instrument
CN112002019B (en) Method for simulating character shadow based on MR mixed reality
CN108877902A (en) Ultrasound image brightness adjusting method and regulating system
CN108335287A (en) Information processing unit and information processing method
CN105072311B (en) The Infrared DIM-small Target Image sequence emulation mode of scan IR shake
CN109389629B (en) Method for determining stereo matching self-adaptive parallax grade
CN114093463A (en) System and method for image processing
JPH07175921A (en) Density converter

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