CN104528617B - A kind of detect the method whether body liquid level meets fill requirement - Google Patents

A kind of detect the method whether body liquid level meets fill requirement Download PDF

Info

Publication number
CN104528617B
CN104528617B CN201410757610.6A CN201410757610A CN104528617B CN 104528617 B CN104528617 B CN 104528617B CN 201410757610 A CN201410757610 A CN 201410757610A CN 104528617 B CN104528617 B CN 104528617B
Authority
CN
China
Prior art keywords
liquid level
region
vertical direction
bottle head
search
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
Application number
CN201410757610.6A
Other languages
Chinese (zh)
Other versions
CN104528617A (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 digital image processing techniques field, it is provided that a kind of detect the method whether body liquid level meets fill requirement, comprise the following steps: that (1) gathers a width and comprises the image of the body after fill;(2) regioselective region;(3) bottle head position is determined;(4) Reference search zone and datum mark are determined;(5) liquid level region of search is determined;(6) judge whether liquid level meets fill requirement.The present invention can detect fill quick, objective, exactly after medicine liquid level whether meet fill requirement, improve the precision and efficiency of detecting of drug quality.

Description

A kind of detect the method whether body liquid level meets fill requirement
Art
The invention belongs to Digital Image Processing, relate to a kind of method detecting body liquid level.
Background technology
Liquid drug is in pouring process, and fill is not enough or the excessive quality directly affecting medicine.At present, whether the liquid level after liquid drug fill meets fill and requires mainly by artificial range estimation.Although manual detection is convenient, directly perceived, but is affected greatly by subjective factors, workman works long hours and easily causes visual fatigue, it may appear that misjudgment, and then affects drug quality.
Summary of the invention
It is an object of the invention to provide and a kind of can detect whether body liquid level meets the detection method of fill requirement rapidly and accurately.This detection method can replace manually detecting, and overcomes the interference of subjective factors in manual detection process, can quick, objective, detect fill exactly after medicine liquid level whether meet fill requirement, improve the precision and efficiency of detecting of drug quality.Technical scheme is as follows:
A kind of detect the method whether body liquid level meets fill requirement, comprise the following steps:
(1) gather a width and comprise the image of the body after fill;
(2) regioselective region
This region, location is a rectangle frame, the length of rectangle frame horizontal direction is about 2 times of bottle head width, the center of rectangular area horizontal direction overlaps with the center of bottle head width as far as possible, and bottle head above part white space is included in rectangle frame, to guarantee to accurately determine the position of bottle head, only body corresponding in this region is detected every time;
(3) bottle head position is determined
After the image gathered is carried out Threshold segmentation, obtaining the first binary map, background is white, and target is black, and described threshold value is chosen according to following standard: making bottle head region is all black, and region is white about;According to the first binary map, target in region, location in (2) is horizontally and vertically projected respectively, find out the position Y1 that minimum point of counting in vertical direction projection is the vertical direction of bottle head, scan for both sides respectively from the center of region, location horizontal direction, find out count in horizontal direction projection minimum point, respectively position X1 and the X2 of bottle head both sides horizontal direction;
(4) Reference search zone and datum mark are determined
According to the position of bottle head in (3), with the position Y1 of bottle head vertical direction for benchmark, offset different distances separately down, obtain the center line of the position on two limits of the rectangle frame vertical direction of Reference search zone, the center of Reference search frame horizontal direction and bottle head position on same vertical line;
Respectively with position X1 and the X2 of bottle head both sides horizontal direction for benchmark, inwardly, i.e. the center of Reference search zone horizontal direction, offset certain distance, obtain 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, can be included in Reference search frame by reference area, and surrounding has certain space;
After the image gathered is carried out Threshold segmentation, obtaining the second binary map, described threshold value is chosen according to following standard: making reference area is all white, and peripheral region is black.According to the second binary map, the target in Reference search zone is carried out vertical direction projection, find out maximum point of counting in vertical direction projection and be the position Y2 of datum 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 head vertical direction for benchmark, offset different distances separately down, obtain the center line of 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 bottle head position on same vertical line;
Respectively with position X1 and the X2 of bottle head both sides horizontal direction for benchmark, inwardly, i.e. the center of liquid level region of search horizontal direction, offset certain distance, obtain the position on two limits of liquid level region of search horizontal direction;
After the image gathered is carried out Threshold segmentation, obtaining the 3rd binary map, described threshold value is chosen according to following standard: liquid level region is all black, and peripheral region is white.According to the 3rd described binary map, the target and background in liquid level region of search is carried out respectively vertical direction projection, searches for from the top down, find out in target vertical direction projection first maximum of points and be the position Y3 at liquid level vertical direction center;
Then, with Y3 for starting point, search for downwards, find out, projecting from background vertical direction, the position counted accounting for region of search width 70% of counting and be the position Y4 of liquid level minimum point vertical direction;
(6) judge whether liquid level meets fill requirement
Calculating the difference D between the position Y2 and the position Y4 of liquid level minimum point vertical direction of datum mark vertical direction, only when the value of D is in preset range, liquid drug just meets fill requirement.
The present invention can detect fill quick, objective, exactly after medicine liquid level whether meet fill requirement, improve the precision and efficiency of detecting of drug quality.
Accompanying drawing explanation
Fig. 1 artwork;
Fig. 2 positions region and for determining 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, referring to Fig. 1-5.
(1) piece image is gathered
This image is sized to 1280*960 pixel, is likely to comprise one or more detection target (body), but only the body of certain fixed position in image is detected every time in image, and the body of other position does not detect.
In this example, the body in centre position, as it is shown in figure 1, image is sized to 1280*960 pixel, will be detected by the image of collection.
(2) regioselective region
This region, location is a rectangle frame.During owing to automatically detecting, the each position in the picture of body is likely to difference, in order to ensure at least there is a complete body in rectangle frame, the length of rectangle frame horizontal direction is about 2 times of bottle head width, and the center of rectangular area horizontal direction overlaps with the center of bottle head width as far as possible.The length of the vertical direction of rectangle frame is about 160 pixels, it is necessary to assure the white space of more than bottle head 30 pixels can be included (position guaranteeing to accurately determine bottle head) by rectangular area, but can not exceed image range.Only body corresponding in this region is detected every time.
In this example, in the body place in centre position, regioselective region, rectangular area as shown in Figure 2.The cross-directional length in region, search location is 800 pixels, and vertical-direction length is 140 pixels.In the drawings, owing to bottle head range image edge is closer, as long as so the top edge of guarantee region of search is without departing from image here.Simultaneously, it is ensured that the center of region of search horizontal direction overlaps with the center of bottle head width as far as possible, and namely left and right is as far as possible substantially symmetrical about its central axis about body.
(3) bottle head position is determined
After the image gathered is carried out Threshold segmentation, obtaining the first binary map, background is white, and target is black, and described threshold value is chosen according to following standard: making bottle head region is all black, and region is white about.According to the first binary map, the target in region, location in step (2) is horizontally and vertically projected respectively.Find out the position Y1 that minimum point of counting in vertical direction projection is the vertical direction of bottle head.Scan for both sides respectively from the center of region, location horizontal direction, find out count in horizontal direction projection minimum point, respectively position X1 and the X2 of bottle head both sides horizontal direction.
In this example, the image in Fig. 1 is carried out Threshold segmentation, obtain binary map as shown in Figure 2, and the stain that step (in 2) is positioned in region horizontally and vertically projects respectively.Find out the position Y1 that minimum point of counting in vertical direction projection is the vertical direction of bottle head.Scan for both sides respectively from the center of region, location horizontal direction, find out count in vertical direction projection minimum point, respectively position X1 and the X2 of bottle head both sides horizontal direction.Thus may determine that the position of bottle head and both sides, as shown in Figure 5.
(4) datum mark is determined
According to the position of bottle head in step (3), it is determined that the region of search of benchmark.With the position Y1 of bottle head vertical direction for benchmark, offset different distances separately down, obtain the center line of the position on two limits of the rectangle frame vertical direction of Reference search zone, the center of Reference search frame horizontal direction and bottle head position on same vertical line.
Respectively with position X1 and the 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, can be included in Reference search frame by reference area, and surrounding has certain space (5 to 20 pixels).
After the image gathered is carried out Threshold segmentation, obtaining the second binary map, described threshold value is chosen according to following standard: making reference area is all white, and peripheral region is black.According to the second binary map, the target in Reference search zone is carried out vertical direction projection.Find out maximum point of counting in vertical direction projection and be the position Y2 of datum mark vertical direction.
In this example, according to the value of Y1, X1 and X2 in step (3), it is determined that Reference search zone, intermediate rectangular region as shown in Figure 5.The position on two limits of the vertical direction of Reference search zone, respectively Y1 offsets downward 190 and 230 pixels;The position on two limits of Reference search zone horizontal direction, for X1 and X2, (i.e. the center of Reference search zone horizontal direction) offsets 100 pixels respectively inwards.
White point in reference area is carried out vertical direction projection, finds out maximum point of counting in vertical direction projection and be the position Y2 of datum mark vertical direction, 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), it is determined that the region of search of liquid level.With the position Y1 of bottle head vertical direction for benchmark, offset different distances separately down, obtain the center line of 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 bottle head position on same vertical line.
Respectively with position X1 and the 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 the image gathered is carried out Threshold segmentation, obtaining the 3rd binary map, described threshold value is chosen according to following standard: liquid level region is all black, and peripheral region is white.According to the 3rd described binary map, the target and background in liquid level region of search is carried out respectively vertical direction projection.Search for from the top down, find out in target vertical direction projection first maximum of points and be the position Y3 at liquid level vertical direction center.
Then, with Y3 for starting point, search for downwards, find out, projecting from background vertical direction, the position counted accounting for region of search width 70% of counting and be the position Y4 of liquid level minimum point vertical direction.Here, should be find first maximum namely to think the position of liquid level minimum point vertical direction from the projection of background vertical direction in theory, but owing to liquid level place has bubble sometimes, the judgement of liquid level can be interfered, so selecting to account for the position counted of region of search width 70%, thus ensureing to cause erroneous judgement because of bubble.
In this example., according to the value of Y1, X1 and X2 in step (3), it is determined that 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, respectively Y1 offsets downward 700 and 940 pixels;The position on two limits of Reference search zone horizontal direction, for X1 and X2, (i.e. the center of Reference search zone horizontal direction) offsets 50 pixels respectively inwards.
Stain in liquid level region and white point are carried out vertical direction projection respectively, 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;With Y3 for starting point, search for downwards, find out, projecting from background vertical direction, the position counted accounting for region of search width 70% of counting and be the position Y4 of liquid level minimum point vertical direction.The scribing position in liquid level region of search in Fig. 5.
(6) judge whether liquid level meets fill requirement
Obtaining the position Y2 of datum mark vertical direction and the difference D of the position Y4 of liquid level vertical direction, only when the value of Y5 is between set point Dmin and Dmax, liquid drug just meets fill requirement.If the value of Y5 is more than the maximum Dmax in set point, then illustrate that liquid drug fill is not enough;If the value of Y5 is less than the minima Dmin in set point,.So illustrate that liquid drug fill is excessive.
In this example, being 527 (units: pixel) by detecting the difference D obtaining the Y2 in step (4) and the Y4 in step (5), according to detection field demand, Dmin is set to 509, Dmax and is set to 590.Y5 is between 509 and 590.So this medicine meets fill requirement.

Claims (1)

1. detect the method whether body liquid level meets fill requirement, comprise the following steps:
(1) gather a width and comprise the image of the body after fill;
(2) regioselective region
This region, location is a rectangle frame, the length of rectangle frame horizontal direction is 2 times of bottle head width, the center of rectangular area horizontal direction overlaps with the center of bottle head width as far as possible, and bottle head above part white space is included in rectangle frame, to guarantee to accurately determine the position of bottle head, only body corresponding in this region, location is detected every time;
(3) bottle head position is determined
After the image gathered is carried out Threshold segmentation, obtaining the first binary map, background is white, and target is black, and described threshold value is chosen according to following standard: making bottle head region is all black, and region is white about;According to the first binary map, target in region, location in (2) is horizontally and vertically projected respectively, find out the position Y1 that minimum point of counting in vertical direction projection is the vertical direction of bottle head, scan for both sides respectively from the center of region, location horizontal direction, find out count in horizontal direction projection minimum point, respectively position X1 and the X2 of bottle head both sides horizontal direction;
(4) Reference search zone and datum mark are determined
According to the position of bottle head in (3), with the position Y1 of bottle head vertical direction for benchmark, offset different distances separately down, obtain the center line of the position on two limits of the rectangle frame vertical direction of Reference search zone, the center of Reference search frame horizontal direction and bottle head position on same vertical line;
Respectively with position X1 and the X2 of bottle head both sides horizontal direction for benchmark, inwardly, i.e. the center of Reference search zone horizontal direction, offset certain distance, obtain 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, can be included in Reference search frame by reference area, and surrounding has certain space;
After the image gathered is carried out Threshold segmentation, obtaining the second binary map, described threshold value is chosen according to following standard: making reference area is all white, and peripheral region is black;According to the second binary map, the target in Reference search zone is carried out vertical direction projection, find out maximum point of counting in vertical direction projection and be the position Y2 of datum 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 head vertical direction for benchmark, offset different distances separately down, obtain the center line of 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 bottle head position on same vertical line;
Respectively with position X1 and the X2 of bottle head both sides horizontal direction for benchmark, inwardly, i.e. the center of liquid level region of search horizontal direction, offset certain distance, obtain the position on two limits of liquid level region of search horizontal direction;
After the image gathered is carried out Threshold segmentation, obtaining the 3rd binary map, described threshold value is chosen according to following standard: liquid level region is all black, and peripheral region is white;According to the 3rd described binary map, the target and background in liquid level region of search is carried out respectively vertical direction projection, searches for from the top down, find out in target vertical direction projection first maximum of points and be the position Y3 at liquid level vertical direction center;
Then, with Y3 for starting point, search for downwards, find out, projecting from background vertical direction, the position counted accounting for region of search width 70% of counting and be the position Y4 of liquid level minimum point vertical direction;
(6) judge whether liquid level meets fill requirement
Calculating the difference D between the position Y2 and the position Y4 of liquid level minimum point vertical direction of datum mark vertical direction, only when the value of D is in preset range, liquid drug just meets fill 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 CN104528617A (en) 2015-04-22
CN104528617B true 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)

Families Citing this family (2)

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

Family Cites Families (1)

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

Also Published As

Publication number Publication date
CN104528617A (en) 2015-04-22

Similar Documents

Publication Publication Date Title
US20180068460A1 (en) Liquid Level Detecting System and Method thereof
CN109752392B (en) PCB defect type detection system and method
CN110838097A (en) Conveyor belt offset measurement method based on machine vision
CN111696077A (en) Wafer defect detection method based on wafer Det network
CN107945155B (en) Toothpaste tube shoulder defect detection method based on Gabor filter
JP2014235750A (en) Target detection method and target detection device
CN113763350B (en) Glue line detection method and device, glue line detection equipment and storage medium
CN102988052B (en) Method and system for measuring foot length
CN105930762A (en) Eyeball tracking method and device
CN105021628A (en) Detection method for surface defects of optical fiber image inverter
JP6261266B2 (en) Moving body detection device
KR102010823B1 (en) Method and apparatus for measuring speed of vehicle by using fixed single camera
NZ591722A (en) Obstacle detection system for use with mobile machines includes inverting image and assigning each pixel of the image one of two values
CN103051872A (en) Method for detecting conveyor belt deviation based on image edge extraction
CN105388165A (en) Defect monitoring method of polarizing film
JP6197340B2 (en) Image processing apparatus, image processing method, and program
CN105954301A (en) Bottleneck quality detection method based on machine vision
CN104282018A (en) Method for on-line detection of overall diameter of industrial product based on machine vision
CN104528617B (en) A kind of detect the method whether body liquid level meets fill requirement
CN105865329A (en) Vision-based acquisition system for end surface center coordinates of bundles of round steel and acquisition method thereof
CN102854195B (en) Method for detecting defect coordinates on color filter
CN104376573A (en) Image spot detecting method and system
CN107014821B (en) Plastic self-sealing bag detection system and method
CN104477461B (en) A kind of liquid medicine filling substandard product elimination method
CN103185546A (en) Width measuring method and system

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