CN103625662A - Method for detecting number of pills of filling machine - Google Patents

Method for detecting number of pills of filling machine Download PDF

Info

Publication number
CN103625662A
CN103625662A CN201310648982.0A CN201310648982A CN103625662A CN 103625662 A CN103625662 A CN 103625662A CN 201310648982 A CN201310648982 A CN 201310648982A CN 103625662 A CN103625662 A CN 103625662A
Authority
CN
China
Prior art keywords
filling
surveyed area
gray level
image
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310648982.0A
Other languages
Chinese (zh)
Other versions
CN103625662B (en
Inventor
李华伟
孟振
李凤婷
谌孙焕
关帅
卜学哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Puda Software Technology Co Ltd
Original Assignee
Tianjin Puda Software 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 Tianjin Puda Software Technology Co Ltd filed Critical Tianjin Puda Software Technology Co Ltd
Priority to CN201310648982.0A priority Critical patent/CN103625662B/en
Publication of CN103625662A publication Critical patent/CN103625662A/en
Application granted granted Critical
Publication of CN103625662B publication Critical patent/CN103625662B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

A kind of method that detects bottle placer amount of pills
Affiliated technical field
The invention belongs to digital image processing techniques field, relate to a kind of method that detects bottle placer amount of pills.
Background technology
In pill pouring process, the problem such as amount of pills is not enough, pill is incomplete directly affects 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 pill whether incompleteness and pill leaks down completely.Although manual detection is convenient, directly perceived, affected 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 the detection bottle placer amount of pills manually detect.Technical scheme of the present invention is as follows:
(1) gather the image for detection of bottle placer amount of pills, every width image comprises the status information of adjacent previous station after filling and the status information of a rear station before filling simultaneously;
(2) in the image gathering, 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 respectively Threshold segmentation, obtain respectively filling before and filling after the binary map of two surveyed areas, to each surveyed area, adopt following method to obtain and carry out the threshold value that surveyed area image is cut apart:
The first step, surveyed area image is carried out to grey level histogram calculating;
Second step, according to the result of calculation of grey level histogram, from gray level 0, start the direction that is greater than 0 towards gray level, number of times to the appearance of each gray level adds up, when cumulative value reaches the x% of surveyed area total number of image pixels, record the value of current gray level level, using the value of this value gray level minimum in surveyed area image;
The 3rd step, the direction that is less than 255 towards gray level from gray level 255 beginnings, number of times to the appearance of each gray level adds up, when cumulative value reaches the y% of surveyed area total number of image pixels, record the value of current gray level level, using the value of this value gray level maximum in surveyed area image;
The minimum value and the maxim that in the 4th step, taking-up above-mentioned steps, obtain, the threshold value that the gray level of the position of the z% between minimum value and maxim is cut apart as surveyed area image.
(4) respectively to filling front surveyed area and filling after the binary map of surveyed area carry out Blob analysis, judgement amount of pills: according to pill size, selecting circularity and the area of blob is filter condition, only have when the circularity of bolb is 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 respectively the amount of pills of filling front and back.
This method of inspection can replace manually detecting, and has overcome the interference of subjective factor in manual detection process, can be quick, objective, exactly detect filling before and the amount of pills of filling latter two station, improved the precision and efficiency of detecting of drug quality.
Accompanying drawing explanation
Fig. 1 image to be detected.
The filling front and filling rear surveyed area (region in grey circle) of Fig. 2.
Before Fig. 3 is filling, analyze the orifice region of the blob(Grey curves institute envelope obtaining with filling rear blob).
The specific embodiment
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 (not referring to same bag pill before filling in this image and after filling).The funnel in image left side is the filling front state before of pill, if amount of pills is sufficient, pill is filled all apertures in funnel.When funnel forwards to after right positions, the state of funnel is the state after filling, 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 respectively Threshold segmentation.
Hard-threshold dividing method is affected by brightness of image easily, for fear of picture brightness, to cutting apart, impacts, and utilizes method below to carry out Threshold segmentation to surveyed area image.Method is as follows: the first step, surveyed area image is carried out to grey level histogram calculating; Second step, according to the result of calculation of grey level histogram, from gray level 0, start the direction that is greater than 0 towards gray level, number of times to the appearance of each gray level adds up, when cumulative value reaches the x% of surveyed area total number of image pixels, record the value of current gray level level, using the value of this value gray level minimum in surveyed area image.From gray level 255, start the direction that is less than 255 towards gray level, number of times to the appearance of each gray level adds up, when cumulative value reaches the y% of surveyed area total number of image pixels (y value is set by the user), record the value of current gray level level, using the value of this value gray level maximum in surveyed area image; The 3rd step, take out the minimum value and the maxim that in second step, obtain, z%(z value between minimum value and maxim arranged by user) the threshold value cut apart as surveyed area image of the gray level of position.When darker noise is many, it is slightly large that x value should arrange; When brighter noise is many, it is slightly large that y value should arrange.
In the present embodiment, x, y, z is set to respectively 5,0,34.According to these three parameters, by filling front surveyed area with filling after the target and background of surveyed area separated, obtain respectively filling before and filling after the binary map of two surveyed areas.
(4) selecting circularity and the area of blob is filter condition, only has when the circularities of bolb is between 0.8 to 1.5 and area between 50 to 250 time, just thinks that this connect domain is blob.In Fig. 3, the orifice region of the Grey curves of left side funnel position institute envelope is all blob region of finding before filling; In Fig. 3, the orifice region of the Grey curves institute envelope of right side funnel position is all blob region of finding after filling; From Fig. 3 left side, can find out that blob number filling is 1 to be not equal to 0, thinks that the aperture in filling front funnel is not full of completely, amount of pills deficiency; From Fig. 3 right side, can find out that blob number filling is 20 to equal the aperture number in funnel, think that filling rear all pills all leak down, amount of pills is sufficient.

Claims (1)

1. a method that detects bottle placer amount of pills, comprises the following steps:
(1) gather the image for detection of bottle placer amount of pills, every width image comprises the status information of adjacent previous station after filling and the status information of a rear station before filling simultaneously;
(2) in the image gathering, 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 respectively Threshold segmentation, obtain respectively filling before and filling after the binary map of two surveyed areas, to each surveyed area, adopt following method to obtain and carry out the threshold value that surveyed area image is cut apart:
The first step, surveyed area image is carried out to grey level histogram calculating;
Second step, according to the result of calculation of grey level histogram, from gray level 0, start the direction that is greater than 0 towards gray level, number of times to the appearance of each gray level adds up, when cumulative value reaches the x% of surveyed area total number of image pixels, record the value of current gray level level, using the value of this value gray level minimum in surveyed area image;
The 3rd step, the direction that is less than 255 towards gray level from gray level 255 beginnings, number of times to the appearance of each gray level adds up, when cumulative value reaches the y% of surveyed area total number of image pixels, record the value of current gray level level, using the value of this value gray level maximum in surveyed area image;
The minimum value and the maxim that in the 4th step, taking-up above-mentioned steps, obtain, the threshold value that the gray level of the position of the z% between minimum value and maxim is cut apart as surveyed area image.
(4) respectively to filling front surveyed area and filling after the binary map of surveyed area carry out Blob analysis, judgement amount of pills: according to pill size, selecting circularity and the area of blob is filter condition, only have when the circularity of bolb is 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 respectively the amount of pills of filling front and back.
CN201310648982.0A 2013-12-04 2013-12-04 Method for detecting number of pills of filling machine Expired - Fee Related CN103625662B (en)

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 true CN103625662A (en) 2014-03-12
CN103625662B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
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 (6)

* Cited by examiner, † Cited by third party
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
US20080186347A1 (en) * 1992-09-29 2008-08-07 Ricoh Company, Ltd Ink jet recording method and head
CN101949819A (en) * 2010-09-16 2011-01-19 北京优纳科技有限公司 Cell counting method based on image identification

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2165942A (en) * 1984-10-24 1986-04-23 Hajime Industries Surface inspection apparatus
US20080186347A1 (en) * 1992-09-29 2008-08-07 Ricoh Company, Ltd Ink jet recording method and head
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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103991589A (en) * 2014-03-14 2014-08-20 南京大树智能科技股份有限公司 Tablet lacking detection system for medicine in tablet

Also Published As

Publication number Publication date
CN103625662B (en) 2015-07-08

Similar Documents

Publication Publication Date Title
US9087258B2 (en) Method for counting objects and apparatus using a plurality of sensors
CN104392468B (en) Based on the moving target detecting method for improving visual background extraction
CN102175700B (en) Method for detecting welding seam segmentation and defects of digital X-ray images
CN107483014B (en) A kind of photovoltaic panel failure automatic detection method
CN103454285A (en) Transmission chain quality detection system based on machine vision
CN107093174B (en) A kind of PCB design defect inspection method
CN103051872B (en) Based on the belt deflection detection method of Edge extraction
CN102621154B (en) Method and device for automatically detecting cloth defects on line based on improved differential box multi-fractal algorithm
US20120207379A1 (en) Image Inspection Apparatus, Image Inspection Method, And Computer Program
CN106067177A (en) HDR scene method for detecting and device
CN102426698A (en) Method for enhancing infrared image
CN103308523A (en) Method for detecting multi-scale bottleneck defects, and device for achieving method
JP2013122455A (en) Method and device for optically testing object to be tested during production and/or packing of cigarette
CN104700423A (en) Method and device for detecting bottle cap
CN103852034A (en) Elevator guide rail perpendicularity detection method
CN103245666B (en) Automatic detecting method for appearance defects of storage battery polar plate
CN103625700B (en) Quality detection method for pill filling
CN103606166A (en) Pill filling image segmentation method
CN102663781A (en) Sub-pixel level welding center extraction method based on visual sense
CN112967221A (en) Shield constructs section of jurisdiction production and assembles information management system
CN103625662B (en) Method for detecting number of pills of filling machine
CN111008960B (en) Aluminum electrolytic capacitor bottom appearance detection method and device based on machine vision
CN105572133A (en) Flaw detection method and device
CN103604806B (en) A kind of method detecting O-ring seal defect
JP5776378B2 (en) Crossover measuring device by image processing

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150708

Termination date: 20171204