CN110264447A - A kind of detection method of surface flaw of moulding, device, equipment and storage medium - Google Patents

A kind of detection method of surface flaw of moulding, device, equipment and storage medium Download PDF

Info

Publication number
CN110264447A
CN110264447A CN201910465454.9A CN201910465454A CN110264447A CN 110264447 A CN110264447 A CN 110264447A CN 201910465454 A CN201910465454 A CN 201910465454A CN 110264447 A CN110264447 A CN 110264447A
Authority
CN
China
Prior art keywords
picture
moulding
detected
sample
obtains
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.)
Pending
Application number
CN201910465454.9A
Other languages
Chinese (zh)
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.)
Advanced Institute of Information Technology AIIT of Peking University
Hangzhou Weiming Information Technology Co Ltd
Original Assignee
Advanced Institute of Information Technology AIIT of Peking University
Hangzhou Weiming Information Technology 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 Advanced Institute of Information Technology AIIT of Peking University, Hangzhou Weiming Information Technology Co Ltd filed Critical Advanced Institute of Information Technology AIIT of Peking University
Priority to CN201910465454.9A priority Critical patent/CN110264447A/en
Publication of CN110264447A publication Critical patent/CN110264447A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • G01N2021/8893Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques providing a video image and a processed signal for helping visual decision
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The application provides detection method of surface flaw, device, equipment and the storage medium of a kind of moulding, is related to technical field of computer vision.The described method includes: the product picture of acquisition moulding;First pretreatment is carried out to product picture, obtains picture to be detected;The picture to be detected detected using detection model trained in advance, obtaining moulding surface whether there is the testing result of defect.In the technical solution, by the way that computer vision is combined with neural network in advance, training detection model, and picture to be detected is detected using the detection model, realizing moulding surface whether there is the quick and precisely detection of defect;The problem of not only solving the problem of current manual's visual inspection can lead to detection error because of extraneous factors such as the emotional changes of testing staff, also solving the low compatibility of traditional solution and new demand cannot be rapidly adapted to;And corporate training and management cost are reduced, it effectively avoids defect ware and comes into the market the problem of bringing loss to enterprise.

Description

A kind of detection method of surface flaw of moulding, device, equipment and storage medium
Technical field
This application involves technical field of computer vision more particularly to a kind of detection method of surface flaw of moulding, dress It sets, equipment and storage medium.
Background technique
By injection molding machine produce various injecting products be referred to as moulding, in the production process of moulding, often due to The reasons such as raw material selection, temperature setting, technological design, human error and generate surface defect, such as lack material (edge missing be one small Block), dent, scratch, current mark (ripple occurs in surface) etc..
Currently, the defect problem on moulding surface is searched by way of Manual Visual Inspection by most of enterprise, but artificial Visual inspection often generates deviation because of the influence of factors such as the conscientious degree of employee, mood, degree of fatigue, leads to missing inspection and mistake The case where inspection, occurs.The specific defect that Some Enterprises begin trying to measure after taking pictures by using industrial camera in image refers to Mark, for example, the length of scratch, the area of notch, surface the modes such as color search the defect problem on moulding surface;However it should In mode, when there is deviation in the position of moulding to be measured in the production line or ambient changes, measurement result It can change correspondingly;Meanwhile when a new Defect Search demand generates, staff needs to redesign for new defect Detection scheme, and repeated measurement is tested, it is time-consuming and laborious.
As it can be seen that how quickly and effectively to detect the surface defect of moulding, defect ware is avoided to come into the market, is still a need It solves the problems, such as.
Summary of the invention
In view of this, the application provides detection method of surface flaw, device, equipment and the storage medium of a kind of moulding, It is intended to be promoted the detection efficiency and accuracy of moulding surface defect.
To achieve the above object, the application first aspect provides a kind of defect inspection method of moulding, comprising:
Acquire the product picture of moulding;
First pretreatment is carried out to the product picture, obtains picture to be detected;
The picture to be detected is detected using detection model trained in advance, obtains the moulding surface with the presence or absence of scarce Sunken testing result.
Optionally, described that first pretreatment is carried out to the product picture, obtain picture to be detected, comprising:
Gray scale and binary conversion treatment are carried out to the product picture, obtain picture to be detected.
Optionally, described that gray scale and binary conversion treatment are carried out to product picture, obtain picture to be detected, comprising:
Separate the three primary colors of each pixel in the product picture;
The three primary colors of each pixel are weighted, the gray value of each pixel is obtained;
Judge whether the gray value is more than gray value threshold value;
If the determination result is YES, then the first preset value is set by corresponding pixel;
If judging result be it is no, set the second preset value for corresponding pixel.
Optionally, the method also includes:
The first sample picture of the tape label of moulding is obtained, the label includes for identifying the first sample picture Moulding whether there is defect;
Second pretreatment is carried out to the first sample picture, obtains the second samples pictures of tape label, second sample The label of this picture is identical as the label of corresponding first sample picture;
Second samples pictures are trained, the detection model is obtained.
Optionally, the second pretreatment is carried out to the first sample picture, obtains the second samples pictures of tape label, wrapped It includes:
Generate the deformation picture of the first sample picture, the label of the deformation picture and corresponding first sample picture Label it is identical;
Gray scale and binary conversion treatment are carried out to the deformation picture, obtain the second samples pictures.
Optionally, the deformation picture for generating the first sample picture, comprising:
According to default bias unit, each first sample picture is displaced, obtains the position of each first sample picture Move picture;
According to default rotation angle angle, each displacement picture is rotated, each first sample picture is obtained Rotating image;
According to pre-set zoom ratio, each rotating image is zoomed in and out, obtains the contracting of each first sample picture Put picture.
Optionally, second samples pictures are trained, obtain the detection model, comprising:
According to default division proportion, trained picture and test picture are divided into after second samples pictures are upset;
The trained picture is trained, initial model is obtained;
Using initial model described in the test chart built-in testing, the accuracy rate of the initial model is obtained;
When the accuracy rate is less than default accuracy rate, initial model is further trained;
When the accuracy rate is not less than default accuracy rate, using corresponding initial model as detection model.
To achieve the above object, the application second aspect provides a kind of defect detecting device of moulding, comprising:
Acquisition module, for acquiring the product picture of moulding;
First preprocessing module obtains picture to be detected for carrying out the first pretreatment to the product picture;
Detection module obtains the moulding for detecting the picture to be detected using detection model trained in advance Surface whether there is the testing result of defect.
To achieve the above object, the application third aspect provides a kind of electronic equipment, comprising: memory and processor;
It is stored with computer program on the memory, when the computer program is executed by the processor, is realized Method as described in the application first aspect.
To achieve the above object, the application fourth aspect provides a kind of computer readable storage medium, is stored thereon with meter Calculation machine program realizes the method as described in the application first aspect when the computer program is executed by processor.
In the technical solution of the application, by advance combining computer vision with neural network, detection model is obtained, And the first pretreatment is carried out to the product picture of the moulding of acquisition and obtains detection picture, to use detection model to figure to be detected Piece is detected, and realizing moulding surface whether there is the quick and precisely detection of defect;Which effective solution is current Manual Visual Inspection can be because of the problem of extraneous factors such as the emotional change of testing staff lead to detection error and traditional computer vision Low compatibility and the problem of new demand cannot be rapidly adapted to;Meanwhile corporate training and management cost are greatly reduced, effectively Defect ware is avoided to come into the market the problem of bringing loss to enterprise.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the application Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Attached drawing 1 is a kind of flow chart of the defect inspection method for moulding that some embodiments of the application provide;
Attached drawing 2 is the training process schematic diagram for the detection model that some embodiments of the application provide;
Attached drawing 3 is a kind of structural schematic diagram of the defect detecting device for moulding that some embodiments of the application provide;
Attached drawing 4 is the structural schematic diagram for a kind of electronic equipment that some embodiments of the application provide.
Specific embodiment
The illustrative embodiments of the disclosure are more fully described below with reference to accompanying drawings.Although showing this public affairs in attached drawing The illustrative embodiments opened, it being understood, however, that may be realized in various forms the disclosure without the reality that should be illustrated here The mode of applying is limited.It is to be able to thoroughly understand the disclosure on the contrary, providing these embodiments, and can be by this public affairs The range opened is fully disclosed to those skilled in the art.
Attached drawing 1 is a kind of flow chart of the detection method of surface flaw for moulding that some embodiments of the application provide, such as Shown in Fig. 1, the defect inspection method of moulding includes:
Step 101: acquiring the product picture of moulding;
Specifically, passing through the product picture that computer vision apparatus shoots moulding, wherein computer vision apparatus includes Light source, softbox, camera lens, industrial camera, controller etc..In the application, the various injecting products that injection molding machine produces are referred to as Moulding.In the production process of moulding, often due to raw material selection, temperature setting, technological design, human error etc. And surface defect is generated, such as edge missing, dent, scratch, current mark.By acquiring the product picture of moulding, subsequent By handling the product picture, obtaining the moulding that product picture includes whether there is the testing result of defect.
Step 102: the first pretreatment being carried out to the product picture of acquisition, obtains picture to be detected;
In some embodiments of the present application, step 102 includes: to carry out at gray scale and binaryzation to the product picture of acquisition Reason, obtains picture to be detected.
Further, gray scale and binary conversion treatment are carried out to the product picture of acquisition, obtain picture to be detected, comprising:
Step A1: the three primary colors of each pixel in the product picture of acquisition are separated;
Specifically, separating the value of three kinds of colors of red, green, blue of each pixel in the product picture of acquisition.
Step A2: being weighted the three primary colors of each pixel, obtains the gray value of each pixel;
Specifically, according to the weight of preset three kinds of colors of red, green, blue, to three kinds of face of red, green, blue of each pixel The value of color is weighted, and obtains the gray value of each pixel.Wherein, the weight of three kinds of colors of red, green, blue can be in reality Sets itself as needed in the application of border;For example, red weight is 0.3, green weight is 0.6, and blue weight is 0.11, the gray value of each pixel can be expressed as gray=0.3*r+0.6*g+0.11*b, wherein r is isolated red Value, g is the value of the green of separation, and b be the blue value of separation.
Step A3: whether the gray value for judging each pixel is more than gray value threshold value, if the determination result is YES, then will be right The pixel answered is set as the first preset value;If judging result be it is no, set the second preset value for corresponding pixel.
Wherein, gray value threshold value is the critical value of binaryzation, and the first preset value indicates that corresponding pixel is black, the Two preset values indicate that corresponding pixel is white.First preset value and the second preset value can in practical applications as needed Sets itself, for example, the first preset value is 1, the second preset value is 0.
Step 103: picture to be detected being detected using detection model trained in advance, obtains moulding surface with the presence or absence of scarce Sunken testing result.
In the application, computer vision is combined in advance with neural network, it is scarce to obtain having for the same position of moulding Sunken picture and do not have defective picture, and the picture of acquisition is trained, obtains detection model;The mapping to be checked that will be obtained Piece is input to the detection model and is detected, and obtaining moulding whether there is the testing result of defect.Wherein, the instruction of detection model Practice process to be described in detail later.
As a result, by advance combining computer vision with neural network, detection model, and the injection molding to acquisition are obtained The product picture of part carries out the first pretreatment and obtains detection picture, to be detected using detection model to detection picture, realizes Moulding whether there is the quick and precisely detection of defect;The current manual's visual inspection of which effective solution can because of testing staff The extraneous factors such as emotional change the problem of leading to detection error and the low compatibility of traditional computer vision and cannot quickly fit The problem of answering new demand;Meanwhile corporate training and management cost are greatly reduced, it effectively avoids defect ware and comes into the market The problem of bringing loss to enterprise.
Based on aforementioned any embodiment, in some embodiments of the present application, method further includes trained detection model;Specifically , training process schematic diagram as shown in Figure 2, including following operation:
Step B1: the first sample picture of the tape label of moulding is obtained, wherein label is for identifying first sample picture Including moulding whether there is defect;
Specifically, shooting the figure of the same position existing defects of moulding by computer vision apparatus such as industrial cameras Piece and picture there is no defect, and manually mark the moulding in each picture and whether there is the label of defect, obtain first Samples pictures.It should be pointed out that for for lack material moulding, lack material region background as far as possible it is pure not have it is variegated;It is right In the scratch, flow liner the defects of, it should be noted that reasonable polishing, it is ensured that defect can clearly reflect in the picture taken;Meanwhile when shooting It should be noted that keeping the angles and positions of moulding in every picture consistent or approximate as far as possible.
In some embodiments of the present application, to reduce the training time of subsequent detection model training, improving prediction accurately Rate can also mark " area-of-interest " in each first sample picture, be somebody's turn to do " area-of-interest " i.e. surface defect and often go out Existing place, the region other than " area-of-interest " can then be ignored in the training process.
Step B2: the second pretreatment is carried out to first sample picture, the second samples pictures of tape label are obtained, wherein second The label of samples pictures is identical as the label of corresponding first sample picture;
In some embodiments of the present application, step B2 includes:
Step B2-1: the deformation picture of first sample picture is generated, wherein the label of deformation picture and corresponding first sample The label of this picture is identical;
In some embodiments of the present application, step B2-1 includes:
Step C1: according to default bias unit, each first sample picture is displaced, obtains each first sample figure The displacement picture of piece;
Specifically, after each first sample picture is directed into coordinate system, according to preset offset coordinates mobile first Samples pictures obtain at least one displacement picture of each first sample picture.
For example, preset offset coordinates be (- 25, -25), (- 25, -24), (- 25, -23) ... (- 25 ,+25), (- 24, - 25), (- 24, -24), (- 24, -23) ... (- 24 ,+25), (- 23, -25), (- 23, -24), (- 23, -23) ... (- 23 ,+25) ... First sample picture is moved -25 pictures by (+25, -25), (+25, -24) (+25, -23) ... (+25 ,+25) etc. on transverse axis Element moves -25 pixels on longitudinal axis, obtains first displacement picture of first sample picture;By first sample picture in cross - 25 pixels are moved on axis, move -24 pixels on longitudinal axis, second displacement picture of first sample picture are obtained, with this Analogize, until first sample picture is moved+25 pixels on transverse axis, moves+25 pixels on longitudinal axis, obtain the first sample The last one displacement picture of this picture;Wherein, label and the label phase of corresponding first sample picture of each displacement picture Together, and it is denoted as original tag.
Step C2: according to default rotation angle angle, each displacement picture is rotated, each first sample picture is obtained Rotating image;
Specifically, each displacement picture is rotated around its central point, obtains each first sample according to preset rotation angle The rotating image of this picture.
Wherein, preset rotation angle can sets itself as needed in practical applications, such as rotation angle be- 5, some displacement picture is obtained corresponding first sample picture around -5 degree of its central point rotation by -4, -3 ...+4 ,+5 degree First rotating image obtains second of corresponding first sample picture by the displacement picture around -4 degree of its central point rotation Rotating image obtains the third rotation figure of corresponding first sample picture by the displacement picture around -3 degree of its central point rotation Piece, and so on, until the displacement picture is obtained last of corresponding first sample picture around+5 degree of its central point rotation A rotating image;Wherein, the label of each rotating image is identical as the label of corresponding first sample picture, and is denoted as original mark Label.
Step C3: according to pre-set zoom ratio, zooming in and out each rotating image, obtains each first sample picture Scaling pictures.
Specifically, point is to each rotating image on the basis of the central point of each rotating image according to pre-set zoom ratio Whole scaling is carried out, the scaling pictures of corresponding each first sample picture are obtained.
Wherein, pre-set zoom ratio can in practical applications, sets itself as needed;Such as pre-set zoom ratio is 0.90,0.91,0.92 ... 1.11, wherein the ratio less than 1 is diminution ratio, the ratio greater than 1 is magnification ratio, i.e., by some Rotating image reduces 0.90 times, obtains first diminution picture of corresponding first sample picture, which is reduced 0.91 times, second diminution picture of corresponding first sample picture is obtained, and so on, until the rotating image is expanded 1.11 times, obtain the last one amplification picture of corresponding first sample picture;Wherein, the label of each scaling pictures with it is corresponding First sample picture label it is identical, and be denoted as original tag.
By generating displacement picture, rotating image and the scaling pictures of each first sample picture, on the one hand effectively keep away Exempt to shoot the picture of the same position existing defects of moulding in use computer vision apparatus and there is no the pictures of defect During, cause moulding included by the picture of shooting to be subjected to displacement and light because of the swing of the mechanical arm of equipment The factors such as strong and weak difference, and cause trained detection model accuracy rate decline the problem of;So that the detection model that training obtains Mobile to the small range of moulding and light change has good compatibility.On the other hand, according to a small amount of first sample Picture generates the training sample that largely can be used as following model training, reduces the acquisition time of training sample.
Step B2-2: gray scale and binary conversion treatment are carried out to the deformation picture of generation, obtain the second samples pictures.
Specifically, carrying out gray scale and binary conversion treatment to each deformation picture of each first sample picture, and will processing Each picture afterwards is as the second samples pictures.Wherein, the process of gray scale and binary conversion treatment can be found in abovementioned steps A1 to step Process described in rapid A3, details are not described herein.
Step B3: the second samples pictures are trained, detection model is obtained.
In some embodiments of the present application, step B3 includes:
Step B3-1: according to default division proportion, trained picture and test chart are divided into after the second samples pictures are upset Piece;
Wherein, preset ratio can according to need sets itself in practical applications, such as preset division proportion is 8: 2, that is, 80% in the second samples pictures is chosen as training picture, and 20% as test picture.
Step B3-2: training picture is trained, initial model is obtained;
Specifically, training picture and its original tag are input to neural network, pass through the convolutional layer of neural network, Quan Lian It connects layer and pond layer etc. to learn the label of training picture and training picture, obtains initial model.
Step B3-3: test chart built-in testing initial model is used, the accuracy rate of initial model is obtained, when accuracy rate is not less than When default accuracy rate, using corresponding initial model as detection model;If being less than default accuracy rate, need to initial model into The further training of row.
Specifically, when being trained to obtain initial model to training picture every time, it will be without the test chart of original tag Piece is input in initial model and is predicted, obtains the prediction label of test picture, will test the original tag and prediction of picture Label compares, and obtains the number for comparing consistent prediction label, number and prediction label of the calculating ratio to consistent prediction label The ratio of total number obtains the accuracy rate of initial model;Judge whether obtained accuracy rate is not less than default accuracy rate, and is sentencing Disconnected result is when being, using current initial model as trained obtained detection model;If judging result is no, to introductory die Type is further trained.
As a result, by combining computer vision with neural network, the deformation picture of each first sample picture is generated, Gray scale is carried out to deformation picture and binary conversion treatment obtains the second samples pictures, and based on the training of the second samples pictures for detecting The moulding that product picture includes whether there is the detection model of defect, so that the detection model that training obtains is to note to be detected The mobile change with light of the small range of plastic has good compatibility.In turn, the surface for needing to detect moulding whether When existing defects, acquires the product picture of moulding and the first pretreatment of progress obtains after detecting picture, using the detection model Detection picture is detected, moulding, which can be realized, whether there is the quick and precisely detection of defect;It can not only effectively solve Certainly current manual's visual inspection can be because of the problem of extraneous factors such as the emotional change of testing staff lead to detection error and traditional calculations The low compatibility of machine vision and the problem of new demand cannot be rapidly adapted to;And corporate training and management cost are greatly reduced, Effectively defect ware is avoided to come into the market the problem of bringing loss to enterprise.
It is the defect inspection method of a moulding provided by the embodiments of the present application above, corresponds to the above method, this Invention also provides a kind of defect detecting device of moulding, the implementation and above method phase solved the problems, such as due to described device Seemingly, therefore the content with method partial response, the detailed description that reference can be made to the above method embodiment are subsequent not repeat them here.It can With understanding, device provided by the present application may include the unit or mould for being able to carry out each step in above method example Block, these units or module can realize that the present invention does not limit by way of hardware, software or soft or hard combination.Below It is specifically described in conjunction with attached drawing 3.
Attached drawing 3 is a kind of surface defect detection apparatus for moulding that some embodiments of the application provide, as shown in figure 3, The defect detecting device of moulding includes:
Acquisition module 201, for acquiring the product picture of moulding;
First preprocessing module 202, the product picture for acquiring to acquisition module 201 carry out the first pretreatment, obtain Picture to be detected;
Detection module 203, the mapping to be checked for being obtained using detection model detection preprocessing module 202 trained in advance Piece, obtaining moulding surface whether there is the testing result of defect.
In some embodiments of the present application, preprocessing module 202 is specifically used for:
Gray scale and binary conversion treatment are carried out to product picture, obtain picture to be detected.
In some embodiments of the present application, preprocessing module 202 is specifically used for:
Separate the three primary colors of each pixel in product picture;
The three primary colors of each pixel are weighted, the gray value of each pixel is obtained;
Judge whether gray value is more than gray value threshold value;
If the determination result is YES, then the first preset value is set by corresponding pixel;
If judging result be it is no, set the second preset value for corresponding pixel.
In some embodiments of the present application, device further include:
Module 204 is obtained, the first sample picture of the tape label for obtaining moulding, wherein label is for identifying first The moulding that samples pictures include whether there is defect;
Second preprocessing module 205 obtains the second sample of tape label for carrying out the second pretreatment to first sample picture This picture, wherein the label of the second samples pictures is identical as the label of corresponding first sample picture;
Training module 206 obtains detection model for being trained to the second samples pictures.
In some embodiments of the present application, the second preprocessing module 205 includes:
Generate submodule, for generating the deformation picture of first sample picture, wherein the label of deformation picture with it is corresponding The label of first sample picture is identical;
Submodule is pre-processed, for carrying out gray scale and binary conversion treatment to deformation picture, obtains the second sample of tape label Picture.
In some embodiments of the present application, generates submodule and is specifically used for:
According to default bias unit, each first sample picture is displaced, obtains the position of each first sample picture Move picture;
According to default rotation angle angle, each displacement picture is rotated, the rotation of each first sample picture is obtained Picture;
According to pre-set zoom ratio, each rotating image is zoomed in and out, obtains the scaling figure of each first sample picture Piece.
In some embodiments of the present application, training module 206 is specifically used for:
According to default division proportion, the second samples pictures are divided into trained picture and test picture;
Training picture is trained, initial model is obtained;
Using test chart built-in testing initial model, the accuracy rate of initial model is obtained;
When accuracy rate is not less than default accuracy rate, using corresponding initial model as detection model.
The defect detecting device of moulding provided by the embodiments of the present application, the defect of the moulding provided with previous embodiment Detection method has the same effect for identical inventive concept.
The application embodiment also provides a kind of defect inspection method pair with moulding provided by aforementioned embodiments The electronic equipment answered, the electronic equipment can be server, including independent server and distributed server cluster etc.;The electricity Sub- equipment can also be electronic equipment for client, such as mobile phone, laptop, tablet computer, desktop computer etc., To execute the defect inspection method of above-mentioned moulding.
If Fig. 4 is the schematic diagram of a kind of electronic equipment that some embodiments of the application provide, as shown in Figure 4, comprising: storage Device 301, processor 302, bus 303 and communication interface 304;
Wherein, memory 301, processor 302 and communication interface 304 are connected by bus 303;It is stored in memory 301 There is the computer program that can be run on processor 302, when processor 302 executes when running the computer program, realizes aforementioned The defect inspection method of moulding provided by any embodiment.
Further, memory 301 may include high-speed random access memory (RAM:Random Access It Memory), can also further include non-labile memory (non-volatile memory), a for example, at least disk is deposited Reservoir.
Processor 302 can be a kind of IC chip, the processing capacity with signal.It is above-mentioned during realization Each step of method can be completed by the integrated logic circuit of the hardware in processor 302 or the instruction of software form.Place Reason device 302 can also be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), net Network processor (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (DSP), specific integrated circuit (ASIC), ready-made programmable gate array (FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components.
Bus 303 can be ISA (English: Industry Standard Architecture;Chinese: industrial standard body Architecture) bus, PCI (English: Peripheral Component Interconnect;Chinese: Peripheral Component Interconnect standard) Bus or EISA (English: Extended Industry Standard Architecture;Chinese: extension industrial standard knot Structure) bus etc..
The defect inspection method of electronic equipment provided by the embodiments of the present application and moulding provided by the embodiments of the present application goes out In identical inventive concept, there is the identical beneficial effect of the method for using, running or realizing with it.
The embodiment of the present application also provides a kind of corresponding with the defect inspection method of moulding provided by aforementioned embodiments Computer-readable medium, be stored thereon with computer program (i.e. program product), which runs by processor When, realize the defect inspection method of moulding provided by aforementioned any embodiment.
Wherein, computer readable storage medium includes but is not limited to phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optics, magnetic-based storage media, herein No longer repeat one by one.
The defect of computer readable storage medium provided by the embodiments of the present application and moulding provided by the embodiments of the present application Detection method has the method for using, running or realizing with the application program that it is stored identical for identical inventive concept Beneficial effect.
It should be understood that
Herein, the terms "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, from And to include process, method, article or the system of a series of elements not only to include those elements, but also including not bright The other element really listed, or further include for this process, method, article or the intrinsic element of system.Do not having In the case where more limitations, the element that is limited by sentence "including a ...", it is not excluded that including process, the side of the element There is also other identical elements in method, article or system.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server or network equipment etc.) execute method described in each embodiment of the present invention.
The preferable specific embodiment of the above, only the application, but the protection scope of the application is not limited thereto, and is appointed Within the technical scope of the present application, any changes or substitutions that can be easily thought of, all by what those familiar with the art It should cover within the scope of protection of this application.Therefore, the protection scope of the application should be subject to the protection scope in claims.

Claims (10)

1. a kind of detection method of surface flaw of moulding characterized by comprising
Acquire the product picture of moulding;
First pretreatment is carried out to the product picture, obtains picture to be detected;
The picture to be detected is detected using detection model trained in advance, obtains the moulding surface with the presence or absence of defect Testing result.
2. being obtained the method according to claim 1, wherein described carry out the first pretreatment to the product picture To picture to be detected, comprising:
Gray scale and binary conversion treatment are carried out to the product picture, obtain picture to be detected.
3. according to the method described in claim 2, it is characterized in that, described carry out gray scale and binary conversion treatment to product picture, Obtain picture to be detected, comprising:
Separate the three primary colors of each pixel in the product picture;
The three primary colors of each pixel are weighted, the gray value of each pixel is obtained;
Judge whether the gray value is more than gray value threshold value;
If the determination result is YES, then the first preset value is set by corresponding pixel;
If judging result be it is no, set the second preset value for corresponding pixel.
4. method according to claim 1-3, which is characterized in that the method also includes:
The first sample picture of the tape label of moulding is obtained, the label is for identifying the note that the first sample picture includes Plastic whether there is defect;
Second pretreatment is carried out to the first sample picture, obtains the second samples pictures of tape label, second sample graph The label of piece is identical as the label of corresponding first sample picture;
Second samples pictures are trained, the detection model is obtained.
5. according to the method described in claim 4, it is characterized in that, described carry out the second pre- place to the first sample picture Reason, obtains the second samples pictures of tape label, comprising:
Generate the deformation picture of the first sample picture, the mark of the label of the deformation picture and corresponding first sample picture It signs identical;
Gray scale and binary conversion treatment are carried out to the deformation picture, obtain the second samples pictures of tape label.
6. according to the method described in claim 5, it is characterized in that, the deformation picture for generating the first sample picture, Include:
According to default bias unit, each first sample picture is displaced, obtains the displacement diagram of each first sample picture Piece;
According to default rotation angle angle, each displacement picture is rotated, the rotation of each first sample picture is obtained Picture;
According to pre-set zoom ratio, each rotating image is zoomed in and out, obtains the scaling figure of each first sample picture Piece.
7. according to the method described in claim 4, obtaining described it is characterized in that, be trained to second samples pictures Detection model, comprising:
According to default division proportion, trained picture and test picture are divided into after second samples pictures are upset;
The trained picture is trained, initial model is obtained;
Using initial model described in the test chart built-in testing, the accuracy rate of the initial model is obtained;
When the accuracy rate is less than default accuracy rate, initial model is further trained;
When the accuracy rate is not less than default accuracy rate, using corresponding initial model as detection model.
8. a kind of defect detecting device of moulding characterized by comprising
Acquisition module, for acquiring the product picture of moulding;
First preprocessing module obtains picture to be detected for carrying out the first pretreatment to the product picture;
Detection module obtains the moulding surface for detecting the picture to be detected using detection model trained in advance With the presence or absence of the testing result of defect.
9. a kind of electronic equipment characterized by comprising memory and processor;
It is stored with computer program on the memory, when the computer program is executed by the processor, is realized as weighed Benefit requires the described in any item methods of 1-7.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that when the computer journey When sequence is executed by processor, the method according to claim 1 to 7 is realized.
CN201910465454.9A 2019-05-30 2019-05-30 A kind of detection method of surface flaw of moulding, device, equipment and storage medium Pending CN110264447A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910465454.9A CN110264447A (en) 2019-05-30 2019-05-30 A kind of detection method of surface flaw of moulding, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910465454.9A CN110264447A (en) 2019-05-30 2019-05-30 A kind of detection method of surface flaw of moulding, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110264447A true CN110264447A (en) 2019-09-20

Family

ID=67916107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910465454.9A Pending CN110264447A (en) 2019-05-30 2019-05-30 A kind of detection method of surface flaw of moulding, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110264447A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110632086A (en) * 2019-11-04 2019-12-31 大连中启伟创科技有限公司 Injection molding surface defect detection method and system based on machine vision
CN110648326A (en) * 2019-09-29 2020-01-03 精硕科技(北京)股份有限公司 Method and device for constructing image quality evaluation convolutional neural network
CN111210412A (en) * 2019-12-31 2020-05-29 电子科技大学中山学院 Package detection method and device, electronic equipment and storage medium
CN113117341A (en) * 2021-05-18 2021-07-16 网易(杭州)网络有限公司 Picture processing method and device, computer readable storage medium and electronic equipment
CN113936000A (en) * 2021-12-16 2022-01-14 武汉欧易塑胶包装有限公司 Injection molding wave flow mark identification method based on image processing
CN114463284A (en) * 2022-01-14 2022-05-10 阿丘机器人科技(苏州)有限公司 PCB defect detection method, device, equipment and storage medium
CN114820599A (en) * 2022-06-27 2022-07-29 南通奥尔嘉橡塑有限公司 Injection molding buckle defect detection method and device based on computer vision
CN115187602A (en) * 2022-09-13 2022-10-14 江苏骏利精密制造科技有限公司 Injection molding part defect detection method and system based on image processing
CN118096751A (en) * 2024-04-25 2024-05-28 广东美的制冷设备有限公司 Injection molding appearance defect detection method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850858A (en) * 2015-05-15 2015-08-19 华中科技大学 Injection-molded product defect detection and recognition method
CN107564002A (en) * 2017-09-14 2018-01-09 广东工业大学 Plastic tube detection method of surface flaw, system and computer-readable recording medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850858A (en) * 2015-05-15 2015-08-19 华中科技大学 Injection-molded product defect detection and recognition method
CN107564002A (en) * 2017-09-14 2018-01-09 广东工业大学 Plastic tube detection method of surface flaw, system and computer-readable recording medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WEIXIN_30797199: "一些图像数据数据扩充(扩样本)方法", 《HTTPS://BLOG.CSDN.NET/WEIXIN_30797199/ARTICLE/DETAILS/98912623?UTM_MEDIUM=DISTRIBUTE.PC_AGGPAGE_SEARCH_RESULT.NONE-TASK-BLOG-2~AGGREGATEPAGE~FIRST_RANK_ECPM_V1~RANK_V31_ECPM-4-98912623.PC_AGG_NEW_RANK》 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110648326A (en) * 2019-09-29 2020-01-03 精硕科技(北京)股份有限公司 Method and device for constructing image quality evaluation convolutional neural network
CN110632086A (en) * 2019-11-04 2019-12-31 大连中启伟创科技有限公司 Injection molding surface defect detection method and system based on machine vision
CN111210412A (en) * 2019-12-31 2020-05-29 电子科技大学中山学院 Package detection method and device, electronic equipment and storage medium
CN111210412B (en) * 2019-12-31 2024-03-15 电子科技大学中山学院 Packaging detection method and device, electronic equipment and storage medium
CN113117341B (en) * 2021-05-18 2024-02-02 网易(杭州)网络有限公司 Picture processing method and device, computer readable storage medium and electronic equipment
CN113117341A (en) * 2021-05-18 2021-07-16 网易(杭州)网络有限公司 Picture processing method and device, computer readable storage medium and electronic equipment
CN113936000B (en) * 2021-12-16 2022-03-15 武汉欧易塑胶包装有限公司 Injection molding wave flow mark identification method based on image processing
CN113936000A (en) * 2021-12-16 2022-01-14 武汉欧易塑胶包装有限公司 Injection molding wave flow mark identification method based on image processing
CN114463284A (en) * 2022-01-14 2022-05-10 阿丘机器人科技(苏州)有限公司 PCB defect detection method, device, equipment and storage medium
CN114820599A (en) * 2022-06-27 2022-07-29 南通奥尔嘉橡塑有限公司 Injection molding buckle defect detection method and device based on computer vision
CN115187602A (en) * 2022-09-13 2022-10-14 江苏骏利精密制造科技有限公司 Injection molding part defect detection method and system based on image processing
CN118096751A (en) * 2024-04-25 2024-05-28 广东美的制冷设备有限公司 Injection molding appearance defect detection method and device, electronic equipment and storage medium
CN118096751B (en) * 2024-04-25 2024-08-27 广东美的制冷设备有限公司 Injection molding appearance defect detection method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110264447A (en) A kind of detection method of surface flaw of moulding, device, equipment and storage medium
CN111179251B (en) Defect detection system and method based on twin neural network and by utilizing template comparison
WO2023077404A1 (en) Defect detection method, apparatus and system
CN109871895B (en) Method and device for detecting defects of circuit board
WO2021143343A1 (en) Method and device for testing product quality
CN111257341B (en) Underwater building crack detection method based on multi-scale features and stacked full convolution network
JP7028333B2 (en) Lighting condition setting method, equipment, system and program, and storage medium
CN113643268B (en) Industrial product defect quality inspection method and device based on deep learning and storage medium
Thipakorn et al. Egg weight prediction and egg size classification using image processing and machine learning
CN109784385A (en) A kind of commodity automatic identifying method, system, device and storage medium
CN110969600A (en) Product defect detection method and device, electronic equipment and storage medium
CN110415214A (en) Appearance detecting method, device, electronic equipment and the storage medium of camera module
WO2024002187A1 (en) Defect detection method, defect detection device, and storage medium
CN109003271A (en) A kind of Wiring harness connector winding displacement quality determining method based on deep learning YOLO algorithm
CN109685774A (en) Varistor open defect detection method based on depth convolutional neural networks
CN113240647A (en) Mobile phone shell rear cover defect detection method and system based on deep learning
Ibrahim et al. Egg’s grade classification and dirt inspection using image processing techniques
CN114945938A (en) Method and device for detecting actual area of defect and method and device for detecting display panel
CN116128839A (en) Wafer defect identification method, device, electronic equipment and storage medium
CN112634203A (en) Image detection method, electronic device and computer-readable storage medium
WO2023234930A1 (en) Self-supervised anomaly detection framework for visual quality inspection in manufactruing
CN114419029A (en) Training method of surface defect detection model, surface defect detection method and device
CN114066849B (en) Electrical interface defect detection method based on deep learning
CN114078127B (en) Object defect detection and counting method, device, equipment and storage medium
CN117372424B (en) Defect detection method, device, equipment and storage medium

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 101, building 1, block C, Qianjiang Century Park, ningwei street, Xiaoshan District, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou Weiming Information Technology Co.,Ltd.

Applicant after: Institute of Information Technology, Zhejiang Peking University

Address before: Room 288-1, 857 Xinbei Road, Ningwei Town, Xiaoshan District, Hangzhou City, Zhejiang Province

Applicant before: Institute of Information Technology, Zhejiang Peking University

Applicant before: Hangzhou Weiming Information Technology Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190920