CN103625662B - Method for detecting number of pills of filling machine - Google Patents
Method for detecting number of pills of filling machine Download PDFInfo
- Publication number
- CN103625662B CN103625662B CN201310648982.0A CN201310648982A CN103625662B CN 103625662 B CN103625662 B CN 103625662B CN 201310648982 A CN201310648982 A CN 201310648982A CN 103625662 B CN103625662 B CN 103625662B
- Authority
- CN
- China
- Prior art keywords
- filling
- surveyed area
- gray level
- value
- pills
- 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.)
- Expired - Fee Related
Links
Landscapes
- Image Processing (AREA)
- Medical Preparation Storing Or Oral Administration Devices (AREA)
Abstract
The invention belongs to the technical field of digital image processing and relates to a method for detecting the number of pills of a filling machine. The method comprises the steps: acquiring images for detecting the number of the pills of the filling machine; selecting before-filling detection areas and after-filling detection areas from the acquired images; respectively carrying out threshold segmentation on the images in the before-filling detection areas and the images in the after-filling detection areas, so as to respectively obtain binary images of the before-filling detection areas and binary images of the after-filling detection areas; respectively carrying out Blob analysis on the binary images of the before-filling detection areas and the binary images of the after-filling detection areas, and judging the number of the pills. The method has the advantages that artificial detection can be replaced, interference caused by subjective factors during the artificial detection is overcome, the number of the pills can be detected in a rapid, objective and accurate manner, and then, the accuracy and efficiency of drug quality detection are improved.
Description
Art
The invention belongs to digital image processing techniques field, relate to a kind of method detecting bottle placer amount of pills.
Background technology
In pill pouring process, the problems such as amount of pills is not enough, pill is incomplete directly affect the quality of medicine.At present, the detection of amount of pills is mainly by artificial visually examine.In packaging production line operational process, whether staff's visual inspection pill funnel all fills full, and whether whether incomplete the and pill of pill leaks down completely.Although manual detection is convenient, directly perceived, affect greatly by subjective factor, workman works long hours and easily causes visual fatigue, there will be misjudgment, and then affects drug quality.
Summary of the invention
The object of this invention is to provide a kind of method that can replace manually carrying out the detection bottle placer amount of pills detected.Technical scheme of the present invention is as follows:
(1) gather image for detecting bottle placer amount of pills, every width image comprise simultaneously adjacent previous station filling after status information and a rear station filling before status information;
(2) gather image in select filling front surveyed area and filling after surveyed area;
(3) to filling front surveyed area and filling after surveyed area in image carry out Threshold segmentation respectively, obtain respectively filling before and filling after the binary map of two surveyed areas, to each surveyed area, following method is adopted to obtain the threshold value of carrying out surveyed area Iamge Segmentation:
The first step, grey level histogram calculating is carried out to surveyed area image;
Second step, result of calculation according to grey level histogram, be greater than the direction of 0 towards gray level from gray level 0, the number of times of the appearance of each gray level is added up, when cumulative value reaches the x% of surveyed area total number of image pixels, the value of record current gray level level, using this value as the minimum value of gray level in surveyed area image;
3rd step, be less than towards gray level from gray level 255 255 direction, the number of times of the appearance of each gray level is added up, when cumulative value reaches the y% of surveyed area total number of image pixels, the value of record current gray level level, using this value as the maximum value of gray level in surveyed area image;
The minimum value obtained in 4th step, taking-up above-mentioned steps and maxim, using the threshold value of the gray level of the position of the z% between minimum value and maxim as surveyed area Iamge Segmentation.
(4) respectively to filling front surveyed area and filling after the binary map of surveyed area carry out Blob analysis, judge amount of pills: according to pill size, circularity and the area of selecting blob are filter condition, namely only have circularity as bolb between minimum roundness and maximum circularity and area between minimum area and maximum area time, just think that this connect domain is blob; According to filter condition, find respectively filling before and filling after two surveyed areas in all blob, and add up filling front surveyed area and filling after surveyed area in the number of blob, obtain the amount of pills of filling front and back respectively.
This method of inspection can replace manually detecting, and overcomes the interference of subjective factor in manual detection process, can detect quick, objective, exactly filling before and the amount of pills of latter two station filling, improve the precision and efficiency of detecting of drug quality.
Accompanying drawing explanation
Fig. 1 image to be detected.
With filling rear surveyed area (region in grey circle) before Fig. 2 is filling.
The orifice region of the blob(Grey curves institute envelope obtained is analyzed with filling rear blob) before Fig. 3 is filling.
Detailed description of the invention
Below in conjunction with drawings and Examples, the present invention and application scenarios thereof are described.
(1) gather piece image, as shown in Figure 1, comprise simultaneously filling before and filling after status information (before in the images filling and filling then do not refer to same bag pill).Funnel on the left of image be pill filling before before state, if amount of pills is sufficient, all apertures in funnel filled by pill.After funnel forwards right positions to, the state of funnel be filling after state, if amount of pills is sufficient, pill all leaks down from aperture.。
(2) select respectively filling before and filling after surveyed area, as shown in Figure 2.
(3) to filling front surveyed area and filling after surveyed area in image carry out Threshold segmentation respectively.
Hard-threshold dividing method easily affects by brightness of image, in order to avoid picture luminance impacts segmentation, utilizes method below to carry out Threshold segmentation to surveyed area image.Method is as follows: the first step, carry out grey level histogram calculating to surveyed area image; Second step, result of calculation according to grey level histogram, be greater than the direction of 0 towards gray level from gray level 0, the number of times of the appearance of each gray level is added up, when cumulative value reaches the x% of surveyed area total number of image pixels, the value of record current gray level level, using this value as the minimum value of gray level in surveyed area image.Be less than the direction of 255 towards gray level from gray level 255, the number of times of the appearance of each gray level is added up, when cumulative value reaches the y% of surveyed area total number of image pixels (y value is set by the user), the value of record current gray level level, using this value as the maximum value of gray level in surveyed area image; 3rd step, take out in second step the minimum value and maxim that obtain, z%(z value between minimum value and maxim arranged by user) the gray level of position as the threshold value of surveyed area Iamge Segmentation.When darker noise is many, it is slightly large that x value should be arranged; When brighter noise is many, it is slightly large that y value should be arranged.
In the present embodiment, x, y, z is set to 5,0,34 respectively.According to these three parameters, by filling front surveyed area with filling after the target and background of surveyed area be separated, obtain respectively filling before and filling after the binary map of two surveyed areas.
(4) select the circularity of blob and area to be filter condition, only have circularities as bolb between 0.8 to 1.5 and area between 50 to 250 time, just think that this connect domain is blob.In Fig. 3 the orifice region of the Grey curves institute envelope of left side funnel position be filling before all blob regions of finding; In Fig. 3 the orifice region of Grey curves institute envelope of funnel position, right side be filling after all blob regions of finding; Can find out on the left of Fig. 3 filling before blob number be 1 be not equal to 0, think that the aperture in filling front funnel is not full of completely, amount of pills is not enough; Can find out on the right side of Fig. 3 filling after blob number be the 20 aperture numbers equaling funnel, think that filling rear all pills all leak down, amount of pills is sufficient.
Claims (1)
1. detect a method for bottle placer amount of pills, comprise the following steps:
(1) gather image for detecting bottle placer amount of pills, every width image comprise simultaneously adjacent previous station filling after status information and a rear station filling before status information;
(2) gather image in select filling front surveyed area and filling after surveyed area;
(3) to filling front surveyed area and filling after surveyed area in image carry out Threshold segmentation respectively, obtain respectively filling before and filling after the binary map of two surveyed areas, to each surveyed area, following method is adopted to obtain the threshold value of carrying out surveyed area Iamge Segmentation:
The first step, grey level histogram calculating is carried out to surveyed area image;
Second step, result of calculation according to grey level histogram, be greater than the direction of 0 towards gray level from gray level 0, the number of times of the appearance of each gray level is added up, when cumulative value reaches the x% of surveyed area total number of image pixels, the value of record current gray level level, using this value as the minimum value of gray level in surveyed area image;
3rd step, be less than towards gray level from gray level 255 255 direction, the number of times of the appearance of each gray level is added up, when cumulative value reaches the y% of surveyed area total number of image pixels, the value of record current gray level level, using this value as the maximum value of gray level in surveyed area image; Wherein, when darker noise is many, it is slightly large that x value should be arranged; When brighter noise is many, it is slightly large that y value should be arranged;
The minimum value obtained in 4th step, taking-up above-mentioned steps and maxim, using the threshold value of the gray level of the position of the z% between minimum value and maxim as surveyed area Iamge Segmentation;
(4) respectively to filling front surveyed area and filling after the binary map of surveyed area carry out Blob analysis, judge amount of pills: according to pill size, circularity and the area of selecting blob are filter condition, namely only have circularity when certain connect domain between minimum roundness and maximum circularity and area between minimum area and maximum area time, just think that this connect domain is blob; According to filter condition, find respectively filling before and filling after two surveyed areas in all blob, and add up filling front surveyed area and filling after surveyed area in the number of blob, obtain the amount of pills of filling front and back respectively.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310648982.0A CN103625662B (en) | 2013-12-04 | 2013-12-04 | Method for detecting number of pills of filling machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310648982.0A CN103625662B (en) | 2013-12-04 | 2013-12-04 | Method for detecting number of pills of filling machine |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103625662A CN103625662A (en) | 2014-03-12 |
CN103625662B true CN103625662B (en) | 2015-07-08 |
Family
ID=50207197
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310648982.0A Expired - Fee Related CN103625662B (en) | 2013-12-04 | 2013-12-04 | Method for detecting number of pills of filling machine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103625662B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103991589A (en) * | 2014-03-14 | 2014-08-20 | 南京大树智能科技股份有限公司 | Tablet lacking detection system for medicine in tablet |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2165942A (en) * | 1984-10-24 | 1986-04-23 | Hajime Industries | Surface inspection apparatus |
CN1400806A (en) * | 2001-07-31 | 2003-03-05 | 佳能株式会社 | Adaptive two-valued image processing method and equipment |
CN1442786A (en) * | 2003-04-09 | 2003-09-17 | 沈佐锐 | Microinsect automatic counting system |
CN1916598A (en) * | 2005-08-15 | 2007-02-21 | 中国农业大学 | Apparatus for measuring spectrum of fog drop, and image processing device |
CN101949819A (en) * | 2010-09-16 | 2011-01-19 | 北京优纳科技有限公司 | Cell counting method based on image identification |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3339724B2 (en) * | 1992-09-29 | 2002-10-28 | 株式会社リコー | Ink jet recording method and apparatus |
-
2013
- 2013-12-04 CN CN201310648982.0A patent/CN103625662B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2165942A (en) * | 1984-10-24 | 1986-04-23 | Hajime Industries | Surface inspection apparatus |
CN1400806A (en) * | 2001-07-31 | 2003-03-05 | 佳能株式会社 | Adaptive two-valued image processing method and equipment |
CN1442786A (en) * | 2003-04-09 | 2003-09-17 | 沈佐锐 | Microinsect automatic counting system |
CN1916598A (en) * | 2005-08-15 | 2007-02-21 | 中国农业大学 | Apparatus for measuring spectrum of fog drop, and image processing device |
CN101949819A (en) * | 2010-09-16 | 2011-01-19 | 北京优纳科技有限公司 | Cell counting method based on image identification |
Also Published As
Publication number | Publication date |
---|---|
CN103625662A (en) | 2014-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103686148B (en) | A Method of Automatically Detecting Video Image Definition Based on Digital Image Processing | |
CN107483014B (en) | A kind of photovoltaic panel failure automatic detection method | |
CN102175700B (en) | Method for detecting welding seam segmentation and defects of digital X-ray images | |
US20130136307A1 (en) | Method for counting objects and apparatus using a plurality of sensors | |
CN109685760B (en) | MATLAB-based SLM powder bed powder laying image convex hull depression defect detection method | |
CN103413311B (en) | A kind of fuzzy detection method based on edge | |
CN103456021B (en) | A kind of Fabric Defect detection method based on morphological analysis | |
CN110070523B (en) | A kind of foreign matter detection method for bottle bottom | |
CN111047655A (en) | High-definition camera cloth defect detection method based on convolutional neural network | |
US20120207379A1 (en) | Image Inspection Apparatus, Image Inspection Method, And Computer Program | |
CN108802052A (en) | A kind of detecting system and its detection method about slide fastener defect | |
CN102426698A (en) | Infrared image enhancement method | |
JP2013122455A (en) | Method and device for optically testing object to be tested during production and/or packing of cigarette | |
CN104966348B (en) | A kind of bill images key element integrality detection method and system | |
CN107545557A (en) | Egg detecting method and device in excrement image | |
CN104766310B (en) | light source detection system and detection method | |
CN114219758A (en) | Defect detection method, system, electronic device and computer readable storage medium | |
CN112967221B (en) | Shield segment production and assembly information management system | |
CN105678737A (en) | Digital image corner point detection method based on Radon transform | |
CN103625700B (en) | Quality detection method for pill filling | |
CN106353340A (en) | Surface defect detection method for rod-like high-reflectance part | |
CN107240109B (en) | Automatic detection method for instrument scale mark position | |
CN103625662B (en) | Method for detecting number of pills of filling machine | |
US20160205283A1 (en) | Method and apparatus for inspecting an object employing machine vision | |
CN109584212B (en) | MATLAB-based SLM powder bed powder laying image scratch defect identification method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20150708 Termination date: 20171204 |
|
CF01 | Termination of patent right due to non-payment of annual fee |