CN105741298B - A kind of image partition method for film label Defect Detection - Google Patents
A kind of image partition method for film label Defect Detection Download PDFInfo
- Publication number
- CN105741298B CN105741298B CN201610073959.7A CN201610073959A CN105741298B CN 105741298 B CN105741298 B CN 105741298B CN 201610073959 A CN201610073959 A CN 201610073959A CN 105741298 B CN105741298 B CN 105741298B
- Authority
- CN
- China
- Prior art keywords
- wave
- situation
- threshold value
- crest
- film label
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/0006—Industrial image inspection using a design-rule based approach
Abstract
The present invention relates to a kind of image partition methods for film label Defect Detection.The present invention acquires the BMP images of film label by industrial camera first, and converts picture into gray-scale map, the number of the identical pixel of statistics gray value, and draws histogram;Secondly smooth, rejecting burr is carried out to histogram using differential technique;Then the starting of each wave crest, crest location and final position are counted, and thereby determines that threshold value.Finally image is split according to the threshold value.The present invention improves the recognition correct rate of film label flaw, while such application plays important function for the saving of human cost and the raising of labor productivity.
Description
Technical field
The invention belongs to technical field of image processing, are related to a kind of image segmentation side for film label Defect Detection
Method.
Background technology
In the Defect Detection of film label, due to being finally to be handled binary map to differentiate flaw, image segmentation
Quality determine the effect of later image processing, therefore image segmentation occupies in the such application of Defect Detection of film label
Critical role.
The prior art has the following defects
A) it is poor to choose the improper effect that can lead to binaryzation for the threshold value divided
B) part treatment of details is improper, such as the writing at the film label back side has been also carried out binaryzation, is displayed for out
Come, it is very big for the interference of Defect Detection.
Invention content
In view of the deficiencies of the prior art, the present invention proposes a kind of image segmentation sides for film label Defect Detection
Method.
Steps are as follows for the technical solution adopted for solving the technical problem of the present invention:
Step 1:The BMP images of film label are acquired by industrial camera, and convert picture into gray-scale map.
Step 2:The number of the identical pixel of gray value is counted, and draws histogram.
Step 3:Smooth, rejecting burr is carried out to histogram using differential technique.
Step 4:Count the starting of each wave crest, crest location and final position.
Provide continuous six and six or more be incremented by be then wave incremental section, continuous six and six below to successively decrease then
For the decline fraction of wave;If the value being increased continuously is indicated with UP, the value continuously successively decreased is indicated with Down, and pTistogram [i] is indicated
The number of each gray value, removes pseudo wave or half-wave processing is as follows:
Incremental stages:
Situation one:Work as UP++, if Down<4, then Down=0;
Situation two:Work as UP++, if Down>3, then UP=1, Down=0;
Situation three:Work as Down++, if UP<4, then UP=0;
Situation four:Work as Down++, if 4<=UP<6&&Down>3, UP=0;
Situation five:Work as Down++, if UP>=6&&Down>3, it is determined that initial position and crest location, UP=0, Down
It remains unchanged, the incremental section for terminating wave at this time is found, and the decline fraction of wave is begun look for;
Wherein UP++ expressions are increased continuously, and Down++ unexpected one or continuous several successively decreases when indicating to be incremented by;
Depletion stage:
Situation one:As Down ' ++, if UP<4, then UP=0;
Situation two:As Down ' ++, if UP>3, then Down=1, UP=0;
Situation three:As UP ' ++, if 4<=Down<6, then Down=0;
Situation four:As UP ' ++, if Down<4, then Down=0;
Situation five:As Down ' ++, if Down>=6&&pTistogram [i+1]<200, it is determined that terminating point position, then
The searching for terminating first wave, begins look for the incremental section of second wave;
Situation six:As UP ' ++, if Down>=6&& (UP>3||pTistog[i+1]<200), it is determined that terminating point position,
The searching for then terminating first wave begins look for the incremental section of second wave;
Until i<Terminate to find when 255;
Wherein Down ' ++ expression continuously successively decrease, UP ' ++ indicate be incremented by when it is unexpected one or continuously it is several incremental;
Step 5:Count the number of wave crest.
Step 6:Threshold value.
When the number of wave is less than or equal to 1, terminating point position, that is, required threshold value of step 4 determination;
When the number of wave is more than 1, two neighboring wave crest is first taken, the blurring of S function, mould are carried out between two wave crests
Paste rate is λ, and when fuzzy rate minimum, then required threshold value is then λmin, then threshold is found between wave crest adjacent two-by-two successively
Value;
Step 7:After obtaining threshold value, you can complete the segmentation to image.
Beneficial effects of the present invention:
The present invention has good segmentation effect for foreground and background image with distinct contrast, is mainly used in film at present
In the Defect Detection of label.Important function is played for the smooth implementation of such application, improves the recognition correct rate of flaw.
Such application plays important function for the saving of human cost and the raising of labor productivity simultaneously.
Description of the drawings
Fig. 1 is the statistic curve of the gray value in ideal;
Fig. 2 is the statistic curve of gray value in actual treatment;
Fig. 3 is the flow chart of the method for the present invention;
Fig. 4 is the starting for determining wave, wave crest, the flow chart of final position.
Specific embodiment
Below in conjunction with attached drawing, the invention will be further described.
Defect Detection of the present embodiment mainly for film label, it is proposed that a kind of method of image segmentation, it can be more
Adapt to the smooth implementation of such application.
The inventive point of the present embodiment describes:
A) there are pseudo wave when finding Wave crest and wave trough, situations such as half-wave, these interference are removed.
B) it combines S function to be blurred, finds the trough between two neighboring wave crest, this valley value is exactly required threshold value.
Specific embodiment is as follows:
A) analysis of wave
It is important that the analysis of wave in the present embodiment, a complete wave by wave initial position, wave crest and
The final position of wave forms.
Based on the image of such application, the statistic curve of the gray value in ideal is as shown in Figure 1, and in actual treatment
There are many interference, such as pseudo wave as shown in Fig. 2, caning be found that a complete wave from Fig. 2 for the statistic curve of gray value, partly
Wave etc., it is therefore desirable to remove these interference.
B) determination of threshold value
Complete wave crest is obtained after eliminating interference, as shown in Fig. 2, there will necessarily be a wave between two wave crests
Paddy determines wave trough position by the blurring of S function.
C) main flow
As shown in figure 3, the main purpose of the flow is to detect the most suitable threshold value of image segmentation automatically.
1) step 1:The BMP images of film label are acquired by industrial camera, and convert picture into gray-scale map.
2) step 2:The number of the identical pixel of gray value is counted, and draws histogram;
3) step 3:Simple smooth is carried out to histogram, rejects burr;It is carried out smoothly, using formula using differential technique
Wherein, step-length step, i are corresponding grey scale value.Calculate it is smooth after value temp, and temp is stored in array
In pTistogram [i].
4) step 4:Count the starting of each wave crest, wave crest and final position;
It is as follows for the monotonicity decision method of discrete function:For discrete functionIf
All i >=0 are set up, then are claimedAbout all XiMonotonic increase, on the contrary then monotone decreasing.
Herein, it is specified that the incremental of continuous six and six or more is then the incremental section of wave, continuous six and six or less
Successively decrease then be wave decline fraction.Since there are half-waves for wave, such situation such as pseudo wave, interference is very big in the case of reality,
So needing to remove these interference.Assuming that the value being increased continuously is indicated with UP, the value continuously successively decreased is indicated with Down,
PTistogram [i] indicates the number of each gray value.
Incremental stages situation (pTistogram [i+1]>=pTistogram [i]):(note:UP++ expressions are increased continuously,
Down++ when indicating to be incremented by unexpected one either continuous several following situations that successively decrease be to remove pseudo wave or half-wave)
Situation one:Work as UP++, if Down<4, then Down=0;
Situation two:Work as UP++, if Down>3, then UP=1, Down=0;
Situation three:Work as Down++, if UP<4, then UP=0;
Situation four:Work as Down++, if 4<=UP<6&&Down>3, UP=0;
Situation five:Work as Down++, if UP>=6&&Down>3, it is determined that initial position and crest location, UP=0, Down
It remains unchanged, the incremental section for terminating wave at this time is found, and the decline fraction of wave is begun look for.
Depletion stage situation (pTistogram [i+1]<=pTistogram [i]):(note:Down ' ++ expression is continuously passed
Subtract, UP ' ++ when indicating to be incremented by unexpected one or continuous several be incremented by)
Situation one:As Down ' ++, if UP<4, then UP=0;
Situation two:As Down ' ++, if UP>3, then Down=1, UP=0;
Situation three:As UP ' ++, if 4<=Down<6, then Down=0;
Situation four:As UP ' ++, if Down<4, then Down=0;
Situation five:As Down ' ++, if Down>=6&&pTistogram [i+1]<200, it is determined that terminating point position, then
The searching for terminating first wave, begins look for the incremental section of second wave;
Situation six:As UP ' ++, if Down>=6&& (UP>3||pTistog[i+1]<200), it is determined that terminating point position,
The searching for then terminating first wave begins look for the incremental section of second wave;
Until i<Terminate to find when 255.
5) step 5:Count the number of wave crest
Since the wave that step 4 searches out all saves, the number of its wave is read this when.
6) step 6:Threshold value
When the number of wave is less than or equal to 1, terminating point position, that is, required threshold value of step 4 determination;
When the number of wave is more than 1, two neighboring wave crest is first taken, the blurring of S function, mould are carried out between two wave crests
Paste rate is λ, and when fuzzy rate minimum, then the threshold value required by us is then λmin.Then it is sought between wave crest adjacent two-by-two successively
Look for threshold value.
Fig. 4 is the starting for determining wave, and wave crest, the flow chart of final position, such method considers the group of ten several interference
It closes, keeps result more accurate.
To sum up, the present embodiment can improve the effect of film label segmentation, and better adapting to film label defects detection needs
It asks, ensures that subsequent step can preferably be implemented.
Claims (1)
1. a kind of image partition method for film label Defect Detection, it is characterised in that this approach includes the following steps:
Step 1:The BMP images of film label are acquired by industrial camera, and convert picture into gray-scale map;
Step 2:The number of the identical pixel of gray value is counted, and draws histogram;
Step 3:Smooth, rejecting burr is carried out to histogram using differential technique;
Step 4:Count the starting of each wave crest, crest location and final position;
Provide the then incremental section for wave that is incremented by of continuous six and six or more, continuous six and six below successively decrease are then wave
Decline fraction;If the value being increased continuously is indicated with UP, the value continuously successively decreased is indicated with Down, and pTistogram [i] indicates each
The number of gray value, removes pseudo wave or half-wave processing is as follows:
Incremental stages:
Situation one:Work as UP++, if Down<4, then Down=0;
Situation two:Work as UP++, if Down>3, then UP=1, Down=0;
Situation three:Work as Down++, if UP<4, then UP=0;
Situation four:Work as Down++, if 4<=UP<6 and Down>3, UP=0;
Situation five:Work as Down++, if UP>=6 and Down>3, it is determined that initial position and crest location, UP=0, Down are kept
Constant, the incremental section for terminating wave at this time is found, and the decline fraction of wave is begun look for;
Wherein UP++ expressions are increased continuously, and Down++ unexpected one or continuous several successively decreases when indicating to be incremented by;
Depletion stage:
Situation one:As Down ' ++, if UP<4, then UP=0;
Situation two:As Down ' ++, if UP>3, then Down=1, UP=0;
Situation three:As UP ' ++, if 4<=Down<6, then Down=0;
Situation four:As UP ' ++, if Down<4, then Down=0;
Situation five:As Down ' ++, if Down>=6 and pTistogram [i+1]<200, it is determined that terminating point position is then terminated
The searching of first wave begins look for the incremental section of second wave;
Situation six:As UP ' ++, if Down>=6 and (UP>3 or pTistog [i+1]<200), it is determined that terminating point position is then tied
The searching of first wave of beam begins look for the incremental section of second wave;
Until i<Terminate to find when 255;
Wherein Down ' ++ expression continuously successively decrease, UP ' ++ indicate be incremented by when it is unexpected one or continuously it is several incremental;
Step 5:Count the number of wave crest
Step 6:Threshold value
When the number of wave is less than or equal to 1, terminating point position, that is, required threshold value of step 4 determination;
When the number of wave is more than 1, two neighboring wave crest is first taken, the blurring of S function is carried out between two wave crests, obscures rate
For λ, when fuzzy rate minimum, then required threshold value is then λmin, then threshold value is found between wave crest adjacent two-by-two successively;
Step 7:After obtaining threshold value, you can complete the segmentation to image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610073959.7A CN105741298B (en) | 2016-02-03 | 2016-02-03 | A kind of image partition method for film label Defect Detection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610073959.7A CN105741298B (en) | 2016-02-03 | 2016-02-03 | A kind of image partition method for film label Defect Detection |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105741298A CN105741298A (en) | 2016-07-06 |
CN105741298B true CN105741298B (en) | 2018-08-14 |
Family
ID=56245714
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610073959.7A Active CN105741298B (en) | 2016-02-03 | 2016-02-03 | A kind of image partition method for film label Defect Detection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105741298B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7684609B1 (en) * | 2006-05-25 | 2010-03-23 | Kla-Tencor Technologies Corporation | Defect review using image segmentation |
CN101793843A (en) * | 2010-03-12 | 2010-08-04 | 华东理工大学 | Connection table based automatic optical detection algorithm of printed circuit board |
CN102680494A (en) * | 2012-05-24 | 2012-09-19 | 江南大学 | Real-time detecting method of metal arc plane flaw based on machine vision |
-
2016
- 2016-02-03 CN CN201610073959.7A patent/CN105741298B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7684609B1 (en) * | 2006-05-25 | 2010-03-23 | Kla-Tencor Technologies Corporation | Defect review using image segmentation |
CN101793843A (en) * | 2010-03-12 | 2010-08-04 | 华东理工大学 | Connection table based automatic optical detection algorithm of printed circuit board |
CN102680494A (en) * | 2012-05-24 | 2012-09-19 | 江南大学 | Real-time detecting method of metal arc plane flaw based on machine vision |
Non-Patent Citations (1)
Title |
---|
《Computer-Vision-Based Fabric Defect Detection: A Survey》;Ajay Kumar;《IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS》;20080131;第55卷(第1期);348-363 * |
Also Published As
Publication number | Publication date |
---|---|
CN105741298A (en) | 2016-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108280823B (en) | Method and system for detecting weak edge flaws on optical cable surface in industrial production | |
CN107228860B (en) | Gear defect detection method based on image rotation period characteristics | |
CN111127429B (en) | Water conservancy system pipe thread defect detection method based on self-training deep neural network | |
CN108898132B (en) | Terahertz image dangerous article identification method based on shape context description | |
CN108918499B (en) | The method of Raman baseline drift is removed in Raman map | |
CN108470343A (en) | A kind of improved method for detecting image edge | |
CN116703898B (en) | Quality detection method for end face of precision mechanical bearing | |
CN115274486B (en) | Semiconductor surface defect identification method | |
CN110687122A (en) | Method and system for detecting surface cracks of ceramic tile | |
CN114863492B (en) | Method and device for repairing low-quality fingerprint image | |
JP2004038885A (en) | Image feature learning type defect detection method, defect detection device and defect detection program | |
CN115311289A (en) | Method for detecting oil stain defects of plain-color cloth | |
CN114170165A (en) | Chip surface defect detection method and device | |
CN110186929A (en) | A kind of real-time product defect localization method | |
CN111598858B (en) | Rubber glove detection method and system based on transfer learning | |
CN105741298B (en) | A kind of image partition method for film label Defect Detection | |
CN117058182A (en) | Target detection frame optimization method for visual ranging | |
CN112184619A (en) | Metal part surface defect detection method based on deep learning | |
CN115330769B (en) | Defect detection method for aluminum pipe surface scratching and indentation | |
CN115222735B (en) | Metal mold quality detection method based on pockmark defects | |
CN116824294A (en) | Solder defect detection method and system based on small target identification | |
CN114862786A (en) | Retinex image enhancement and Ostu threshold segmentation based isolated zone detection method and system | |
CN114998186A (en) | Image processing-based method and system for detecting surface scab defect of copper starting sheet | |
CN108961290B (en) | Adaptive image edge detection method based on Ratio operator of Otsu | |
JP2711649B2 (en) | Surface scratch detection method for inspection object |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |