CN107680079A - The high-speed parallel visible detection method of visible foreign matters in a kind of medical pharmacy - Google Patents

The high-speed parallel visible detection method of visible foreign matters in a kind of medical pharmacy Download PDF

Info

Publication number
CN107680079A
CN107680079A CN201710784299.8A CN201710784299A CN107680079A CN 107680079 A CN107680079 A CN 107680079A CN 201710784299 A CN201710784299 A CN 201710784299A CN 107680079 A CN107680079 A CN 107680079A
Authority
CN
China
Prior art keywords
image
template
area
images
accumulated
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
CN201710784299.8A
Other languages
Chinese (zh)
Other versions
CN107680079B (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.)
Hunan University
Original Assignee
Hunan University
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 Hunan University filed Critical Hunan University
Priority to CN201710784299.8A priority Critical patent/CN107680079B/en
Publication of CN107680079A publication Critical patent/CN107680079A/en
Application granted granted Critical
Publication of CN107680079B publication Critical patent/CN107680079B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01VGEOPHYSICS; GRAVITATIONAL MEASUREMENTS; DETECTING MASSES OR OBJECTS; TAGS
    • G01V9/00Prospecting or detecting by methods not provided for in groups G01V1/00 - G01V8/00
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/759Region-based matching

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • General Life Sciences & Earth Sciences (AREA)
  • Geophysics (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a kind of high-speed parallel visible detection method of visible foreign matters in medical pharmacy, comprise the steps of:Step 1:Gather image and pretreatment;Step 2:Constituency positioning is carried out using template matching method and translationai correction is carried out between frame sequence;Step 3:Quasi- foreign matter region is extracted using background difference method;Step 4:Template, static clear zone template, flash area template are highlighted using difference to be directed at foreign matter region and corrected;Step 5:Foreign matter statistical information is provided according to final result image.This method constructs concurrent processing thread according to sequence image frame number, and calculating process has high concurrent, can give full play to the calculating performance of multi-core processor, identifies quickly and accurately visible foreign matters.

Description

High-speed parallel visual detection method for visible foreign matters in medical medicament
Technical Field
The invention belongs to the field of computer vision, and particularly relates to a high-speed parallel visual detection method for visible foreign matters in medical medicaments.
Background
In China, the transparent liquid medicine made of glass packaging materials such as ampoules, infusion solutions, oral liquids and the like can appear in the liquid medicine due to the problems of the production process and the manufacturing technical level: and insoluble visible foreign matters such as glass scraps, fibers, hair, white spots, white blocks, color spots, color blocks, plastic scraps and the like. If the liquid medicine containing the visible foreign matters is injected into a human body, vascular embolism and allergic reaction can occur, and the life safety of a patient is threatened.
According to the GMP description in China: the "visible foreign substance" refers to an insoluble substance present in the injection and visually observed under a predetermined condition, and the particle diameter or length thereof is usually larger than 50 μm ". The injection should be produced under the condition of meeting the Good Manufacturing Practice (GMP), and the products should be inspected one by one and rejected unqualified products at the same time by adopting a proper method before leaving the factory. Therefore, in order to meet the corresponding drug production management regulations, all large pharmaceutical enterprises are provided with the light inspection darkroom, and a large number of light inspection workers are arranged to visually inspect the drugs one by one in the darkroom. The whole lamp inspection process is large in workload, low in efficiency, serious in visual damage to workers and poor in stability of detection results. Therefore, under the guidance of the national high-tech research and development program (863 program), a great deal of research and related work research is performed by enterprise workers in the field, but two problems still exist in the research on the visible foreign object detection algorithm: (1) The processing method with lower complexity and good real-time performance has more false detection and missed detection, and the anti-interference capability of the algorithm is weak; (2) The intelligent algorithm with strong anti-interference capability has larger time complexity, most of the algorithms firstly acquire the sequence images and then process the sequence images, so that the algorithm has larger hysteresis and is difficult to meet the requirement of real-time performance on a high-speed medicine manufacturing production line. Therefore, it is very important to develop a visual detection image processing algorithm for visible foreign matters with high speed and strong anti-interference capability.
Disclosure of Invention
The invention aims to solve the problems of large data volume and high complexity of foreign matter detection processing in the prior art, and provides a high-speed parallel visual detection method for visible foreign matters in medical medicaments under a high-speed parallel processing multithread framework.
A high-speed parallel visual detection method for visible foreign matters in medical medicaments comprises the following steps:
step 1: acquiring an image by using an image acquisition thread, triggering a corresponding image concurrent processing thread in real time according to the acquired image frame number in the image acquisition process, and preprocessing the acquired image in real time;
the preprocessing comprises filtering, offset correction and target area extraction;
step 2: acquiring an accumulated mean image by using a main control thread;
when the main control thread monitors that all the image concurrent processing threads finish preprocessing, accumulating all the preprocessed target area images to obtain an accumulated image, and carrying out mean processing on the accumulated image to obtain an accumulated mean image;
and step 3: sequentially constructing a static template image, a difference highlight template image and a flash template image by using a master control thread based on the accumulated mean image, and combining the constructed template images by using a morphology and image logic operation method to obtain a combined correction template image;
and 4, step 4: the main control thread utilizes the combined correction template image obtained in the step 3 to obtain an image by summing all secondary difference result images, performs combined correction, and performs open operation filtering on the image after the combined correction;
and 5: and the main control thread carries out non-zero element number statistics on the image subjected to the opening operation filtering to obtain the final visible foreign matter accumulation area, when the visible foreign matter accumulation area exceeds an accumulation area threshold value, the current detection result is a defective product, and otherwise, the current detection result is a genuine product.
And finishing image acquisition and image storage by using an image acquisition thread, and unlocking a thread lock of a corresponding processing thread according to the currently acquired frame number, such as: after the 1 st frame image of the sequence is obtained, starting a No. 1 processing thread corresponding to the 1 st frame image; and after the 2 nd frame image of the sequence is acquired, starting a No. 2 processing thread corresponding to the 2 nd frame image, and so on. The concurrent mode effectively utilizes the CPU idle in the image acquisition process, reduces the total processing time of the sequence images and improves the algorithm real-time property;
each camera corresponds to 1 image acquisition thread, N concurrent processing threads and 1 main control thread, and N is the frame number of images acquired in the process of one-time photographing. The concurrent processing thread completes the concurrent calculation part of the algorithm, when the algorithm meets the requirement of comprehensive calculation, the concurrent processing thread gives control right to the main control thread, and the main control thread restarts the subsequent calculation or outputs the result of the processing thread after executing the calculation;
the method comprises the steps of finishing information transmission between threads and synchronization between the threads in a mode of sharing a memory; the images to be processed and the sequence of intermediate images are stored in a continuous common memory.
Further, the static template image, the differential highlight template image and the flash template image are constructed as follows:
static template image: carrying out mean value fuzzy processing on the accumulated mean value image to obtain a fuzzy accumulated image, and constructing a static template image by using a pixel union set of accumulated mean value image pixels with values larger than a set static threshold value or larger than 1.5 times of the fuzzy accumulated image;
difference highlight template image: carrying out difference processing on all preprocessed target area images in sequence by utilizing the accumulated mean image, carrying out different mean fuzzy processing on all difference images twice in sequence, carrying out secondary difference on the images subjected to the mean fuzzy processing twice to obtain all secondary difference result images, merging pixels of the fuzzy accumulated images which are more than 1.5 times in all the secondary difference result images, and constructing a difference highlight template image;
flash template image: when the collected images in all the image concurrent processing threads are subjected to offset correction, pixels with pixel values larger than 2 in the flash area template marking images are used for solving and collecting to construct flash template images;
and the flash area template mark image is obtained by summing all pixels which are greater than a set flash threshold value in the secondary difference result image.
Further, the combined template image is obtained according to the following formula:
wherein T represents a combined template image, T static Representing a static template image, T flash Representing flash template image, T dBright Representing a differential luminance template image, S d Representing a 15X 15 rectangular structural element, S a A rectangular structural element representing 13 × 13, u represents a union operation,representing a logical or operation.
Further, the on-filter operation in step 4 is performed according to the following formula:
wherein R represents an image after an on-filter operation, B represents a flare template mark image, and S s Representing a control structure element and theta representing a logical on operation.
Further, when the current detection result is a defective product, morphological reconstruction is performed by sequentially using each secondary difference result image and the on-filter operation result image R, and image frames to which non-zero elements in the R belong are marked.
The specific operation is as follows: using R ^ (MD) i >Thresh diff ) Taking R as a template image as a marker image, and performing morphological reconstruction on 3 x 3 rectangular structural elements to obtain a reconstructed imageI.e. visible foreign matter, MD, is detected in the ith frame image i Represents the ith secondary difference result image, thresh diff Is a set flash threshold.
Further, the process of performing offset rectification by the image concurrent processing thread in step 1 is as follows:
step A: and expanding delta pixels outwards according to the manually set positioning matching template area to form a positioning matching search area: rect is search ={P x -δ,P y -δ,Rw+2δ,Rh+2δ};
The positioning matching template area is a bottle bottom part Rect fixedly selected from an original image template ={P x ,P y ,Rw,Rh},(P x ,P y ) A rectangular area with width Rw and height Rh for the selected coordinates in the original image of the top left corner vertex of the bottle bottom part;
and B, step B: the positioning matching template area in the first frame image is used for matching and positioning in the positioning matching search area by using a normalized correlation coefficient method, and all normalized correlation coefficients R i (x, y) taking the position of the maximum value as a matching target position;
the calculation formula of the normalized correlation coefficient is as follows:
wherein T (x ', y') represents a location matching template region in the first frame image,S i representing a positioning matching search area in the ith image, wherein (x ', y') and (x, y) respectively represent pixel coordinates in a positioning matching template area in the first frame image and a positioning matching search area of an image to be subjected to offset correction;
step C: comparing the position of the matching target in each frame of image with the position of the central point of the positioning matching template area in the first frame of image to obtain the position offset of each frame of image relative to the first frame of imageCorrespondingly translating and correcting the visible foreign matter detection area according to the offset to obtain a corrected foreign matter detection area:i is a frame number, and the corresponding original image of the foreign object detection area is marked as In i
Further, in the process of collecting the image by the image collecting thread, an LED panel light source is adopted for backlight illumination.
Advantageous effects
The invention has the advantages that
(1) The highly parallelized multi-thread frame structure and the algorithm design ensure that the method has very high timeliness and can have excellent timeliness performance when more image data needing to be calculated is large;
the method comprises the steps that an image acquisition thread, a concurrent processing thread and a main control thread are used for completing image acquisition, concurrent processing, synchronization of the concurrent processing thread and summary calculation of intermediate results or results, wherein the three threads are real-time threads with the highest priority;
(2) The visible foreign matter detection has strong anti-interference capability, can overcome the interference caused by the problems of target photographing translation, bottle wall static dirt, refraction or reflection flash spots, uneven brightness and the like, and has high detection accuracy and less false detection;
(3) The method has wide applicability, and the algorithm can be popularized to the detection of visible foreign matters of daily-use products such as cylindrical bottles of beverages, white vinegar and alcohol; the image acquisition frame number is used as the concurrency number of the concurrent processing thread, when the length of the sequence image is adjusted, the algorithm does not need to be adjusted again, and when the performance of processing hardware is improved, the length of the acquisition sequence is only needed to be increased, so that a more excellent detection effect can be obtained.
Drawings
FIG. 1 is a block diagram of a multi-threaded computing framework in accordance with the present invention;
FIG. 2 is a timing diagram of the operation of the multi-thread parallel algorithm of the present invention;
FIG. 3 is a schematic diagram of a parallel image processing process according to the present invention;
FIG. 4 is a schematic view of the various zones of the present invention;
FIG. 5 is an image of the result of the algorithm of the present invention for detecting visible foreign objects in a large infusion bottle.
Detailed Description
The invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.
As shown in fig. 1 and fig. 2, the method for high-speed parallel visual inspection of visible foreign matters in medical preparations of the present invention comprises the following specific steps:
step 1: collecting images and preprocessing;
step 2: selecting regions and positioning by using a template matching method and performing translation correction among frame sequences;
and step 3: extracting a quasi foreign matter region by using a background difference method, and constructing anti-interference correction templates such as a static bright region template, a difference highlight template, a flash region template and the like by using a morphology and image logic operation method;
and 4, step 4: aligning the foreign body area by using an anti-interference correction template for correction;
and 5: and giving foreign matter statistical information according to the final result image.
In fig. 2, a concurrent processing thread i # executes matching operation after the fetch flag is turned on; when the accumulation lock is closed and the lock position is accumulated, differentiating, correcting, extracting a bright area, binarizing and then opening the correction lock; all operations respond when the global acquisition processing flag bit is TRUE.
The master control thread performs accumulation and related operations when the accumulation lock is completely opened, resets the accumulation lock after the accumulation lock is completed and sets an accumulation completion mark; when the correcting lock is completely opened, correcting and relevant operations are carried out, and resetting and outputting are carried out after the correction is finished;
in step 1, a corresponding concurrent processing thread is started according to the acquired image, a 3 × 3 median filtering operation is performed on the image in the concurrent processing thread, and the filtered image after the operation is marked as I i I is a frame number; if the collected image is the 1 st frame in the frame sequence, selecting a fixed area Rect of the bottle bottom part template ={P x ,P y Image of Rw, rh } as matching localization template T in step 2, where (P) x ,P y ) Is the upper left corner point image coordinate of the selected fixed region, rw and Rh are the width and height of the region, respectively, and the total number of acquisition frames is recorded as N.
The concrete implementation steps of the step 2 are as follows:
(1) the locating matching search area is formed by expanding delta (delta = 40) pixels outwards according to the locating matching template area which is manually set: rect is search ={P x -δ,P y Delta, rw +2 delta, rh +2 delta, and taking I i Partial image of the middle search area, denoted as S i
(2) Image S in matching search area using matching template T i The normalized cross correlation coefficient is matched, and the calculation formula of the normalized cross correlation coefficient is as follows:
in the formula, i is the frame number, x belongs to [1, rw +2 δ ], and y belongs to [1, rh +2 δ ].
At R i And (x, y) taking the position of the maximum value as a matching target position.
(3) According to each frameThe position of the matching target in the image is compared with the position of the matching template region in the first frame image to give a positional offset with respect to the first frame imageCorrespondingly translating and correcting the visible foreign matter detection area according to the offset to obtain a corrected foreign matter detection area:i is a frame number, and the corresponding original image of the foreign object detection area is marked as In i
The visible foreign object detection area, the matching location search area and the matching location template area are schematically shown in fig. 4;
as shown in fig. 3, the specific implementation steps of step 3 are as follows:
(1) in the concurrent processing thread, the visible foreign matter detection area image of each image is superposed into a common accumulated image, after the completion, the accumulated lock of the current thread is set to be true, and the calculation formula is as follows.
Wherein i is the frame number, N is the total frame number, x belongs to [0, inW ], y belongs to [0, inH ].
(2) And in the main control thread, detecting the current state of the accumulation lock of each processing thread, and when all frames are accumulated, averaging the accumulated image to obtain an accumulated average image:
(3) and carrying out M × M (M = 51) mean value blurring on the accumulated mean value image in the main control thread to obtain a blurred accumulated mean value image: .
(4) And in the main control thread, constructing a static template image, wherein a calculation formula of a construction process is as follows:
T static (x,y)=(I average (x,y)>1.5·SI average )∪(I average (x,y)>Thresh static )
among them, thresh static Is a fixed threshold with a larger value, and the value range is [120,254 ]]The method aims to directly identify the area in the cumulative mean image which is too bright as the bottle wall static area, and can overcome the defect that constant large bright spots sometimes cannot pass through I average And SI average The comparative relationship of (a).
(5) And in the concurrent processing thread, obtaining a difference image by using a background difference method:
D i (x,y)=In i (x,y)-I average (x,y) (5)
(6) and in the concurrent processing thread, performing mean value blurring of N × N (N = 2) and K × K (K = 29) on the difference image respectively, and performing secondary difference operation by using the blurred image:
(7) and in the concurrent processing thread, constructing a difference highlight template image, wherein a calculation formula of a construction process is as follows:
T dBright (x,y)=T dBright (x,y)∪(MD i >1.5·SI average (x,y)) (7)
(8) in the concurrent processing thread, constructing a flash area template mark image B, wherein the calculation formula of the construction process is as follows:
B=B+(MD i >Thresh diff ) (8)
the remediation lock for the current thread is set to true after the build is complete.
(9) And in the main control thread, detecting the current state of the correction lock of each concurrent processing thread, and when the correction locks of all the processing threads are true, using the flash area template mark image to construct a flash template image, wherein the formula is as follows:
T flash (x,y)=B(x,y)>2 (9)
the specific implementation steps of the step 4 are as follows:
(1) combining the correction template in the main control thread, and using a rectangular structural element S of L multiplied by L (L = 15) d The or operation results of the static bright template and the flash template are expanded once, and H × H (H = 13) rectangular structural element S is used a And (3) expanding the difference highlight template image for the first time, and subtracting the two results to construct a formula as follows:
(2) in the main control thread, the combined correction template is used for correcting the difference result, and the size control rectangular structural element S is used s Performing one-time on-operation filtering on the corrected result image to obtain a structural element S s The size is not less than 1, the detection precision can be set according to the detection precision requirement, and the algorithm filters out visible foreign matters smaller than the size of the structural element, namely the structural element S s The larger the size, the more visible foreign matter is filtered out. The following formula:
and R is a final result image of the detection of the visible foreign matters.
The concrete implementation steps of the step 5 are as follows:
(1) and counting the number of non-zero elements in the R to obtain the final accumulation area of the visible foreign matters, and when the area exceeds an accumulation area threshold value, giving the detection result: substandard product, otherwise given: and (5) quality control.
(2) And if the detection result is a defective product, using the result image R in the step 4 and the difference binarization image MD in the step 2.6 i And performing morphological reconstruction, and marking the image frame to which the non-zero element in the R belongs.
The specific operation is as follows: using R ^ (MD) i >Thresh diff ) Taking R as a template image as a marker image, and performing morphological reconstruction on 3 x 3 rectangular structural elements to obtain a reconstructed imageThat is, the detected visible alien material appearing in the ith frame image, the detection result is shown in fig. 5.
The specific embodiments described herein are merely illustrative of the spirit of the invention. Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.

Claims (7)

1. A high-speed parallel visual detection method for visible foreign matters in medical medicaments is characterized by comprising the following steps:
step 1: acquiring an image by using an image acquisition thread, triggering a corresponding image concurrent processing thread in real time according to the acquired image frame number in the image acquisition process, and preprocessing the acquired image in real time;
the preprocessing comprises filtering, offset correction and target area extraction;
and 2, step: acquiring an accumulated mean image by using a main control thread;
when the main control thread monitors that all the image concurrent processing threads finish preprocessing, accumulating all the preprocessed target area images to obtain an accumulated image, and carrying out mean processing on the accumulated image to obtain an accumulated mean image;
and step 3: sequentially constructing a static template image, a difference highlight template image and a flash template image by using a master control thread based on the accumulated mean value image, and combining the constructed template images by using a morphology and image logic operation method to obtain a combined correction template image;
and 4, step 4: the main control thread utilizes the combined correction template image obtained in the step 3 to carry out combined correction on the image obtained by summing all the secondary difference result images and carry out open operation filtering on the image after combined correction;
and 5: and the main control thread carries out non-zero element number statistics on the image subjected to the opening operation filtering to obtain the final visible foreign matter accumulation area, when the visible foreign matter accumulation area exceeds an accumulation area threshold value, the current detection result is a defective product, and otherwise, the current detection result is a genuine product.
2. The method of claim 1, wherein the static template image, the differential highlight template image and the flash template image are constructed as follows:
static template image: carrying out mean value fuzzy processing on the accumulated mean value image to obtain a fuzzy accumulated image, and constructing a static template image by using a pixel union set of accumulated mean value image pixels with values larger than a set static threshold value or larger than 1.5 times of the fuzzy accumulated image;
difference highlight template image: carrying out difference processing on all preprocessed target area images in sequence by utilizing the accumulated mean image, carrying out different mean fuzzy processing on all difference images twice in sequence, carrying out secondary difference on the images subjected to the mean fuzzy processing twice to obtain all secondary difference result images, merging pixels of the fuzzy accumulated images which are more than 1.5 times in all the secondary difference result images, and constructing a difference highlight template image;
flash template image: when the collected images in all the image concurrent processing threads are subjected to offset correction, pixels with pixel values larger than 2 in the flash area template marking images are used for solving and collecting to construct flash template images;
and the flash area template mark image is obtained by summing all pixels which are greater than a set flash threshold value in the secondary difference result image.
3. The method of claim 2, wherein: the combined template image is obtained according to the following formula:
wherein T represents a composite template image, T static Representing a static template image, T flash Representing flash template image, T dBright Representing a differential luminance template image, S d Representing a 15X 15 rectangular structural element, S a A rectangular structural element representing 13 × 13, u represents a union operation,representing a logical or operation.
4. The method of claim 3, wherein the on-filtering operation in step 4 is performed according to the following formula:
wherein R represents an image after an on-filter operation, B represents a flare template mark image, and S s Representing a control structure element and theta representing a logical on operation.
5. The method according to any one of claims 1-4, wherein: and when the current detection result is a defective product, performing morphological reconstruction by sequentially using each secondary difference result image and the on-filter operation result image R, and marking image frames to which non-zero elements in the R belong.
6. The method according to any one of claims 1 to 4, wherein the offset correction of the image concurrent processing thread in step 1 is performed as follows:
step A: and expanding delta pixels outwards according to the manually set positioning matching template area to form a positioning matching search area: rect is search ={P x -δ,P y -δ,Rw+2δ,Rh+2δ};
The positioning matching template area is a bottle bottom part Rect fixedly selected from an original image template ={P x ,P y ,Rw,Rh},(P x ,P y ) A rectangular area of width Rw and height Rh for the selected coordinates in the raw image of the top left corner vertex of the bottom portion of the bottle;
and B: matching and positioning are carried out in a positioning matching search area by using a normalized correlation coefficient method through a positioning matching template area in the first frame image, and all normalized correlation coefficients R i (x, y) taking the position of the maximum value as a matching target position;
the calculation formula of the normalized correlation coefficient is as follows:
where T (x ', y') denotes a location matching template region in the first frame image, S i Representing a positioning matching search area in the ith image, wherein (x ', y') and (x, y) respectively represent pixel coordinates in a positioning matching template area in the first frame image and a positioning matching search area of an image to be subjected to offset correction;
and C: comparing the position of the matching target in each frame of image with the position of the central point of the positioning matching template area in the first frame of image to obtain the position offset of each frame of image relative to the first frame of imageCorrespondingly translating and correcting the visible foreign matter detection area according to the offset to obtain a corrected foreign matter detection area:i is a frame number, and the corresponding original image of the foreign object detection area is marked as In i
7. The method of claim 1, wherein during the image capturing process, the image capturing thread employs an LED panel light source for backlighting.
CN201710784299.8A 2017-09-04 2017-09-04 The high-speed parallel visible detection method of visible foreign matters in a kind of medical pharmacy Active CN107680079B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710784299.8A CN107680079B (en) 2017-09-04 2017-09-04 The high-speed parallel visible detection method of visible foreign matters in a kind of medical pharmacy

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710784299.8A CN107680079B (en) 2017-09-04 2017-09-04 The high-speed parallel visible detection method of visible foreign matters in a kind of medical pharmacy

Publications (2)

Publication Number Publication Date
CN107680079A true CN107680079A (en) 2018-02-09
CN107680079B CN107680079B (en) 2019-10-29

Family

ID=61135480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710784299.8A Active CN107680079B (en) 2017-09-04 2017-09-04 The high-speed parallel visible detection method of visible foreign matters in a kind of medical pharmacy

Country Status (1)

Country Link
CN (1) CN107680079B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108288274A (en) * 2018-02-24 2018-07-17 北京理工大学 Mold detection method, device and electronic equipment
CN111541847A (en) * 2020-05-14 2020-08-14 南京博视医疗科技有限公司 Processing method and processing system for high-speed camera image sequence

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101165720A (en) * 2007-09-18 2008-04-23 湖南大学 Medical large transfusion machine vision on-line detection method
CN101354359A (en) * 2008-09-04 2009-01-28 湖南大学 Method for detecting, tracking and recognizing movement visible exogenous impurity in medicine liquid
CN101859378A (en) * 2010-06-11 2010-10-13 湖南大学 Visual detection method for quality of liquid medicine on high-speed pharmaceutical production line
CN102175693A (en) * 2011-03-08 2011-09-07 中南大学 Machine vision detection method of visual foreign matters in medical medicament
CN102519984A (en) * 2011-11-16 2012-06-27 湖南大学 Anti-vibration machine vision detection method of foreign matters in liquid medicine
CN103743755A (en) * 2013-12-20 2014-04-23 许雪梅 Method for detecting visible foreign matters in medical agents based on affinity propagation cluster
CN104835166A (en) * 2015-05-13 2015-08-12 山东大学 Liquid medicine bottle foreign matter detection method based on machine visual detection platform

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101165720A (en) * 2007-09-18 2008-04-23 湖南大学 Medical large transfusion machine vision on-line detection method
CN101354359A (en) * 2008-09-04 2009-01-28 湖南大学 Method for detecting, tracking and recognizing movement visible exogenous impurity in medicine liquid
CN101859378A (en) * 2010-06-11 2010-10-13 湖南大学 Visual detection method for quality of liquid medicine on high-speed pharmaceutical production line
CN102175693A (en) * 2011-03-08 2011-09-07 中南大学 Machine vision detection method of visual foreign matters in medical medicament
CN102519984A (en) * 2011-11-16 2012-06-27 湖南大学 Anti-vibration machine vision detection method of foreign matters in liquid medicine
CN103743755A (en) * 2013-12-20 2014-04-23 许雪梅 Method for detecting visible foreign matters in medical agents based on affinity propagation cluster
CN104835166A (en) * 2015-05-13 2015-08-12 山东大学 Liquid medicine bottle foreign matter detection method based on machine visual detection platform

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
JIFEI FANG等: "Binocular Automatic Particle Inspection Machine for Bottled Medical Liquid Examination", 《2013 CHINESE AUTOMATION CONGRESS》 *
JUN CHEN等: "Research on Real-time Vibration-insensitive Inspection and Classification Algorithms for Automatic Online Vision-based Inspector", 《2011 INTERNATIONAL CONFERENCE ON TRANSPORTATION, MECHANICAL, AND ELECTRICAL ENGINEERING (TMEE)》 *
张斌: "玻璃瓶大输液中可见异物视觉检测系统的研究与实现", 《中国优秀硕士学位论文全文数据库 工程科技|辑》 *
张耀: "异型瓶装溶液异物的机器视觉检测技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
蔡亚朋: "安瓿注射液质量视觉检测系统研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108288274A (en) * 2018-02-24 2018-07-17 北京理工大学 Mold detection method, device and electronic equipment
CN111541847A (en) * 2020-05-14 2020-08-14 南京博视医疗科技有限公司 Processing method and processing system for high-speed camera image sequence

Also Published As

Publication number Publication date
CN107680079B (en) 2019-10-29

Similar Documents

Publication Publication Date Title
CN102175693B (en) Machine vision detection method of visual foreign matters in medical medicament
CN111784576B (en) Image stitching method based on improved ORB feature algorithm
CN110223296A (en) A kind of screw-thread steel detection method of surface flaw and system based on machine vision
CN104700112B (en) Parasite egg detecting method in a kind of excrement based on morphological feature
CN104835166B (en) Liquid medicine bottle foreign matter detecting method based on machine vision detection platform
CN108896574A (en) A kind of bottled liquor method for detecting impurities and system based on machine vision
CN103258201A (en) Form line extraction method integrating global information and local information
CN108665458A (en) Transparent body surface defect is extracted and recognition methods
CN101819164B (en) Device and method for detecting impurities after filling of beverage
CN109409181B (en) Independent detection method for upper and lower edges of fingers for low-quality finger vein image
CN111292228A (en) Lens defect detection method
CN108827979A (en) A kind of module group lens appearance detecting method
CN109272513A (en) Hand and object interactive segmentation method and device based on depth camera
CN107680079A (en) The high-speed parallel visible detection method of visible foreign matters in a kind of medical pharmacy
CN109754388B (en) Carotid artery stenosis degree calculation method and device and storage medium
CN105954292B (en) Underwater works surface crack detection device based on the bionical vision of compound eye and method
CN114155557B (en) Positioning method, positioning device, robot and computer-readable storage medium
CN111369529A (en) Article loss and leave-behind detection method and system
CN109583414A (en) Indoor road occupying detection method based on video detection
CN110866917A (en) Tablet type and arrangement mode identification method based on machine vision
CN106127826B (en) It is a kind of for projecting the connected component labeling method of interactive system
CN113916899B (en) Method, system and device for detecting large transfusion soft bag product based on visual identification
Wang et al. Deep learning based tongue prickles detection in traditional Chinese medicine
CN115424352A (en) Method for identifying kitchen pest invasion based on computer vision
CN109406534A (en) A kind of medicine bottle bottom pull ring defect detecting device and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant