CN104528617A - Method for detecting liquid level of bottle body in accordance with filling requirements - Google Patents

Method for detecting liquid level of bottle body in accordance with filling requirements Download PDF

Info

Publication number
CN104528617A
CN104528617A CN201410757610.6A CN201410757610A CN104528617A CN 104528617 A CN104528617 A CN 104528617A CN 201410757610 A CN201410757610 A CN 201410757610A CN 104528617 A CN104528617 A CN 104528617A
Authority
CN
China
Prior art keywords
vertical direction
liquid level
search
horizontal direction
region
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
CN201410757610.6A
Other languages
Chinese (zh)
Other versions
CN104528617B (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 CN201410757610.6A priority Critical patent/CN104528617B/en
Publication of CN104528617A publication Critical patent/CN104528617A/en
Application granted granted Critical
Publication of CN104528617B publication Critical patent/CN104528617B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B67OPENING, CLOSING OR CLEANING BOTTLES, JARS OR SIMILAR CONTAINERS; LIQUID HANDLING
    • B67CCLEANING, FILLING WITH LIQUIDS OR SEMILIQUIDS, OR EMPTYING, OF BOTTLES, JARS, CANS, CASKS, BARRELS, OR SIMILAR CONTAINERS, NOT OTHERWISE PROVIDED FOR; FUNNELS
    • B67C3/00Bottling liquids or semiliquids; Filling jars or cans with liquids or semiliquids using bottling or like apparatus; Filling casks or barrels with liquids or semiliquids
    • B67C3/02Bottling liquids or semiliquids; Filling jars or cans with liquids or semiliquids using bottling or like apparatus
    • B67C3/22Details
    • B67C3/28Flow-control devices, e.g. using valves
    • B67C3/282Flow-control devices, e.g. using valves related to filling level control
    • B67C3/284Flow-control devices, e.g. using valves related to filling level control using non-liquid contact sensing means

Landscapes

  • Image Analysis (AREA)
  • Measurement Of Levels Of Liquids Or Fluent Solid Materials (AREA)

Abstract

The invention belongs to the technical field of digital image treatment, and provides a method for detecting the liquid level of a bottle body in accordance with filling requirements. The method comprises the following steps: (1) collecting an image according with the filled bottle body; (2) selecting a position area; (3) determining the position of a bottle head; (4) determining a reference search area and a reference point; (5) determining a liquid level search area; and (6) judging whether the liquid level accords with the filling requirements or not. According to the method, whether the liquid level of the filled medicine accords with the filling requirements can be rapidly, objectively and accurately detected; and the detection accuracy and efficiency of the medicine quality are improved.

Description

A kind of method detecting body liquid level and whether meet filling requirement
Art
The invention belongs to digital image processing, relate to a kind of method detecting body liquid level.
Background technology
Liquid drug in pouring process, filling deficiency or the excessive direct quality affecting medicine.At present, liquid drug filling after liquid level whether meet filling requirement mainly by artificial visually examine.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 and a kind ofly can detect whether body liquid level meets the method for inspection of filling requirement rapidly and accurately.This method of inspection can replace manually detecting, and overcomes the interference of subjective factor in manual detection process, can quick, objective, exactly detect filling after medicine liquid level whether meet filling requirement, improve the precision and efficiency of detecting of drug quality.Technical scheme of the present invention is as follows:
Detect the method whether body liquid level meets filling requirement, comprise the following steps:
(1) gather a width comprise filling after the image of body;
(2) regioselective region
This locating area is a rectangle frame, the length of rectangle frame horizontal direction is about 2 times of bottle head width, try one's best in the center of rectangular area horizontal direction and the center of bottle head width overlaps, and partial blank region more than bottle crown portion is included in rectangle frame, to guarantee to determine bottle position in crown portion exactly, each is detected body corresponding in this region;
(3) bottle head position is determined
After carrying out Threshold segmentation to the image gathered, obtain the first binary map, background is white, and target is black, and described threshold value is chosen according to standard below: make bottle head region be all black, and its peripheral region is white; According to the first binary map, horizontal direction and vertical direction projection are carried out respectively to the target in locating area in (2), find out in vertical direction projection the position Y1 that minimum point of counting is bottle vertical direction in crown portion, search for from the center of locating area horizontal direction respectively to both sides, find out in horizontal direction projection minimum point of counting, be respectively position X1 and X2 of bottle head both sides horizontal direction;
(4) Reference search zone and bench mark is determined
According to the position of bottle head in (3), with the position Y1 of bottle crown portion vertical direction for benchmark, offset downward different distances respectively, obtain the position on two limits of the rectangle frame vertical direction of Reference search zone, the center of Reference search frame horizontal direction and the center line of bottle head position are on same perpendicular line;
Respectively with position X1 and X2 of bottle head both sides horizontal direction for benchmark, inwardly, i.e. the center of Reference search zone horizontal direction, offsets certain distance, obtains the position on two limits of Reference search frame horizontal direction;
The size of Reference search zone is determined according to the size of reference area, reference area can be included in Reference search frame, and surrounding has certain space;
After carrying out Threshold segmentation to the image gathered, obtain the second binary map, described threshold value is chosen according to standard below: make reference area be all white, peripheral region is black.According to the second binary map, vertical direction projection is carried out to the target in Reference search zone, find out in vertical direction projection the position Y2 that maximum point of counting is bench mark vertical direction;
(5) liquid level region of search is determined
According to the position of bottle head in (3), with the position Y1 of bottle crown portion vertical direction for benchmark, offset downward different distances respectively, obtain the position on two limits of the vertical direction of liquid level region of search, the center of liquid level search box horizontal direction and the center line of bottle head position are on same perpendicular line;
Respectively with position X1 and X2 of bottle head both sides horizontal direction for benchmark, inwardly, i.e. the center of liquid level region of search horizontal direction, offsets certain distance, obtains the position on two limits of liquid level region of search horizontal direction;
After carrying out Threshold segmentation to the image gathered, obtain the 3rd binary map, described threshold value is chosen according to standard below: liquid level region is all black, and peripheral region is white.According to the 3rd described binary map, respectively vertical direction projection is carried out to the target and background in liquid level region of search, searches for from the top down, to find out in target vertical direction projection the position Y3 that first maximum of points is liquid level vertical direction center;
Then, be starting point with Y3, search for downwards, the position of counting that finding out from the projection of background vertical direction counts accounts for region of search width 70% is the position Y4 of liquid level nadir vertical direction;
(6) judge whether liquid level meets filling requirement
Difference D between the position Y2 of Calculation Basis point vertical direction and the position Y4 of liquid level nadir vertical direction, only have when the value of D is in preset range, liquid drug just meets filling requirement.
The present invention can detect quick, objective, exactly filling after medicine liquid level whether meet filling requirement, improve the precision and efficiency of detecting of drug quality.
Accompanying drawing explanation
The former figure of Fig. 1;
Fig. 2 locating area and being used for determines the binary picture of bottle head position;
Fig. 3 is used for determining the binary picture of benchmark;
Fig. 4 is used for determining the binary picture of liquid level;
Fig. 5 testing result figure.
Detailed description of the invention
Below in conjunction with drawings and Examples, the present invention will be described, see Fig. 1-5.
(1) piece image is gathered
This image size is 1280*960 pixel, may comprise one or more detection target (body) in image, but each is detected the body of certain fixed position in image, and the body of other position does not detect.
In this example, as shown in Figure 1, image size is 1280*960 pixel to the image of collection, will detect the body of midway location.
(2) regioselective region
This locating area is a rectangle frame.During owing to automatically detecting, the each position in the picture of body may be different, in order to ensure at least to exist in rectangle frame a complete body, the length of rectangle frame horizontal direction is about 2 times of bottle head width, and the center of rectangular area horizontal direction as far as possible and the center coincidence of bottle head width.The length of the vertical direction of rectangle frame is about 160 pixels, must ensure that the white space of 30 pixels in more than the Neng Jiangping crown, rectangular area portion is included (guaranteeing to determine bottle position in crown portion exactly), but can not exceed image range.Each is detected body corresponding in this region.
In this example, at the body place of midway location, regioselective region, rectangular area as shown in Figure 2.The cross-directional length of search locating area is 800 pixels, and vertical-direction length is 140 pixels.In the drawings, because range image edge, bottle crown portion is closer, as long as so ensure that the upper limb of region of search does not exceed image here.Meanwhile, ensure that try one's best in the center of region of search horizontal direction and the center of bottle head width overlaps, namely left and right is as far as possible symmetrical about body center shaft.
(3) bottle head position is determined
After carrying out Threshold segmentation to the image gathered, obtain the first binary map, background is white, and target is black, and described threshold value is chosen according to standard below: make bottle head region be all black, and its peripheral region is white.According to the first binary map, horizontal direction and vertical direction projection are carried out respectively to the target in locating area in step (2).Find out in vertical direction projection the position Y1 that minimum point of counting is bottle vertical direction in crown portion.Search for respectively to both sides from the center of locating area horizontal direction, find out in horizontal direction projection minimum point of counting, be respectively position X1 and X2 of bottle head both sides horizontal direction.
In this example, Threshold segmentation is carried out to the image in Fig. 1, obtain binary map as shown in Figure 2, and horizontal direction and vertical direction projection are carried out respectively to the stain in step (in 2) locating area.Find out in vertical direction projection the position Y1 that minimum point of counting is bottle vertical direction in crown portion.Search for respectively to both sides from the center of locating area horizontal direction, find out in vertical direction projection minimum point of counting, be respectively position X1 and X2 of bottle head both sides horizontal direction.The position of bottle crown portion and both sides can be determined thus, as shown in Figure 5.
(4) bench mark is determined
According to the position of bottle head in step (3), determine the region of search of benchmark.With the position Y1 of bottle crown portion vertical direction for benchmark, offset downward different distances respectively, obtain the position on two limits of the rectangle frame vertical direction of Reference search zone, the center of Reference search frame horizontal direction and the center line of bottle head position are on same perpendicular line.
Respectively with position X1 and X2 of bottle head both sides horizontal direction for benchmark, inwardly (i.e. the center of Reference search zone horizontal direction) offsets certain distance (about 100 pixels), obtains the position on two limits of Reference search frame horizontal direction.
The size of Reference search zone is determined according to the size of reference area, reference area can be included in Reference search frame, and surrounding has certain space (5 to 20 pixels).
After carrying out Threshold segmentation to the image gathered, obtain the second binary map, described threshold value is chosen according to standard below: make reference area be all white, peripheral region is black.According to the second binary map, vertical direction projection is carried out to the target in Reference search zone.Find out in vertical direction projection the position Y2 that maximum point of counting is bench mark vertical direction.
In this example, according to the value of Y1, X1 and X2 in step (3), Reference search zone is determined, intermediate rectangular region as shown in Figure 5.The position on two limits of the vertical direction of Reference search zone, is respectively Y1 and offsets downward 190 and 230 pixels; The position on two limits of Reference search zone horizontal direction, for X1 and X2 offsets 100 pixels respectively to interior (i.e. the center of Reference search zone horizontal direction).
Vertical direction projection is carried out to the white point in reference area, finds out in vertical direction projection the position Y2 that maximum point of counting is bench mark vertical direction, as the scribing position in Reference search zone in Fig. 5.
(5) liquid level is determined
According to the position of bottle head in step (3), determine the region of search of liquid level.With the position Y1 of bottle crown portion vertical direction for benchmark, offset downward different distances respectively, obtain the position on two limits of the vertical direction of liquid level region of search, the center of liquid level search box horizontal direction and the center line of bottle head position are on same perpendicular line.
Respectively with position X1 and X2 of bottle head both sides horizontal direction for benchmark, inwardly (i.e. the center of liquid level region of search horizontal direction) offsets certain distance (about 50 pixels), obtains the position on two limits of liquid level region of search horizontal direction.
After carrying out Threshold segmentation to the image gathered, obtain the 3rd binary map, described threshold value is chosen according to standard below: liquid level region is all black, and peripheral region is white.According to the 3rd described binary map, respectively vertical direction projection is carried out to the target and background in liquid level region of search.Search for from the top down, to find out in target vertical direction projection the position Y3 that first maximum of points is liquid level vertical direction center.
Then, be starting point with Y3, search for downwards, the position of counting that finding out from the projection of background vertical direction counts accounts for region of search width 70% is the position Y4 of liquid level nadir vertical direction.Here, should be from the projection of background vertical direction, find first maxim namely to think the position of liquid level nadir vertical direction in theory, but place has bubble sometimes due to liquid level, interference can be caused to the judgement of liquid level, so select the position of counting accounting for region of search width 70%, thus ensure to cause erroneous judgement because of bubble.
In this example., according to the value of Y1, X1 and X2 in step (3), determine liquid level region of search, bottom rectangle region as shown in Figure 5.The position on two limits of the vertical direction of liquid level region of search, is respectively Y1 and offsets downward 700 and 940 pixels; The position on two limits of Reference search zone horizontal direction, for X1 and X2 offsets 50 pixels respectively to interior (i.e. the center of Reference search zone horizontal direction).
Respectively vertical direction projection is carried out to the stain in liquid level region and white point, searches for from the top down, find out first maximum of points in the projection of stain vertical direction and be the position Y3 at liquid level vertical direction center; Be starting point with Y3, search for downwards, the position of counting that finding out from the projection of background vertical direction counts accounts for region of search width 70% is the position Y4 of liquid level nadir vertical direction.As the scribing position in liquid level region of search in Fig. 5.
(6) judge whether liquid level meets filling requirement
Obtain the difference D of the position Y2 of bench mark vertical direction and the position Y4 of liquid level vertical direction, only have when the value of Y5 is between setting range Dmin and Dmax, liquid drug just meets filling requirement.If the value of Y5 is greater than the maxim Dmax in setting range, so the filling deficiency of liquid drug is described; If the value of Y5 is less than the minimum value Dmin in setting range.So illustrate that liquid drug is filling excessive.
In this example, be 527 (units: pixel) by detecting the difference D of the Y4 in the Y2 that obtains in step (4) and step (5), according to Test Field demand, Dmin is set to 509, Dmax and is set to 590.Y5 is between 509 and 590.So this medicine meets filling requirement.

Claims (1)

1. detect the method whether body liquid level meets filling requirement, comprise the following steps:
(1) gather a width comprise filling after the image of body;
(2) regioselective region
This locating area is a rectangle frame, the length of rectangle frame horizontal direction is about 2 times of bottle head width, try one's best in the center of rectangular area horizontal direction and the center of bottle head width overlaps, and partial blank region more than bottle crown portion is included in rectangle frame, to guarantee to determine bottle position in crown portion exactly, each is detected body corresponding in this region;
(3) bottle head position is determined
After carrying out Threshold segmentation to the image gathered, obtain the first binary map, background is white, and target is black, and described threshold value is chosen according to standard below: make bottle head region be all black, and its peripheral region is white; According to the first binary map, horizontal direction and vertical direction projection are carried out respectively to the target in locating area in (2), find out in vertical direction projection the position Y1 that minimum point of counting is bottle vertical direction in crown portion, search for from the center of locating area horizontal direction respectively to both sides, find out in horizontal direction projection minimum point of counting, be respectively position X1 and X2 of bottle head both sides horizontal direction;
(4) Reference search zone and bench mark is determined
According to the position of bottle head in (3), with the position Y1 of bottle crown portion vertical direction for benchmark, offset downward different distances respectively, obtain the position on two limits of the rectangle frame vertical direction of Reference search zone, the center of Reference search frame horizontal direction and the center line of bottle head position are on same perpendicular line;
Respectively with position X1 and X2 of bottle head both sides horizontal direction for benchmark, inwardly, i.e. the center of Reference search zone horizontal direction, offsets certain distance, obtains the position on two limits of Reference search frame horizontal direction;
The size of Reference search zone is determined according to the size of reference area, reference area can be included in Reference search frame, and surrounding has certain space;
After carrying out Threshold segmentation to the image gathered, obtain the second binary map, described threshold value is chosen according to standard below: make reference area be all white, peripheral region is black.According to the second binary map, vertical direction projection is carried out to the target in Reference search zone, find out in vertical direction projection the position Y2 that maximum point of counting is bench mark vertical direction;
(5) liquid level region of search is determined
According to the position of bottle head in (3), with the position Y1 of bottle crown portion vertical direction for benchmark, offset downward different distances respectively, obtain the position on two limits of the vertical direction of liquid level region of search, the center of liquid level search box horizontal direction and the center line of bottle head position are on same perpendicular line;
Respectively with position X1 and X2 of bottle head both sides horizontal direction for benchmark, inwardly, i.e. the center of liquid level region of search horizontal direction, offsets certain distance, obtains the position on two limits of liquid level region of search horizontal direction;
After carrying out Threshold segmentation to the image gathered, obtain the 3rd binary map, described threshold value is chosen according to standard below: liquid level region is all black, and peripheral region is white.According to the 3rd described binary map, respectively vertical direction projection is carried out to the target and background in liquid level region of search, searches for from the top down, to find out in target vertical direction projection the position Y3 that first maximum of points is liquid level vertical direction center;
Then, be starting point with Y3, search for downwards, the position of counting that finding out from the projection of background vertical direction counts accounts for region of search width 70% is the position Y4 of liquid level nadir vertical direction;
(6) judge whether liquid level meets filling requirement
Difference D between the position Y2 of Calculation Basis point vertical direction and the position Y4 of liquid level nadir vertical direction, only have when the value of D is in preset range, liquid drug just meets filling requirement.
CN201410757610.6A 2014-12-10 2014-12-10 A kind of detect the method whether body liquid level meets fill requirement Active CN104528617B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410757610.6A CN104528617B (en) 2014-12-10 2014-12-10 A kind of detect the method whether body liquid level meets fill requirement

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410757610.6A CN104528617B (en) 2014-12-10 2014-12-10 A kind of detect the method whether body liquid level meets fill requirement

Publications (2)

Publication Number Publication Date
CN104528617A true CN104528617A (en) 2015-04-22
CN104528617B CN104528617B (en) 2016-06-29

Family

ID=52844315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410757610.6A Active CN104528617B (en) 2014-12-10 2014-12-10 A kind of detect the method whether body liquid level meets fill requirement

Country Status (1)

Country Link
CN (1) CN104528617B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109357703A (en) * 2018-11-30 2019-02-19 双峰格雷斯海姆医药包装(镇江)有限公司 A kind of medicine bottle bottle head direction detection device
CN116281815A (en) * 2023-05-22 2023-06-23 小仙炖霸州食品有限公司 Liquid quantitative filling equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102519972A (en) * 2011-12-10 2012-06-27 山东明佳包装检测科技有限公司 Detection method of PET bottle cap and liquid level

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102519972A (en) * 2011-12-10 2012-06-27 山东明佳包装检测科技有限公司 Detection method of PET bottle cap and liquid level

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
孙怀远,周夫之,陆尚卿: "机器视觉技术在药液灌装量检测中的应用", 《计算机应用与软件》, vol. 26, no. 6, 15 June 2009 (2009-06-15), pages 247 - 248 *
张建中,何召明,张树君,王庆,高锦哲: "一种PET瓶瓶盖和液位检测机的设计", 《机械工程师》, no. 3, 10 March 2014 (2014-03-10), pages 3 - 4 *
张树君,陈大千,辛莹莹,国磊,姜辉: "基于图像的PET瓶瓶盖和液位的检测设备", 《轻工机械》, vol. 31, no. 2, 20 April 2013 (2013-04-20), pages 71 - 73 *
黄玲,张叶林,胡波,马兆敏: "基于机器视觉的透明瓶装液体液位自动检测", 《自动化与仪表》, no. 2, 15 February 2012 (2012-02-15), pages 57 - 60 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109357703A (en) * 2018-11-30 2019-02-19 双峰格雷斯海姆医药包装(镇江)有限公司 A kind of medicine bottle bottle head direction detection device
CN109357703B (en) * 2018-11-30 2024-04-26 双峰格雷斯海姆医药包装(镇江)有限公司 Medical glass bottle head direction detection device
CN116281815A (en) * 2023-05-22 2023-06-23 小仙炖霸州食品有限公司 Liquid quantitative filling equipment

Also Published As

Publication number Publication date
CN104528617B (en) 2016-06-29

Similar Documents

Publication Publication Date Title
US20180068460A1 (en) Liquid Level Detecting System and Method thereof
CN113763350B (en) Glue line detection method and device, glue line detection equipment and storage medium
CN105046697B (en) A kind of beer bottleneck localization method assessed based on multiple random loop truss and degree of fitting
CN103063137B (en) A kind of medicine bottle measuring system based on machine vision and measuring method thereof
EP2911093A3 (en) Method and device for detecting straight line
RU2009102124A (en) VIDEO INFORMATION PROCESSING DEVICE FOR ALARM SYSTEM
CN104697476A (en) Automatic detection method and device for roughness light-incision profile curve
CN103149222A (en) Flaw detection device in real-time imaging of ray
CN105954301A (en) Bottleneck quality detection method based on machine vision
CN102988052B (en) Method and system for measuring foot length
CN111862055B (en) Bubble turning cavity defect detection method based on image processing
CN105865329A (en) Vision-based acquisition system for end surface center coordinates of bundles of round steel and acquisition method thereof
CN110148175B (en) Fermentation pit automatic positioning and boundary detection system and method based on two-dimensional label
CN105388165A (en) Defect monitoring method of polarizing film
CN108871185B (en) Method, device and equipment for detecting parts and computer readable storage medium
CN102798349A (en) Three-dimensional surface extraction method based on equal-gray line search
CN101858768A (en) Device and method for detecting liquid level after beverage filling process
CN104376573A (en) Image spot detecting method and system
CN102818544A (en) On-line measurement method for pitch circle center of automobile hub bolt hole and central eccentric distance of central hole
CN108844961A (en) A kind of temperature controller case vision detection system and method
CN104528617A (en) Method for detecting liquid level of bottle body in accordance with filling requirements
CN104316530A (en) Part detection method and application
CN104408727B (en) A kind of image border smear detecting method and system
KR101712489B1 (en) Method for measuring a pollution level of spot welding electrode tip using images
CN103163156A (en) Automatic grading method of lens defects based on machine vision technology

Legal Events

Date Code Title Description
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