CN110264446B - Method and system for detecting foreign matters in liquid medicine based on Facet directional derivative - Google Patents

Method and system for detecting foreign matters in liquid medicine based on Facet directional derivative Download PDF

Info

Publication number
CN110264446B
CN110264446B CN201910462490.XA CN201910462490A CN110264446B CN 110264446 B CN110264446 B CN 110264446B CN 201910462490 A CN201910462490 A CN 201910462490A CN 110264446 B CN110264446 B CN 110264446B
Authority
CN
China
Prior art keywords
image
facet
derivative
directional
roi
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
CN201910462490.XA
Other languages
Chinese (zh)
Other versions
CN110264446A (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.)
Changchun Institute of Optics Fine Mechanics and Physics of CAS
Original Assignee
Changchun Institute of Optics Fine Mechanics and Physics of CAS
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 Changchun Institute of Optics Fine Mechanics and Physics of CAS filed Critical Changchun Institute of Optics Fine Mechanics and Physics of CAS
Priority to CN201910462490.XA priority Critical patent/CN110264446B/en
Publication of CN110264446A publication Critical patent/CN110264446A/en
Application granted granted Critical
Publication of CN110264446B publication Critical patent/CN110264446B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a method and a system for detecting foreign matters in liquid medicine based on a Facet directional derivative, wherein the method comprises the following steps: acquiring a medicament image, and extracting an ROI (region of interest) image; obtaining characteristic point information of the ROI image according to the Facet model, and calculating Facet directional derivatives in different directions; fusing the Facet directional derivatives in different directions, and calculating a directional derivative saliency map; performing adaptive threshold value binarization segmentation on the direction derivative saliency map to obtain a segmented image; traversing the segmentation image, performing hole filling and connected region area segmentation processing on the segmentation image, identifying non-connected points, and further separating visible foreign matters. The method makes full use of the Facet model, the Facet directional derivative of the ROI area of the single-frame image is calculated and fused, so that the interference of visible foreign matters, bubbles and the like can be effectively enhanced, the foreground and the background are quickly separated, then the visible foreign matters are separated and output through self-adaptive threshold segmentation, hole filling and connected area extraction modes. The method is simple and effective, high in real-time performance and easy to practically apply.

Description

Method and system for detecting foreign matters in liquid medicine based on Facet directional derivative
Technical Field
The application belongs to the field of medical image processing, and particularly relates to a method and a system for detecting foreign matters in liquid medicine based on a Facet directional derivative.
Background
In the production process of the medicament, factors such as production environment, process, packaging technology and the like can influence the quality of the medicament, and small insoluble foreign impurities with different sources are mixed, so that the medicament can be polluted, and the life health of a patient is seriously damaged. Therefore, pharmaceutical enterprises have a quality detection link, the quality detection of bottled liquid mostly adopts a rotation-sudden stop mode to rotate foreign matters in bottles, real-time images are collected, and a machine vision method is used for judging whether the foreign matters exist in the liquid.
In the detection of visible foreign matters in liquid medicine, the main idea is to utilize the motion information of foreign matters in multiple frames of images, such as frame difference method, background subtraction method, neural network segmentation and other methods, which have respective advantages and disadvantages. However, when detecting visible foreign objects in rotation-sudden stop, the bottle body is clamped by the clamping device generally, and the bottle body and the infusion bottle are easy to shake to a certain extent, so that the interferences of the clamping device, the bottle wall scale, scratches and the like are difficult to eliminate by methods such as a frame difference method, background modeling and the like, and a target is confirmed by a multi-frame target track in the follow-up process. Therefore, it is necessary to provide a single-frame image detection method applied to the extraction of foreign matters in the medical solution for the defects of the multi-frame detection algorithm.
Disclosure of Invention
In view of this, the present application provides a method and a system for detecting a foreign object in a liquid medicine based on a Facet directional derivative, which can quickly and accurately separate bubbles, a foreign object and a background by calculating the Facet directional derivative characteristic of a single-frame image region of interest, effectively eliminate the interference of bottle wall scales, scratches, etc., and detect a visible foreign object.
A method for detecting foreign matters in liquid medicine based on a Facet directional derivative comprises the following steps:
acquiring a medicament image, and extracting an ROI (region of interest) image based on an effective to-be-detected region corresponding to the medicament image;
obtaining characteristic point information of the ROI image according to a Facet model, and calculating Facet directional derivatives in different directions corresponding to a single-frame medicament image;
fusing the Facet directional derivatives in different directions, and calculating a directional derivative saliency map;
performing adaptive threshold value binarization segmentation on the direction derivative saliency map to obtain a segmented image;
traversing the segmentation image, performing hole filling and communication region area segmentation processing on the segmentation image, identifying non-communication points, and further separating visible foreign matters.
Preferably, the method for extracting the ROI image based on the effective region to be detected corresponding to the drug image comprises:
inputting the medicine image I (x, y) according to the formula
Figure BDA0002078474060000021
And
Figure BDA0002078474060000022
respectively calculating a row amplitude accumulation curve and a column amplitude accumulation curve;
setting the threshold of the row and column amplitude accumulation curve, and carrying out threshold segmentation;
solving the minimum value of the curve, and determining a boundary area;
wherein, the upper, lower, left and right boundary points ytop、ybottom、xleft、xrightRespectively as follows:
Figure BDA0002078474060000023
Figure BDA0002078474060000024
the maximum coordinate values of the coordinates (i, j) in the direction of the X, Y axis are m and n, namely x is more than 0 and less than or equal to m, and y is more than 0 and less than or equal to n.
Setting an effective region to be detected in which the image is interested according to the boundary region, and extracting an ROI image; the calculation function is as follows:
IROI=I(x,y)xleft+Δx<x<xright-Δx,ybottom-Δy<y<ytop+Δy
wherein, Deltax and Delay represent the reduction boundary length in the x and y directions respectively, namely x epsilon (x)left+Δx,xright-Δx),y∈(ybottom-Δy,ytop+Δy)。
Preferably, the method for calculating the Facet directional derivatives in different directions corresponding to a single frame of the drug image comprises:
for any pixel (x, y) in the ROI image, fitting a polynomial according to the Facet region gray level:
f(r,c)=K1+K2r+K3c+K4r2+K5rc+K6c2+K7r3+K8r2c+K9rc2+K10c3
first-order directional derivative f is obtained under polar coordinatesα' (ρ) obtaining a Facet directional derivative characteristic diagram;
wherein, Ki(i ═ 1,2, …,10) is the fitting coefficient, Ki=IROI*wiIs ROI image IROIAnd filter wiThe fitting region size is 5 × 5, (r, c) is the coordinates of the Facet region, and ρ is the polar coordinates.
Preferably, the calculation method of the directional derivative saliency map is as follows:
according to the formula:
S=|f′α_1|+|f′α_2|+|f′α_3|+|f′α_4|+...+|f′α_i|
fusing the derivatives f 'in each direction'α_i(ii) a Wherein S represents a directional derivative saliency map, i represents the number of calculation directions, and i is an arbitrary integer value.
Preferably, when the calculated direction number i is 4, a first-order direction feature matrix with alpha being 0 °, 90 °, 45 °, -45 ° is obtained to obtain a face direction derivative f'0、f′90、f′45And f'-45(ii) a The fusion calculation obtains a direction derivative saliency map S, namely S ═ f'0|+|f′90|+|f′45|+|f′-45|。
Preferably, the method for performing adaptive threshold binarization segmentation on the directional derivative saliency map S comprises:
setting an adaptive threshold th of a direction derivative saliency map S according to the gray information;
according to the self-adaptive threshold th, the direction derivative saliency map S is subjected to image segmentation to obtain a segmented image TiI.e. by
Figure BDA0002078474060000031
EiAre gray scale values.
The application also provides a liquid medicine foreign matter detection system, includes:
one or more processors;
a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, wherein the one or more programs include instructions for:
obtaining an ROI image comprising a machine-readable code;
processing the ROI image, and calculating the Facet directional derivatives in different directions corresponding to the single-frame medicament image;
fusing the Facet directional derivatives in different directions, and calculating a directional derivative saliency map;
processing the direction derivative saliency map by self-adaptive threshold binarization and hole filling;
connected components are extracted, and the number of pixels of each connected component is calculated.
Compared with the prior art, the application has the advantages and positive effects that:
the application provides a liquid medicine foreign matter detection method and system, wherein a Facet directional derivative theory is applied to a liquid medicine single-frame image, improvement is carried out, the method is suitable for detecting visible foreign matters, bubbles and a background are well separated, and the visible foreign matters are extracted. According to the method, the characteristic points such as visible foreign matters and bubbles are effectively determined by calculating the Facet direction derivative characteristics of the single-frame image interesting region, then the Facet direction derivatives in different directions are fused, the visible foreign matters and the bubbles can be effectively enhanced, the interference such as bottle wall scales and scratches is inhibited, the foreground and the background are quickly separated, then the visible foreign matters are separated and output through self-adaptive threshold value separation and processing such as hole filling and communicated region extraction. Compared with the traditional manual detection mode, the detection result is stable and the accuracy is high. Meanwhile, the single-frame detection technology is adopted, and compared with a multi-frame detection technology, the method is simple, effective, high in real-time performance and easy to apply practically.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flow chart of a method for detecting foreign matter in a chemical solution according to the present application;
FIG. 2 is an image of a pharmaceutical agent provided by an embodiment of the present application;
FIG. 3a is a graph of row amplitude accumulation for a drug image according to an embodiment of the present disclosure;
FIG. 3b is a graph of the cumulative amplitude of the columns of the drug image provided in accordance with an embodiment of the present application;
FIG. 4 is an ROI image of a pharmaceutical agent provided by an embodiment of the present application;
fig. 5a is a Facet directional derivative characteristic when α is 0 ° in the embodiment of the present application;
fig. 5b is a Facet directional derivative characteristic when α is 90 ° in the embodiment of the present application;
fig. 5c is a Facet directional derivative characteristic when α is 45 ° in the embodiment of the present application;
fig. 5d is a Facet directional derivative characteristic when α ═ 45 ° in the embodiment of the present application;
FIG. 6 is a Facet directional derivative feature fusion graph provided in an embodiment of the present application;
fig. 7 is a visible foreign object detection diagram provided by an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are all embodiments of the present application, not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "comprises" and "comprising," and any variations thereof, in the description and claims of this application and the drawings described above, are intended to cover non-exclusive inclusions. For example, a process, method, or system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Referring to fig. 1, the present application reasonably applies the Facet directional derivative theory to a single frame image of a medical fluid, and provides a medical fluid foreign object detection method based on the Facet directional derivative, which specifically includes the following steps:
(1) and acquiring a medicament image, and extracting an ROI image based on an effective region to be detected corresponding to the medicament image.
Referring to fig. 2, fig. 2 is a view of the medicine provided in this embodiment, and a real-time image is acquired by rotating the foreign body in the bottle in a rotation-sudden stop manner.
Inputting medicine image I (x, y) with size of m × n according to formula
Figure BDA0002078474060000051
And
Figure BDA0002078474060000052
and respectively calculating a row amplitude accumulation curve and a column amplitude accumulation curve.
Setting a threshold value of a row and column amplitude accumulation curve, carrying out threshold value segmentation, determining the boundary between the bottle wall and the liquid level of the medicine bottle according to the minimum value of the curve, and determining the boundary area of the image;
as shown in fig. 3a and 3b, the upper, lower, left and right boundary points ytop、ybottom、xleft、xrightRespectively as follows:
Figure BDA0002078474060000053
Figure BDA0002078474060000054
the maximum coordinate values of the coordinates (i, j) in the direction of the X, Y axis are m and n, i.e. x is more than 0 and less than or equal to m and 0<y≤n。
Setting an effective region to be detected, which is interested in the image, according to the boundary region, and extracting an ROI image; as shown in fig. 4, fig. 4 is a medicament ROI image provided in the present embodiment.
The calculation function is as follows:
IROI=I(x,y)|xleft+Δx<x<xright-Δx,ytop+Δy<y<ybottom-Δy
wherein, Δ x and Δ y are positive integers and represent the reduced boundary length to ensure that the ROI image does not contain the bottle wall and the liquid level area.
(2) And obtaining the characteristic point information of the ROI image according to the Facet model, and calculating Facet directional derivatives in different directions corresponding to the single-frame medicament image.
Fig. 4 is a medicament ROI image provided in this embodiment, which is a BMP image containing typical features of various sizes and different attributes, and is used as an original image for testing feature point detection. In order to monitor the characteristic points from the background, the method adopts the maximum value of the second-order directional derivative to represent the difference between the characteristic points and the background by establishing a Facet model of the medicament ROI image. The Facet model uses the segmentation idea to find the analytic function which best approaches the critical area intensity value in the regular area with a certain pixel as the center, and the image surface gray intensity on the local neighborhood R multiplied by C of the Facet model can be expressed by a regional gray fitting polynomial:
f(r,c)=K1+K2r+K3c+K4r2+K5rc+K6c2+K7r3+K8r2c+K9rc2+K10c3
wherein, R and C are symmetric neighborhoods of a certain pixel (R, C) in the ROI image, R belongs to R, C belongs to C, Ki(i ═ 1,2, …,10) is the fitting coefficient, Ki=IROI*wiIs ROI image IROIAnd filter wiIs performed. f (r, c) is transformed under polar coordinates to obtain a first-order directional derivative f'α(ρ) the Facet directional derivative of the single frame image can be calculated. Wherein, Ki(i ═ 1,2, …,10) is the fitting coefficient, Ki=IROI*wiIs ROI image IROIAnd filter wiThe fitting region size is 5 × 5, (r, c) is the coordinates of the Facet region, and ρ is the polar coordinates.
Actual calculation of KiThe algorithm of (2) is high in complexity, and considering that the vector product of the two-dimensional discrete orthogonal polynomial can be decomposed into the vector product of the one-dimensional orthogonal polynomial in two directions, and the function base higher than the third order can be ignored, the two-dimensional orthogonal polynomial is adopted to express the fitting surface f (r, c) so as to reduce the operation amount.
Specifically, in this embodiment, for any pixel (x, y) of the image, a neighborhood where the pixel is located is specifically described, where R { -2-1012 }, and C { -2-1012 }, and for a neighborhood formed by each pixel, a pixel point (x, y) corresponds to a central point (0,0) in the 5 × 5 neighborhood, and then f (R, C) is fit to a gray scale intensity curve by using a binary cubic polynomial, which can be expressed as:
Figure BDA0002078474060000071
the first derivatives of the Facet model at 0o, 90o and any alpha angle direction are:
f′0=K3-2K8-3.4K10
f′90=K2-2K9-3.4K7
the first derivative of any angular direction can be found from the orthogonality property:
f′α=f′0×cosα+f′90×sinα
in this embodiment, the calculation direction number of the Facet direction derivative feature map specifically adopts four directions, and the direction derivative feature maps in four directions of 0 °, 90 °, 45 °, and-45 ° are calculated.
Due to the fitting coefficient Ki=IROI*wiIs ROI image IROIAnd filter wiAnd a filter wiComprises the following steps:
Figure BDA0002078474060000072
Figure BDA0002078474060000073
Figure BDA0002078474060000074
Figure BDA0002078474060000084
respectively calculating first-order direction feature matrixes of four directions of which alpha is 0 degrees, 90 degrees, 45 degrees and 45 degrees to obtain a face direction derivative feature map f'0、f′90、f′45And f'-45Respectively as follows:
f′0=K3-2K8-3.4K10
f′90=K2-2K9-3.4K7
Figure BDA0002078474060000081
Figure BDA0002078474060000082
and normalizing the range to the range of [ -1,1] to obtain a Facet directional derivative characteristic diagram, as shown in fig. 5a, 5b, 5c and 5 d.
(3) And fusing the Facet directional derivatives in different directions, and calculating a directional derivative saliency map.
Direction derivative feature map f'0、f′90、f′45And f'-45And performing fusion, wherein the calculation formula is as follows:
S=|f′0|+|f′90|+|f′45|+|f′-45|
a directional derivative saliency map S is obtained, as shown in fig. 6, and fig. 6 is a Facet directional derivative feature fusion map provided by the embodiment of the present application.
In the embodiment, the feature points (i.e., visible foreign matters or bubbles and the like) can be effectively determined by calculating the Facet directional derivative features of the single-frame image interesting region, and then the feature points are fused, so that the characteristics of the feature points can be effectively enhanced, the visible foreign matters and the bubbles can be extracted, the interferences such as bottle wall scales and scratches can be inhibited, and the foreground and the background can be quickly separated.
(4) Performing adaptive threshold value binarization segmentation on the direction derivative saliency map S to obtain a segmented image Ti
Setting an adaptive threshold th of a direction derivative saliency map S according to the gray information;
according to the self-adaptive threshold th, the direction derivative saliency map S is subjected to image segmentation to obtain a segmented image TiI.e. by
Figure BDA0002078474060000083
EiAre gray scale values.
(5) Traversing the segmented image, performing hole filling and connected region area segmentation processing on the segmented image, identifying non-connected points, and separating and outputting visible foreign matters, wherein fig. 7 is a final visible foreign matter detection image in the embodiment.
Specifically, a cross-shaped structure is selected as a structural element; then, an array X consisting of 0, size and binary image T is generatediSame, randomly choosing TiSetting the gray value of the corresponding position in X as 1 at the point with the gray value of 1; multiple iterations until TiStopping iteration when the change is not changed; last for TiAnd X is integrated to obtain a filled image Ti'。
Find TiTaking the first point as an initial point, performing iterative calculation to obtain a connected component where the point is located, storing the connected component in an image B, and calculating the number of pixels in the image B; followed by Ti' subtracted from B as Ti', yet to Ti' repeat the above operations, then findImage Ti' and calculating the number of pixels per connected component.
Traversing the direction derivative saliency map S, determining a connected region in the direction derivative saliency map S, and identifying a non-connected point, namely a bubble point or a foreign matter.
In the embodiment, the Facet direction derivative feature fusion graph is further processed in a hole filling and communicated region extracting mode, bubbles are removed, and finally visible foreign matters are separated and output. Compared with the traditional manual detection mode, the detection result is stable and the accuracy is high. Meanwhile, the single-frame detection technology is adopted, and compared with a multi-frame detection technology, the method is simple, effective, high in real-time performance and easy to apply practically. It should be noted that the processing of the Facet directional derivative feature fusion map in the present application is not limited to the adaptive threshold segmentation and the image processing methods such as hole filling and connected region.
The application also provides a liquid medicine foreign matter detection system, and the detection system can acquire image information through the CCD image sensor. The system is provided with one or more processors; the system comprises a front-end optical system, an image acquisition module, an analog-to-digital conversion module, a Flash program storage module, a DSP image processing module, an SDRAM data storage module, an image display module, a rear-end PC and the like. The specific modules can be set according to different application requirements. Wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the instructions to: obtaining an ROI image comprising a machine-readable code; processing the ROI image, and calculating the face directional derivatives in different directions corresponding to the single-frame medicament image; fusing the Facet directional derivatives in different directions, and calculating a directional derivative saliency map; processing the direction derivative saliency map by self-adaptive threshold binarization and hole filling; connected components are extracted, and the number of pixels of each connected component is calculated.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (4)

1. A method for detecting foreign matters in liquid medicine based on a Facet directional derivative is characterized by comprising the following steps:
acquiring a medicament image, and extracting an ROI (region of interest) image based on an effective to-be-detected region corresponding to the medicament image;
obtaining characteristic point information of the ROI image according to a Facet model, and calculating Facet directional derivatives in different directions corresponding to a single-frame medicament image;
fusing the Facet directional derivatives in different directions, and calculating a directional derivative saliency map;
performing adaptive threshold value binarization segmentation on the direction derivative saliency map to obtain a segmented image;
traversing the segmentation image, performing hole filling and connected region area segmentation processing on the segmentation image, identifying non-connected points, and further separating out visible foreign matters;
the method for extracting the ROI image based on the effective region to be detected corresponding to the medicament image comprises the following steps:
inputting the medicine image I (x, y) according to the formula
Figure FDA0003174366700000011
And
Figure FDA0003174366700000012
respectively calculating a row amplitude accumulation curve and a column amplitude accumulation curve;
setting the threshold of the row and column amplitude accumulation curve, and carrying out threshold segmentation;
solving the minimum value of the curve, and determining a boundary area;
wherein, the upper, lower, left and right boundary points ytop、ybottom、xleft、xrightRespectively as follows:
Figure FDA0003174366700000013
Figure FDA0003174366700000014
the maximum coordinate values of the coordinates (i, j) in the direction of the X, Y axis are m and n, namely x is more than 0 and less than or equal to m, and y is more than 0 and less than or equal to n;
setting an effective region to be detected in which the image is interested according to the boundary region, and extracting an ROI image; the calculation function is as follows:
IROI=I(x,y)|xleft+Δx<x<xright-Δx,ybottom-Δy<y<ytop+Δy;
wherein, Deltax and Delay represent the reduction boundary length in the x and y directions respectively, namely x epsilon (x)left+Δx,xright-Δx),y∈(ybottom-Δy,ytop+Δy);
The method for calculating the Facet directional derivatives in different directions corresponding to the single-frame medicament image comprises the following steps:
for any pixel (x, y) in the ROI image, fitting a polynomial according to the Facet region gray level:
f(r,c)=K1+K2r+K3c+K4r2+K5rc+K6c2+K7r3+K8r2c+K9rc2+K10c3
obtaining a first-order directional derivative f 'under polar coordinates'α(ρ) obtaining a Facet directional derivative characteristic diagram;
wherein, Ki(i ═ 1,2, …,10) is the fitting coefficient, Ki=IROI*wiIs ROI image IROIAnd filter wiTaking the size of a fitting area as 5 multiplied by 5, (r, c) is the coordinate of the Facet area, and rho is a polar coordinate;
the method for calculating the directional derivative saliency map comprises the following steps:
according to the formula:
S=|f′α_1|+|f′α_2|+|f′α_3|+|f′α_4|+...+|f′α_i|
fusing the derivatives f 'in each direction'α_i(ii) a Wherein S represents a directional derivative saliency map, i represents the number of calculation directions, and i is an arbitrary integer value.
2. The method for detecting foreign matters in liquid medicine based on the Facet directional derivative as claimed in claim 1, wherein when the calculated direction number i is 4, a first-order direction feature matrix with α being 0 °, 90 °, 45 °, -45 ° is obtained to obtain the Facet directional derivative f'0、f′90、f′45And f'-45(ii) a The fusion calculation obtains a direction derivative saliency map S, namely S ═ f'0|+|f′90|+|f′45|+|f′-45|。
3. The method for detecting foreign matters in liquid medicine based on Facet directional derivatives according to claim 2, wherein the method for performing adaptive threshold binary segmentation on the directional derivative saliency map S comprises:
setting an adaptive threshold th of a direction derivative saliency map S according to the gray information;
according to the self-adaptive threshold th, the direction derivative saliency map S is subjected to image segmentation to obtain a segmented image TiI.e. by
Figure FDA0003174366700000021
EiAre gray scale values.
4. A foreign matter detection system for medical liquid, comprising:
one or more processors;
a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, wherein the one or more programs include instructions for performing the Facet direction derivative based medical fluid foreign object detection method of any of claims 1-3.
CN201910462490.XA 2019-05-30 2019-05-30 Method and system for detecting foreign matters in liquid medicine based on Facet directional derivative Active CN110264446B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910462490.XA CN110264446B (en) 2019-05-30 2019-05-30 Method and system for detecting foreign matters in liquid medicine based on Facet directional derivative

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910462490.XA CN110264446B (en) 2019-05-30 2019-05-30 Method and system for detecting foreign matters in liquid medicine based on Facet directional derivative

Publications (2)

Publication Number Publication Date
CN110264446A CN110264446A (en) 2019-09-20
CN110264446B true CN110264446B (en) 2021-09-17

Family

ID=67916037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910462490.XA Active CN110264446B (en) 2019-05-30 2019-05-30 Method and system for detecting foreign matters in liquid medicine based on Facet directional derivative

Country Status (1)

Country Link
CN (1) CN110264446B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109143393A (en) * 2018-08-01 2019-01-04 哈尔滨工业大学 Bottled transparent medical fluid foreign bodies detection synchronized tracking visual compensation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3917055B2 (en) * 2002-11-05 2007-05-23 キリンビバレッジ株式会社 Foreign object detection and removal device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109143393A (en) * 2018-08-01 2019-01-04 哈尔滨工业大学 Bottled transparent medical fluid foreign bodies detection synchronized tracking visual compensation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Facet方向导数特征与稀疏表示相结合的红外弱小目标检测算法;荣楚君 等;《中国图象图形学报》;20181130;第19页、第28-30页 *
安瓿瓶可见异物图像识别算法的研究;油鸿博;《中国优秀硕士学位论文全文数据库 信息科技辑》;20150815;第1770-1771页 *

Also Published As

Publication number Publication date
CN110264446A (en) 2019-09-20

Similar Documents

Publication Publication Date Title
CN110659647B (en) Seal image identification method and device, intelligent invoice identification equipment and storage medium
CN108108731B (en) Text detection method and device based on synthetic data
CN103489254B (en) Lottery recognition method and lottery recognition system
CN107944444B (en) Method and system for detecting foreign matters in bottled liquid
CN114529459A (en) Method, system and medium for enhancing image edge
Babbar et al. Comparative study of image matching algorithms
CN107301408A (en) Human body mask extracting method and device
CN112017231A (en) Human body weight identification method and device based on monocular camera and storage medium
CN111311497B (en) Bar code image angle correction method and device
CN110598647B (en) Head posture recognition method based on image recognition
CN110264446B (en) Method and system for detecting foreign matters in liquid medicine based on Facet directional derivative
CN101706260A (en) Sub-pixel-based diameter measuring method
CN113516702B (en) Method and system for detecting liquid level of automatic liquid preparation ampoule bottle and method for detecting proportion of liquid medicine
CN113963008A (en) Small target semantic segmentation method and system for high-resolution image
CN112183517B (en) Card edge detection method, device and storage medium
CN112215838A (en) Workpiece air tightness detection method and device based on artificial intelligence
CN109143393B (en) Synchronous tracking visual compensation method for detecting foreign matters in bottled transparent liquid medicine
CN110533663B (en) Image parallax determining method, device, equipment and system
CN115953454A (en) Water level obtaining method, device and equipment based on image restoration and storage medium
WO2023019682A1 (en) Watermark removal method and apparatus, terminal device and readable storage medium
CN115239789A (en) Method and device for determining liquid volume, storage medium and terminal
CN106875369B (en) Real-time dynamic target tracking method and device
CN110246156B (en) Foreign matter identification method, foreign matter identification system and terminal equipment
CN110136193B (en) Rectangular box three-dimensional size measuring method based on depth image and storage medium
CN107578417A (en) Droplet size real-time follow-up method based on the extraction of optical profile curve

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