CN117152088B - Method, device, equipment and storage medium for detecting seal of medicine package - Google Patents

Method, device, equipment and storage medium for detecting seal of medicine package Download PDF

Info

Publication number
CN117152088B
CN117152088B CN202311125466.XA CN202311125466A CN117152088B CN 117152088 B CN117152088 B CN 117152088B CN 202311125466 A CN202311125466 A CN 202311125466A CN 117152088 B CN117152088 B CN 117152088B
Authority
CN
China
Prior art keywords
package
target
image
medicine
light source
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
CN202311125466.XA
Other languages
Chinese (zh)
Other versions
CN117152088A (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.)
Beijing Aocheng Intelligent Technology Co ltd
Original Assignee
Beijing Aocheng Intelligent 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 Beijing Aocheng Intelligent Technology Co ltd filed Critical Beijing Aocheng Intelligent Technology Co ltd
Priority to CN202311125466.XA priority Critical patent/CN117152088B/en
Publication of CN117152088A publication Critical patent/CN117152088A/en
Application granted granted Critical
Publication of CN117152088B publication Critical patent/CN117152088B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the application provides a seal detection method, device and equipment for medicine packaging and a storage medium. Firstly, acquiring a target image; the target image comprises image information of a target package, wherein the target package is an independent package in the dual package, and the image information comprises a sealing edge image area and/or a transverse sealing image area of the target package; obtaining pixels which have preset optical variation trend with surrounding pixels from a target image as contours to be detected; judging whether the target visual characteristics of the outline to be detected meet preset detection conditions or not; the preset detection conditions are set based on standard visual characteristics of the sealing edge image area and/or the transverse sealing image area; and if the target visual characteristics meet the preset detection conditions, determining that the medicine package is qualified. According to the embodiment of the application, automatic detection of sealing of the medicine package can be realized, the sealing detection efficiency and accuracy of the medicine package are improved, secondary pollution risks brought by a detection process are avoided, and the medicine quality is guaranteed.

Description

Method, device, equipment and storage medium for detecting seal of medicine package
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method, a device, equipment and a storage medium for detecting sealing of medicine packages.
Background
At present, drugs are classified into solid preparations and liquid preparations according to the formulation method. Solid preparations include various forms such as tablets, capsules, powders, granules and the like.
In the production and preparation process of the traditional Chinese medicine package, the traditional Chinese medicine preparation can be packaged by adopting a small bag.
In the related art, after the pouch packaging process is completed, it is necessary to manually check whether the package has defects. However, human eyes are easily fatigued, and thus, the detection efficiency and accuracy of the manual detection method are limited by the status of personnel. In addition, the intervention of manual operation can cause secondary pollution of the medicine, so that the quality of the medicine is reduced.
Disclosure of Invention
In this context, embodiments of the present application desirably provide a seal detection method, device, equipment, and storage medium for a drug package, so as to implement automatic detection of seal of the drug package, improve seal detection efficiency of the drug package, improve accuracy of seal detection of the drug package, and ensure drug quality.
In a first aspect of embodiments of the present application, there is provided a seal detection method of a pharmaceutical package, including:
acquiring a target image; wherein the target image comprises image information of a target package; the target package is an independent package in the dual package; the dual package comprises two independent packages connected with each other; the image information comprises a sealing edge image area and/or a transverse sealing image area of the target package;
obtaining pixels which have a preset optical variation trend with surrounding pixels from the target image as contours to be detected;
judging whether the target visual characteristics of the outline to be detected meet preset detection conditions or not; the preset detection conditions are set based on standard visual characteristics of the sealing edge image area and/or the transverse sealing image area;
and if the target visual characteristics meet preset detection conditions, determining that the medicine package is qualified.
In a second aspect of embodiments of the present application, there is provided a seal detection device for a pharmaceutical package, applied to implement the seal detection method for a pharmaceutical package of the first aspect, the device comprising:
a first acquisition unit configured to acquire a target image; wherein the target image comprises image information of a target package; the target package is an independent package in the dual package; the dual package comprises two independent packages connected with each other; the image information comprises a sealing edge image area and/or a transverse sealing image area of the target package;
The second acquisition unit is used for acquiring pixels which have a preset optical variation trend with surrounding pixels from the target image as contours to be detected;
the judging unit is used for judging whether the target visual characteristics of the outline to be detected meet preset detection conditions or not; the preset detection conditions are set based on standard visual characteristics of the sealing edge image area and/or the transverse sealing image area;
and the determining unit is used for determining that the medicine package is qualified if the target visual characteristics meet preset detection conditions.
In a third aspect of embodiments of the present application, there is provided a computing device comprising:
at least one processor, memory, and input output unit;
wherein the memory is configured to store a computer program and the processor is configured to invoke the computer program stored in the memory to perform the seal detection method of the pharmaceutical packaging of the first aspect.
In a fourth aspect of embodiments of the present application, there is provided a computer readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the closure detection method of the pharmaceutical product package of the first aspect.
The embodiment of the application provides a seal detection method, device and equipment for medicine packaging and a storage medium. In an embodiment of the present application, a target image is acquired, the target image including image information of a target package. Wherein the target package is one of the individual packages in a duplex package comprising two connected individual packages. The image information of the target package includes a seal edge image area and/or a cross seal image area of the target package. Further, pixels which have a preset optical variation trend with surrounding pixels are obtained from the target image and used as contours to be detected. Because of the structural differences between the defect and the surrounding portions in the drug package closure, such differences may be manifested by visual differences between the defect and the surrounding portions, and thus, there is a particular tendency for optical variation between the outline to be inspected and the surrounding pixels. Further, it is determined whether the target visual characteristics of the outline to be detected satisfy preset detection conditions set based on standard visual characteristics of the seal edge image area and/or the transverse seal image area. And finally, if the target visual characteristics of the outline to be detected meet the preset detection conditions, determining that the medicine package is qualified.
In the embodiment of the application, the target visual characteristics of the outline to be detected are extracted from the image of the medicine package, and whether the target visual characteristics of the outline to be detected are consistent with the standard visual characteristics is judged through the preset detection conditions, so that qualified medicine packages are screened, automatic detection of the medicine packages is realized, and the sealing detection efficiency of the medicine packages is greatly improved. Meanwhile, by extracting the visual characteristics in the images, the problem of accuracy reduction caused by eye fatigue of people and the risk of secondary pollution of medicines caused by manual operation intervention are effectively avoided, the accuracy of seal detection of medicine packaging is greatly improved, and the medicine quality is ensured.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. Several embodiments of the present application are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings, in which:
fig. 1 is a flow chart of a seal detection method for a pharmaceutical package according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a target image according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a seal detection method according to an embodiment of the present disclosure;
FIG. 4 is a schematic view of a seal edge image area according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a seal detection method according to another embodiment of the present disclosure;
fig. 6 is a schematic structural view of a seal detecting device for medicine package according to an embodiment of the present application;
FIG. 7 schematically illustrates a schematic structural diagram of a medium according to an embodiment of the present application;
fig. 8 schematically illustrates a structural schematic diagram of a computing device according to an embodiment of the present application.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are presented merely to enable one skilled in the art to better understand and practice the present application and are not intended to limit the scope of the present application in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Those skilled in the art will appreciate that embodiments of the present application may be implemented as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the following forms, namely: complete hardware, complete software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
At present, drugs are classified into solid preparations and liquid preparations according to the formulation method. Solid preparations include various forms such as tablets, capsules, powders, granules and the like.
In the production and preparation process of the traditional Chinese medicine package, the traditional Chinese medicine preparation can be packaged by adopting a small bag. At present, the production process of the pouch package mainly comprises: aiming at a certain batch of traditional Chinese medicine preparations, typesetting and editing corresponding medicine information, printing the medicine information on packaging materials of small bags by using a high-speed rewinder, and finally processing the medicine raw materials and the packaging materials into the traditional Chinese medicine preparations packaged by the small bags by using a small bag packaging machine through a plurality of procedures such as filling, heat sealing, cutting and the like.
In the related art, after the pouch packaging process is completed, it is necessary to manually inspect the packaging bag for possible defects, such as package breakage, white edges, leakage of medicine powder, printing errors, and uneven black marks. However, the manual detection method is limited by the fatigue of human eyes, and the accuracy and detection efficiency of the manual detection method are reduced. In addition, the intervention of manual operation can cause secondary pollution of the medicine, so that the quality of the medicine is reduced.
In summary, a new solution is needed to solve the above technical problems.
In order to overcome the technical problems, according to the embodiments of the present application, a method, a device, an apparatus and a storage medium for detecting a seal of a pharmaceutical package are provided. In the embodiment of the present application, it is first necessary to acquire a target image containing image information of a target package. Wherein the target package is one of the individual packages in a duplex package comprising two connected individual packages. The image information of the target package includes a seal edge image area and/or a cross seal image area of the target package. Further, pixels which have a preset optical variation trend with surrounding pixels are obtained from the target image and used as contours to be detected. Because of the structural differences between the defect and the surrounding portions in the drug package closure, such differences may be manifested by visual differences between the defect and the surrounding portions, and thus, there is a particular tendency for optical variation between the outline to be inspected and the surrounding pixels. Further, it is determined whether the target visual characteristics of the outline to be detected satisfy preset detection conditions set based on standard visual characteristics of the seal edge image area and/or the transverse seal image area. And finally, if the target visual characteristics of the outline to be detected meet the preset detection conditions, determining that the medicine package is qualified.
In the embodiment of the application, the target visual characteristics of the outline to be detected are extracted from the image of the medicine package, and whether the target visual characteristics of the outline to be detected are consistent with the standard visual characteristics is judged through the preset detection conditions, so that qualified medicine packages are screened, automatic detection of the medicine packages is realized, and the sealing detection efficiency of the medicine packages is greatly improved. Meanwhile, by extracting the visual characteristics in the images, the problem of accuracy reduction caused by eye fatigue of people and the risk of secondary pollution of medicines caused by manual operation intervention are effectively avoided, the accuracy of seal detection of medicine packaging is greatly improved, and the medicine quality is ensured.
The technical scheme provided by the embodiment of the application can be realized by a server and/or terminal equipment. The server and/or the terminal device may be deployed in the production device of the pharmaceutical packaging, or may be a production device independent of the pharmaceutical packaging, and the transmission of the data instructions is achieved by establishing wireless communication and/or wired communication.
It should be noted that, the server according to the embodiment of the present application may be an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, a cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, big data, an artificial intelligent platform, and other basic cloud computing services.
The terminal device according to the embodiments of the present application may be a device that provides voice and/or data connectivity to a user, a handheld device with wireless connection functionality, or other processing device connected to a wireless modem. Such as mobile telephones (or "cellular" telephones) and computers with mobile terminals, which can be portable, pocket, hand-held, computer-built-in or car-mounted mobile devices, for example, which exchange voice and/or data with radio access networks. Such as personal communication services (Personal Communication Service, PCS) phones, cordless phones, session initiation protocol (Session initialization Protocol, SIP) phones, wireless local loop (Wireless Local Loop, WLL) stations, personal digital assistants (Personal Digital Assistant, PDAs), and the like.
In this document, it should be understood that any number of elements in the drawings is for illustration and not limitation, and that any naming is used only for distinction and not for any limitation.
The principles and spirit of the present application are explained in detail below with reference to several representative embodiments thereof.
Referring now to fig. 1, fig. 1 is a flow chart illustrating a method for detecting a seal of a pharmaceutical package according to an embodiment of the present disclosure. The embodiment of the application provides a seal detection method of medicine package, which comprises the following steps:
Step S101, a target image is acquired.
In an embodiment of the present application, the target image includes image information of a pharmaceutical package. In practice, the target image may be a pharmaceutical package for packaging a solid formulation. For example, a medicine packaging bag for packaging solid Chinese medicinal preparations. From a packaging form, for example, the pharmaceutical package may be a duplex pharmaceutical package, where duplex refers to a package structure in which two individual packages are connected together. For distinction, the pharmaceutical package to be tested is referred to herein as the target package. In practice, the image information of the target package includes, but is not limited to: a sealed edge image area and/or a cross seal image area of the target package.
Wherein, the sealing edge refers to the edge of the sealing opening in the medicine package. After the medicine is filled into the medicine package, in order to avoid the problems of medicine leakage, medicine pollution and the like caused by the defect of the medicine package, the qualification of the sealing edge in the medicine package needs to be detected. In the embodiment of the present application, in order to detect whether a defect exists in a sealed edge of a pharmaceutical package, a sealed edge image area (i.e., a target image) for detecting the qualification of the sealed edge needs to be extracted from an original image of the pharmaceutical package.
And the transverse seal is positioned at the sealing opening in the medicine package. In practice, the transverse seals are sealing structures pressed by packaging equipment and are used as sealing ports of medicine packaging bags. Due to the manufacturing process problem, when the medicine package is sealed, solid preparations (such as medicine powder, pills and the like) can be possibly sealed at the transverse sealing position, and the situation also belongs to one of package defects to be detected. Similarly, in order to detect whether or not the above-described defect exists in the seal port of the medicine package, it is also necessary to extract a cross seal image area (i.e., a target image) for detecting the cross seal eligibility from the original image of the medicine package.
See fig. 2 for a two-part pharmaceutical package comprising a complete image of package a and a partial image of package b. In fig. 2, the package a and the package b are independent of each other and are used for packaging solid preparations, respectively. A detachable connecting structure is arranged between the packaging bag a and the packaging bag b. It should be noted that, in addition to the dual medicine package, the detachable independent medicine package may also be configured into a triple, quadruple, or other number of package forms, which is not limited in this embodiment of the present application.
In the embodiment of the application, the target image can be acquired through the image acquisition equipment. The image capturing device may be a camera, a video camera, or the like, and the embodiment of the present application is not limited to this. For example, the image acquisition device may be a camera module installed in a packaging device or a packaging line. Or a camera module in a mobile terminal or other device, which is connected to the packaging device by a clamping device or other connection structure.
In order to further improve the accuracy of package qualification detection, image registration can be performed on the medicine package so as to avoid detection errors caused by problems such as image shooting angles, package placement positions, package clamping angles and the like.
In response to this problem, in an alternative embodiment of the present application, if the physical size of the marker meets the standard size, a first registration setpoint on a bounding box circumscribing the maximum outline of the target package is extracted from the target image prior to detecting the sealing edge of the pharmaceutical package. Wherein the position of the first registration setpoint is related to the orientation of the target package in the bigeminal package, and the specific association is described in the following examples. In addition to the first registration setpoint, a second registration setpoint related to the marker may also be extracted from the target image. The marker is an identification pattern in the duplex package for indicating the trimmable area, such as a black mark in the duplex package. Furthermore, affine transformation is carried out on the first registration positioning point and the second registration positioning point so as to carry out image registration processing on the target image, thereby greatly reducing detection errors caused by problems of image shooting angles, package placement positions, package clamping angles and the like.
Taking a left bag in the dual package as an example, taking an external rectangular bounding box for the maximum outline of the left bag in the target image, and taking an upper left corner coordinate point and a lower left corner coordinate point of the external rectangular bounding box as an upper left corner locating point and a lower left corner locating point (namely a first registration locating point) of the left bag. And taking the upper intersection point of the horizontal central line of the right black mark in the left bag and the rectangular surrounding frame as the upper right corner locating point (taking the second registration locating point) of the left bag. And carrying out affine transformation on the left upper corner locating point, the left lower corner locating point and the right upper corner locating point of the left bag, and carrying out image registration processing on the position of the left bag in the target image.
It should be noted that, besides the above image registration manner, the shake in the vertical direction (i.e. the Z axis) may be corrected, so as to further improve the accuracy of image detection. Of course, in practical application, the image registration process may be applied before the detection process of the seal edge qualification or the cross seal qualification, so as to improve the accuracy and reliability of the subsequent image detection process.
Step S102, pixels with preset optical variation trend with surrounding pixels are obtained from the target image as the contours to be detected. Because of the structural differences between the defect and the surrounding portions in the drug package closure, such differences may be manifested by visual differences between the defect and the surrounding portions, and thus, there is a particular tendency for optical variation between the outline to be inspected and the surrounding pixels.
For example, the brightness of the pixels at the edge portion in the sealing edge image area may be higher than that of other pixels around the pixels, that is, the pixels at the edge portion in the sealing edge image area may exhibit a specific variation trend in brightness, so that the contour to be detected, which is required to be detected, may be extracted from the sealing edge image area by such a specific variation trend of brightness. The specific trend of the profile to be detected is also related to the light source in the current detection environment. For example, under an unpolarized light source, the brightness of the profile to be detected is higher than the brightness of the surrounding pixels; under polarized light source, the brightness of the outline to be detected is between the brightness of the black mark (namely the marker) and the brightness of the medicine package main body material.
For example, for transverse seals, there is a height difference between the portion where solid particles (i.e., powder) are present and other portions around, and thus, visual differences associated with the height difference, such as a specific brightness variation trend (e.g., abnormal brightness regions similar to the powder shape), texture differences of the material surface (e.g., patterns similar to the powder shape), etc., can also be extracted in the transverse seal image region.
Step S103, judging whether the target visual characteristics of the outline to be detected meet the preset detection conditions.
Step S104, if the target visual characteristics of the outline to be detected meet the preset detection conditions, determining that the medicine package is qualified.
In the embodiment of the application, the preset detection condition is set based on standard visual characteristics of the sealing edge image area and/or the transverse sealing image area. For example, assuming that the contour to be detected is a seal edge image area, in order to detect whether or not a white edge phenomenon exists in the area, a preset detection condition may be set as: the size of the seal edge image area is within the standard size range of the seal edge image area. Therefore, target packages with actual sizes exceeding the standard size range are screened, the screened target packages are judged to be medicine packages with white edge defects, related defect processing flows are triggered, and automatic detection of the white edge defects is achieved.
For example, assuming that the contour to be detected is a candidate powder contour in the transverse seal image area, in order to detect whether there is a phenomenon in which powder particles are pressed in the transverse seal, a preset detection condition may be set as: the number of the candidate powder contours contained in the transverse seal image area is smaller than the preset standard number. Therefore, target packages containing excessive powder particles in transverse seals are automatically screened, the screened target packages are judged to be medicine packages with transverse seal defects, and related defect processing flows are triggered, so that automatic detection of the transverse seal defects is realized.
In the application, the target visual characteristics of the outline to be detected are extracted from the image of the medicine package, and whether the target visual characteristics of the outline to be detected are consistent with the standard visual characteristics is judged through preset detection conditions, so that qualified medicine packages are screened out, automatic detection of the medicine packages is realized, and the sealing detection efficiency of the medicine packages is greatly improved. Meanwhile, by extracting the visual characteristics in the images, the problem of accuracy reduction caused by eye fatigue of people and the risk of secondary pollution of medicines caused by manual operation intervention are effectively avoided, the accuracy of seal detection of medicine packaging is greatly improved, and the medicine quality is ensured.
For the seal edge image area, in an alternative embodiment of the present application, a seal inspection process for pharmaceutical packaging is illustratively provided. The detection target related to the following flow is a seal edge image area.
Referring to the above, the seal edge refers to the edge of the seal in the pharmaceutical package. After filling the pharmaceutical product into the pharmaceutical product package, the sealed edges in the pharmaceutical product package need to be inspected. In the process of manufacturing the medicine package, the problem of inconsistent heights of films at two sides can occur at the sealing edge, so that the phenomenon that the white edge is exposed at the sealing edge is caused. In practical application, if the width of the exposed white edge exceeds a set width threshold, the medicine package is determined to be unqualified. For example, when the width of the exposed margin exceeds 1mm, the pharmaceutical package is judged to be unacceptable.
In order to detect whether the edge of the seal of the pharmaceutical package is too wide with the white edge exposed, it is necessary to extract an image for detecting the image area of the edge of the seal from the target image. Specifically, the acquisition of the target image in step S101, as shown in fig. 3, may be implemented as steps S301 to S302:
s301, acquiring an original image containing the seal edge image area.
In this embodiment, the original image is an image including a complete outline of a seal edge area in a pharmaceutical package, and may be acquired by any image acquisition method. For example, the drug package is placed in a solid background and the original image is acquired. For example, the medicine package is fixed in the field of view of the image capturing device by the holder, whereby the original image is captured by the image capturing device.
In order to further improve the accuracy of the package eligibility test, the interference of markers (such as black marks in duplex packages) and shielding of holders (i.e. the structure of the apparatus used to secure the pharmaceutical packages) need to be avoided during the sampling process. Specifically, a sampling range (for distinguishing, referred to as a first sampling range) containing seal edge image information is determined in the target image, namely:
S302, a first sampling range corresponding to the seal edge image area in the original image is used.
The first sampling range is determined based on at least one parameter of the relative position of the marker in the target package, the physical size of the marker, the position of the holder, the holder size, the edge profile of the medicine package, and the seal edge sampling coefficient. In practice, the area of the first sampling range is larger than the area of the sealing edge image region, i.e. the sealing edge image region is enclosed in the first sampling range.
For example, assuming that W is the actual width of the pharmaceutical package, then the distance of the first sampling range to the edge profile in the pharmaceutical package may be set to: d=w×0.15; the width of the first sampling range may be set to: w=w×0.15; the height h of the first sampling range may be set to 2mm depending on the number of pixels in the target image. Wherein 0.15 is the sampling coefficient of the sealing edge, which is an empirical value set by the production equipment.
In practical applications, considering that the positions of the marker and the clamp may shake left and right, the first sampling range corresponding to the seal edge image area may be further corrected based on the shake amplitude.
Next, as shown in fig. 3, an alternative embodiment of step S102 may be implemented as the following step S303, namely:
Step S303, extracting candidate edge contours from the target image according to the light source types in the detection environment.
Wherein the luminance difference between the candidate edge contour and surrounding pixels is related to the light source type. The types of light sources are classified into: unpolarized light sources and polarized light sources. Specifically, the extraction of white edges (i.e., the sealed edge image area) is performed in a first sampling range according to the current light source environment. For example, the brightness of the white edge is higher than the brightness of the pharmaceutical packaging material under an unpolarized light source, and the brightness of the white edge is between the brightness of the pharmaceutical packaging material and the brightness of the marker under a polarized light source. That is, in step S303, white edges are identified and extracted from the first sampling range using the luminance threshold value corresponding to the light source type.
In an alternative embodiment, if the light source type is a non-polarized light source, a pixel with a brightness higher than a first brightness threshold is selected from the first sampling range as the candidate edge contour. Wherein the first brightness threshold is higher than the maximum brightness of the bulk material of the duplex package under an unpolarized light source. For example, the unpolarized light source may be a low angle annular shadowless light source. Based on this, if the light source type in the detection environment is a low-angle annular shadowless light source, the first luminance threshold value may be set based on the luminance variation value of the duplex package under the low-angle annular shadowless light source.
In another alternative embodiment, if the light source type is a polarized light source, pixels with a luminance below the second luminance threshold and a luminance above the third luminance threshold are selected from the first sampling range as candidate edge contours. The second brightness threshold is the minimum brightness of the main body material of the duplex package under the polarized light source, and the third brightness threshold is the maximum brightness of the marker in the duplex package under the polarized light source. For example, the polarized light source may be composed of a polarized light source and a polarizer. Based on this, if the type of light source in the detection environment is a polarized light source composed of a polarized light source and a polarizer, the second luminance threshold value and the third luminance threshold value may be set based on the luminance change value of the duplex package under the polarized light source.
Alternatively, for any of the above light sources, a brightness variation model of the bigeminal package under the light source type may be pre-established, so that the brightness threshold matched with the light source type is dynamically adjusted by the brightness variation trend indicated by the model. Further, the packaging material of the duplex package is placed under a polarized light source or a non-polarized light source in advance, brightness change values of the packaging material used by each part in the duplex package are collected through the image collecting equipment, and a brightness change model between the light source and a brightness threshold value is built based on the collected brightness change values. In practical application, the position coordinates, the type of packaging materials, the type of equipment and other types of environmental factors in the detection environment can be introduced into the brightness change model as reference factors, so that the brightness threshold value changes along with the environment, the accuracy of the brightness threshold value and the environmental adaptability are improved, and the accuracy of the detection result is further improved.
In practical applications, the detection environment may be changed, such as weather (e.g. sunny days, rainy days, etc.), environmental factors (e.g. number of light sources, equipment temperature, light source layout, packaging material type, etc.), in order to further improve accuracy and detection efficiency of the drug package seal, detection parameters adapted to the detection environment, such as light source type, environmental parameters in the detection environment, etc. need to be flexibly adjusted according to the variation of the above factors.
Further optionally, before step S303, the type of light source in the detection environment and the environmental parameters may also be identified. Wherein the environmental parameters include, but are not limited to: at least one parameter of an ambient light parameter, a brightness noise parameter, a type of body material of the duplex package, and a type of marker material in the environment is detected. And dynamically correcting the brightness threshold corresponding to the light source type based on the environment parameter.
Specifically, the illumination conditions under different environmental parameters are simulated in the service platform, so that the brightness threshold under the corresponding light source type is corrected based on the simulated virtual detection environment. The service platform is provided with an illumination condition simulation model, and the model can be used for fusing illumination simulation results under various parameters; and then, after inputting parameters such as weather conditions, the number of light sources, equipment temperature, light source layout, environment light parameters, brightness noise parameters, main body material types of the duplex package, marker material types and the like in the detection environment, simulating the illumination conditions in the current detection environment through an illumination condition simulation model to obtain an illumination simulation result. And inputting the result into a light source consistency evaluation model, and outputting adjustment information of the brightness threshold corresponding to the light source type.
Like this, can adapt to different detection environment dynamically to guarantee the uniformity of testing result, avoid the detection difference that brings because of the testing environment changes, further promote the accuracy of testing result, improve the accuracy and the detection efficiency that the medicine packing was sealed.
With continued reference to fig. 3, an alternative embodiment of step S103 may be implemented as follows steps S304-S305:
step S304, calculating the maximum physical width of the candidate edge contour.
Continuing with the example above, in step S304, the white edge identified in S303 is calculated to obtain the white edge width in pixels. Alternatively, the maximum width in the white edge may be selected as the white edge width of the final output. For example, as shown in fig. 4, the white edge width (white edge) is 161×62. And then, the unit conversion is carried out on the finally output white edge width to obtain the white edge physical width (namely, the maximum physical width of the sealing edge image area). Of course, in practical applications, the subsequent determination may be directly performed based on the white edge width in units of pixels, so that the amount of calculation consumed by unit conversion is reduced.
Step S305, determining whether the maximum physical width of the candidate edge profile is smaller than a preset sealing edge width threshold.
With continued reference to FIG. 3, an alternative embodiment of step S104 may be implemented as step S306, which is:
and step S306, if the maximum physical width of the candidate edge profile is smaller than the maximum sealing edge width threshold, determining that the medicine package is qualified.
That is, if the maximum physical width of the seal edge image area is smaller than the maximum seal edge width threshold (e.g., set to 1mm or set to 1.25mm, etc.), it is indicated that the seal edge image area is within a reasonable range, and in this case, it may be determined that the medicine package does not have a defect that the seal edge image area is too wide, that is, it is determined that the medicine package is acceptable. On the contrary, the maximum physical width of the sealing edge image area is larger than or equal to the maximum sealing edge width threshold value, and the defect that the sealing edge image area is too wide in the medicine package can be judged, namely the medicine package is unqualified.
In this application implementation, through the steps S301 to S306, the sealing edge image area can be automatically extracted from the target image, and then the sealing edge image area is automatically detected, so as to determine whether a defect exists in the sealing edge image area, further improve the detection efficiency of the white edge defect in the sealing edge image area, and improve the accuracy of the white edge defect detection.
In another alternative embodiment of the present application, for cross-seal image areas, a seal detection procedure for pharmaceutical packaging is also illustratively provided. The detection target related to the following flow is a cross seal image area.
As mentioned above, due to the manufacturing process, the solid preparation (such as traditional Chinese medicine powder) may be sealed at the transverse sealing position when the medicine package is sealed, which is also one of the package defects to be detected.
In an alternative embodiment of the present application, to detect the presence or absence of a defect in a transverse seal of a pharmaceutical package, it is necessary to first extract an image region containing the transverse seal (referred to herein as a transverse seal image region) from a target image. Specifically, as shown in fig. 5, an alternative embodiment in step S101 may be implemented as the following steps S501 to S502:
step S501, an original image including a cross seal image area is acquired.
Similarly, the original image referred to herein is an image containing the complete outline of the cross seal area in the pharmaceutical package, and may be acquired by any image acquisition means. For example, the drug package is placed in a solid background and the original image is acquired. For example, the medicine package is fixed in the field of view of the image capturing device by the holder, whereby the original image is captured by the image capturing device.
Similar to the previous embodiments, since the defect detection process needs to avoid the disturbance of the markers and the occlusion of the clamper (i.e. the structure of the apparatus for fixing the pharmaceutical package), it is necessary to determine the sampling range (for distinction, called the second sampling range) containing the cross seal image information in the target image, namely:
step S502, a second sampling range corresponding to the cross seal image area in the original image is used.
The second sampling range is determined based on at least one parameter of the relative position of the marker in the target package, the physical size of the marker, the position of the gripper, the gripper size, the edge profile of the medicine package, and the transverse seal sampling coefficient. In practice, the area of the second sampling range is larger than the area of the cross seal image region, i.e. the cross seal image region is enclosed in the second sampling range.
For example, let W be the actual width of the pharmaceutical package, let H be L Standard height of the marker, W L Is the standard width of the tag. Based on the above assumption, the width of the second sampling range corresponding to the cross seal image region may be set as: w=w×0.2; the height of the second sampling range may be set as: h=h L X 0.6; the interval margin of the second sampling range may be set to 1mm depending on the number of pixels in the target image. Wherein 0.2 and 0.6 are transverse seal sampling coefficients according to Empirical values set by the production facility. Further, the upper left corner and the upper right corner of the medicine package are taken as the upper left corner and the upper right corner of the sampling range, the distance between the upper edge of the second sampling range and the upper edge of the medicine package is margin, and the distance between the left edge of the second sampling range and the left edge of the medicine package is: margin+W L And x 0.5, taking the upper edge and the left edge as boundary rectangular frames with the size of w multiplied by h as a second sampling range corresponding to the transverse seal image area. Alternatively, in a similar manner, the upper edge and the right edge may be taken as a rectangular frame with a size w×h as the second sampling range corresponding to the cross seal image area.
In practical applications, considering that the positions of the marker and the clamper may shake left and right, the second sampling range corresponding to the transverse seal image area may be further corrected based on the shake amplitude.
As shown in fig. 5, an alternative embodiment of step S102 may be implemented as the following steps S503 to S505:
step S503, performing black cap operation on the target image to enhance brightness difference between pixels in the target image;
step S504, performing binarization processing on the target image after the black cap operation processing to obtain a binarized transverse seal image;
Step S505, searching candidate powder contours from the binarized transverse seal image.
In the above steps, the target image is processed by the black cap operation in morphology, so as to enhance the darker area of the adjacent pixels in the target image, so that the area with different heights from the surrounding part in the binarized transverse seal image is more obvious visually, thereby being convenient for screening out the candidate powder contours.
Further, as shown in fig. 5, an alternative embodiment of step S103 may be implemented as the following steps S506 to S507:
step S506, calculating the length-width ratio and/or the area of the candidate powder contours;
step S507, judging whether the number of candidate powder contours with length-width ratio and/or area meeting the defect contour condition reaches a preset defect number threshold.
Further optionally, aspect ratios and/or areas corresponding to the candidate powder contours may be generated in advance in the service platform according to different medicinal material types. The aspect ratio and/or area corresponding to the candidate powder contours are obtained in the virtual contour simulation model according to the parameters of the medicinal material types, the corresponding medicinal material forms, the medicinal material grinding process and the like, and are dynamically updated into the candidate contour list of the ticket.
Next, as shown in fig. 5, an alternative embodiment of step S104 may be implemented as the following step S508:
and step S508, if the number of candidate powder contours with the length-width ratio and/or the area meeting the defect contour conditions does not reach the defect number threshold, determining that the medicine is qualified in package. This indicates that there is no defect in which the solid particles are pressed against the transverse seals, or that the number of solid particles contained in the transverse seals is still within the tolerance range, and therefore, the pharmaceutical product package can be qualified.
Conversely, if the candidate powder contours satisfying the defect contour condition reach the defect number threshold, which indicates that too many solid particles exist in the transverse seals, the drug package can be judged to be unqualified in order to avoid the risk of drug leakage under the defect.
In practical applications, besides judging whether the transverse sealing defect exists by the defect number threshold in the above example, the transverse sealing defect can be judged in other manners, which is not limited in the application. For example, whether the medicine package is qualified or not is judged by the area proportion occupied by the candidate powder contours in the transverse seal image area. Or judging whether the medicine package is qualified or not through the maximum height corresponding to the candidate powder outline in the transverse seal image area.
In this application implementation, through the steps S501 to S508, the cross seal image area can be automatically extracted from the target image, and then whether solid particles exist in the cross seal image area is automatically detected, so as to determine whether defects exist in the cross seal image area, further improve the detection efficiency of the cross seal defects, and improve the accuracy of the detection of the cross seal defects.
In the above or the following embodiments, the image may be further subjected to automatic binarization processing, so as to provide a data base for an automatic defect detection process of medicine packaging, thereby further improving robustness and usability.
In practice, methods for binarizing images include, but are not limited to: the Otsu method (OTSU), the TRIANGLE (triangule) method, the window-based binarization method, and the fuzzy set theory-based automatic image binarization (Huang's fuzzy thresholding method).
Taking the outline of the medicine package as an example, the original image needs to be subjected to binarization processing. For example, to improve robustness and ease of use, the implementation principle of Huang's fuzzy thresholding method is as follows:
first, a fuzzy subset is defined that maps from image X (i.e., the original image) to a range of values [0,1 ]:
X={x mnX (x mn ))}
Wherein x is mn Represents the gray value, μ, of the pixel at the midpoint (m, n) of the image X X (x mn ) Indicating that the point has a membership value of a certain attribute. Wherein, mu is more than or equal to 0 X (x mn ) Less than or equal to 1, m=0, 1, …, M-1, n=0, 1, …, N-1. For binarization, each pixel has a similar relationship to the category to which it belongs, so μ can be expressed in terms of this relationship X (x mn ) Is a value of (2).
For a given threshold t, the average μ of the respective gradation values of the background pixel and the foreground pixel 0 Sum mu 1 Expressed by the following formula:
where h (g) represents the number of pixels in the image having a gray level g.
Average value mu of the background pixel tone 0 And foreground pixel tone average mu 1 Can be regarded as a specified thresholdThe relation between a point in the image X and the region to which the foreground and background values correspond to the value t should intuitively relate to the difference between the gray value of that point and the target value of the region to which it belongs. Thus, for point (m, n), the following membership definition function is used:
/>
wherein C is a constant that allows the above function to be satisfied: mu is more than or equal to 0.5 X (x mn )≤1。
Based on shannon entropy function, the entropy of one fuzzy set a is defined as:
wherein shannon function:
S(μ A (x i ))=-μ A (x i )ln[μ A (x i )]-[1-μ A (x i )]ln[1-μ A (x i )]
since the gray scale image has at most L color levels, the above equation can be further converted into:
Finally, taking the t value when the shannon entropy value is minimum as the final segmentation threshold value for all possible threshold values t. Therefore, the image X is subjected to color segmentation through the segmentation threshold value, automatic binarization processing of the image X is realized, and a binarized image is obtained.
Therefore, through the steps, the image related to the application is automatically binarized, a data base is provided for an automatic defect detection flow of medicine packaging, and the robustness and usability are further improved.
Having described the method of the exemplary embodiments of the present application, a seal-testing device for pharmaceutical packages, which may be provided in a seal-testing apparatus for pharmaceutical packages, according to the exemplary embodiments of the present application, is described next with reference to fig. 6, the device comprising:
a first acquisition unit 601 configured to acquire a target image; wherein the target image comprises image information of a target package; the target package is an independent package in the dual package; the dual package comprises two independent packages connected with each other; the image information comprises a sealing edge image area and/or a transverse sealing image area of the target package;
A second obtaining unit 602, configured to obtain, from the target image, pixels that have a preset optical variation trend with surrounding pixels as a contour to be detected;
a judging unit 603, configured to judge whether the target visual feature of the contour to be detected meets a preset detection condition; the preset detection conditions are set based on standard visual characteristics of the sealing edge image area and/or the transverse sealing image area;
and the determining unit 604 is configured to determine that the pharmaceutical product package is qualified if the target visual characteristic meets a preset detection condition.
As an alternative embodiment, the apparatus further comprises an image fitting unit for:
after the first acquisition unit 601 acquires a target image, extracting a first registration positioning point on a bounding box circumscribed by the maximum outline of the target package from the target image; the position of the first registration positioning point is related to the position of the target package in the duplex package; extracting a second registration setpoint associated with a marker from the target image; the marker is an identification pattern used for indicating a tailorable region in the duplex package; affine transformation is performed on the first registration anchor point and the second registration anchor point to perform image registration processing on the target image.
As an alternative embodiment, the second obtaining unit 602 is specifically configured to: extracting candidate edge contours from the target image according to the type of the light source in the detection environment; the difference in brightness between the candidate edge contour and surrounding pixels is related to the light source type;
the judging unit 603 specifically is configured to: calculating the maximum physical width of the candidate edge contour; judging whether the maximum physical width of the candidate edge profile is smaller than a preset sealing edge width threshold value or not;
the determining unit 604 is specifically configured to: and if the maximum physical width of the candidate edge profile is smaller than the maximum sealing edge width threshold, determining that the medicine package is qualified.
Wherein, as an optional embodiment, the first obtaining unit 601 is specifically configured to:
acquiring an original image containing a seal edge image area; and using a first sampling range corresponding to the sealing edge image area in the original image.
The first sampling range is determined based on at least one parameter of the relative position of the marker in the target package, the physical size of the marker, the position of the holder, the holder size, the edge profile of the medicine package and the sealing edge sampling coefficient.
Wherein, as an optional implementation manner, when the second obtaining unit 602 extracts the candidate edge contour from the target image according to the light source type in the detection environment, the second obtaining unit is specifically configured to:
if the light source type is a non-polarized light source, selecting pixels with brightness higher than a first brightness threshold value from the first sampling range as the candidate edge contours; wherein the first brightness threshold is higher than the maximum brightness of the bulk material of the duplex package under the unpolarized light source.
Alternatively, the second obtaining unit 602 is specifically configured to, when extracting the candidate edge contour from the target image according to the type of the light source in the detection environment:
if the light source type is a polarized light source, selecting pixels with brightness lower than a second brightness threshold and brightness higher than a third brightness threshold from the first sampling range as the candidate edge contours; the second brightness threshold is the minimum brightness of the main body material of the duplex package under the polarized light source, and the third brightness threshold is the maximum brightness of the marker in the duplex package under the polarized light source.
Wherein, as an optional implementation manner, the device further comprises a threshold value correction unit for
The second obtaining unit 602 identifies the light source type and the environmental parameter in the detection environment before extracting the candidate edge contour from the target image according to the light source type in the detection environment; the environment parameters comprise at least one parameter of an environment light parameter, a brightness noise parameter, a main body material type of the duplex package and a marker material type in a detection environment; dynamically correcting a brightness threshold corresponding to the light source type based on the environmental parameter;
as an alternative embodiment, the second obtaining unit 602 is specifically configured to: performing black cap operation on the target image to enhance brightness difference between pixels in the target image; performing binarization processing on the target image subjected to the black cap operation processing to obtain a binarized transverse seal image; searching candidate powder contours from the binarized transverse seal image;
the judging unit 603 specifically is configured to: calculating the length-width ratio and/or the area of the candidate powder contours; judging whether the number of candidate powder contours with length-width ratio and/or area meeting the defect contour conditions reaches a preset defect number threshold value or not;
the determining unit 604 is specifically configured to: and if the number of candidate powder contours with the length-width ratio and/or the area meeting the defect contour conditions does not reach the defect number threshold, determining that the medicine is qualified in package.
Wherein, as an optional embodiment, the first obtaining unit 601 is specifically configured to:
acquiring an original image containing a transverse seal image area; and using a second sampling range corresponding to the transverse seal image area in the original image.
The second sampling range is determined based on at least one parameter of the relative position of the marker in the target package, the physical size of the marker, the position of the holder, the holder size, the edge profile of the medicine package and the transverse seal sampling coefficient.
In this embodiment of the application, through the sealing detection device of medicine packing, draw the target visual characteristic of waiting to detect the profile from the image of medicine packing to whether the target visual characteristic of waiting to detect the profile accords with standard visual characteristic through predetermineeing the detection condition, thereby select qualified medicine packing, realized the automated inspection to medicine packing, improved medicine packing's sealing detection efficiency greatly. Meanwhile, by extracting the visual characteristics in the images, the problem of accuracy reduction caused by eye fatigue of people and the risk of secondary pollution of medicines caused by manual operation intervention are effectively avoided, the accuracy of seal detection of medicine packaging is greatly improved, and the medicine quality is ensured.
Having described the apparatus, method and device of the exemplary embodiments of the present application, reference will now be made to fig. 7 for describing a computer readable storage medium of the exemplary embodiments of the present application, which may be provided in a seal detection apparatus for pharmaceutical packaging, reference being made to fig. 7 for showing a computer readable storage medium being an optical disc 90 having stored thereon a computer program (i.e. a program product) which, when executed by a processor, implements the steps described in the above-described method embodiments, for example, obtaining a target image; wherein the target image comprises image information of a target package; the target package is an independent package in the dual package; the dual package comprises two independent packages connected with each other; the image information comprises a sealing edge image area and/or a transverse sealing image area of the target package; obtaining pixels which have a preset optical variation trend with surrounding pixels from the target image as contours to be detected; judging whether the target visual characteristics of the outline to be detected meet preset detection conditions or not; the preset detection conditions are set based on standard visual characteristics of the sealing edge image area and/or the transverse sealing image area; if the target visual characteristics meet preset detection conditions, determining that the medicine is qualified in package; the specific implementation of each step is not repeated here.
It should be noted that examples of the computer readable storage medium may also include, but are not limited to, a phase change memory (PRAM), a Static Random Access Memory (SRAM), a Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a flash memory, or other optical or magnetic storage medium, which will not be described in detail herein.
Having described the apparatus, methods, media, and devices of the exemplary embodiments of the present application, next, a computing device for seal detection of pharmaceutical packages of the exemplary embodiments of the present application, which may be disposed in a seal detection device of a pharmaceutical package, is described with reference to fig. 8.
Fig. 8 illustrates a block diagram of an exemplary computing device 100 suitable for use in implementing embodiments of the present application, the computing device 100 may be a computer system or a server. The computing device 100 shown in fig. 8 is only one example and should not be taken as limiting the functionality and scope of use of embodiments of the present application.
As shown in fig. 8, components of computing device 100 may include, but are not limited to: one or more processors or processing units 1001, a system memory 1002, and a bus 1003 that connects the various system components (including the system memory 1002 and processing units 1001).
Computing device 100 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computing device 100 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 1002 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 10021 and/or cache memory 10022. Computing device 100 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, ROM10023 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, commonly referred to as a "hard disk drive"). Although not shown in fig. 8, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media), may be provided. In such cases, each drive may be coupled to bus 1003 via one or more data media interfaces. The system memory 1002 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the present application.
A program/utility 10025 having a set (at least one) of program modules 10024 may be stored, for example, in system memory 1002, and such program modules 10024 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 10024 generally perform the functions and/or methods in the embodiments described herein.
Computing device 100 may also communicate with one or more external devices 1004 (e.g., keyboard, pointing device, display, etc.). Such communication may occur through an input/output (I/O) interface 605. Moreover, computing device 100 may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet via network adapter 1006. As shown in fig. 8, the network adapter 1006 communicates with other modules of the computing device 100 (e.g., processing unit 1001, etc.) over the bus 1003. It should be appreciated that although not shown in fig. 8, other hardware and/or software modules may be used in connection with computing device 100.
The processing unit 1001 executes various functional applications and data processing by running a program stored in the system memory 1002, for example, acquires a target image; wherein the target image comprises image information of a target package; the target package is an independent package in the dual package; the dual package comprises two independent packages connected with each other; the image information comprises a sealing edge image area and/or a transverse sealing image area of the target package; obtaining pixels which have a preset optical variation trend with surrounding pixels from the target image as contours to be detected; judging whether the target visual characteristics of the outline to be detected meet preset detection conditions or not; the preset detection conditions are set based on standard visual characteristics of the sealing edge image area and/or the transverse sealing image area; and if the target visual characteristics meet preset detection conditions, determining that the medicine package is qualified. The specific implementation of each step is not repeated here. It should be noted that although in the above detailed description several units/modules or sub-units/sub-modules of a closure detection device for pharmaceutical packages are mentioned, such a division is only exemplary and not mandatory. Indeed, the features and functionality of two or more units/modules described above may be embodied in one unit/module according to embodiments of the present application. Conversely, the features and functions of one unit/module described above may be further divided into ones that are embodied by a plurality of units/modules.
In the description of the present application, it should be noted that the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the foregoing examples are merely specific embodiments of the present application, and are not intended to limit the scope of the present application, but the present application is not limited thereto, and those skilled in the art will appreciate that while the foregoing examples are described in detail, the present application is not limited thereto. Any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or make equivalent substitutions for some of the technical features within the technical scope of the disclosure of the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Furthermore, although the operations of the methods of the present application are depicted in the drawings in a particular order, this is not required to or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.

Claims (10)

1. A method of detecting a seal of a pharmaceutical package, comprising:
acquiring a target image; wherein the target image comprises image information of a target package; the target package is an independent package in the dual package; the dual package comprises two independent packages connected with each other; the image information comprises a sealing edge image area and/or a transverse sealing image area of the target package;
obtaining pixels which have a preset optical variation trend with surrounding pixels from the target image as contours to be detected;
judging whether the target visual characteristics of the outline to be detected meet preset detection conditions or not; the preset detection conditions are set based on standard visual characteristics of the sealing edge image area and/or the transverse sealing image area;
and if the target visual characteristics meet preset detection conditions, determining that the medicine package is qualified.
2. The method of claim 1, further comprising, after the acquiring the target image:
extracting a first registration positioning point on a bounding box circumscribed by the maximum outline of the target package from the target image; the position of the first registration positioning point is related to the position of the target package in the duplex package;
Extracting a second registration setpoint associated with a marker from the target image; the marker is an identification pattern used for indicating a tailorable region in the duplex package;
affine transformation is performed on the first registration anchor point and the second registration anchor point to perform image registration processing on the target image.
3. The method according to claim 1, wherein the obtaining pixels with a preset optical variation trend with surrounding pixels from the target image as the contour to be detected includes:
extracting candidate edge contours from the target image according to the type of the light source in the detection environment; the difference in brightness between the candidate edge contour and surrounding pixels is related to the light source type;
the judging whether the target visual characteristics of the outline to be detected meet the preset detection conditions comprises the following steps:
calculating the maximum physical width of the candidate edge contour;
judging whether the maximum physical width of the candidate edge profile is smaller than a preset sealing edge width threshold value or not;
the determining that the pharmaceutical product is packaged acceptable comprises:
and if the maximum physical width of the candidate edge profile is smaller than the sealing edge width threshold value, determining that the medicine package is qualified.
4. A method according to claim 3, wherein the acquiring the target image comprises:
acquiring an original image containing a seal edge image area;
using a first sampling range corresponding to a seal edge image area in the original image;
the first sampling range is determined based on at least one parameter of the relative position of the marker in the target package, the physical size of the marker, the position of the holder, the holder size, the edge profile of the medicine package and the sealing edge sampling coefficient.
5. The method of claim 4, wherein extracting candidate edge contours from the target image based on light source types in a detection environment comprises:
if the light source type is a non-polarized light source, selecting pixels with brightness higher than a first brightness threshold value from the first sampling range as the candidate edge contours;
wherein the first brightness threshold is higher than the maximum brightness of the bulk material of the duplex package under the unpolarized light source;
if the light source type is a polarized light source, selecting pixels with brightness lower than a second brightness threshold and brightness higher than a third brightness threshold from the first sampling range as the candidate edge contours;
The second brightness threshold is the minimum brightness of the main body material of the duplex package under the polarized light source, and the third brightness threshold is the maximum brightness of the marker in the duplex package under the polarized light source.
6. The method of claim 5, wherein before extracting candidate edge contours from the target image based on the type of light source in the detection environment, further comprising:
identifying a light source type and an environmental parameter in the detection environment; the environment parameters comprise at least one parameter of an environment light parameter, a brightness noise parameter, a main body material type of the duplex package and a marker material type in a detection environment;
and dynamically correcting the brightness threshold corresponding to the light source type based on the environment parameter.
7. The method according to claim 1, wherein the obtaining pixels with a preset optical variation trend with surrounding pixels from the target image as the contour to be detected includes:
performing black cap operation on the target image to enhance brightness difference between pixels in the target image;
performing binarization processing on the target image subjected to the black cap operation processing to obtain a binarized transverse seal image;
Searching candidate powder contours from the binarized transverse seal image;
the judging whether the target visual characteristics of the outline to be detected meet the preset detection conditions comprises the following steps:
calculating the length-width ratio and/or the area of the candidate powder contours;
judging whether the number of candidate powder contours with length-width ratio and/or area meeting the defect contour conditions reaches a preset defect number threshold value or not;
the determining that the pharmaceutical product is packaged acceptable comprises:
if the number of candidate powder contours with the length-width ratio and/or the area meeting the defect contour conditions does not reach the defect number threshold, determining that the medicine is qualified in package;
the acquiring the target image includes:
acquiring an original image containing a transverse seal image area;
a second sampling range corresponding to the transverse seal image area in the original image is used;
the second sampling range is determined based on at least one parameter of the relative position of the marker in the target package, the physical size of the marker, the position of the holder, the holder size, the edge profile of the medicine package and the transverse seal sampling coefficient.
8. A seal-testing device for pharmaceutical packaging, the device comprising:
A first acquisition unit configured to acquire a target image; wherein the target image comprises image information of a target package; the target package is an independent package in the dual package; the dual package comprises two independent packages connected with each other; the image information comprises a sealing edge image area and/or a transverse sealing image area of the target package;
the second acquisition unit is used for acquiring pixels which have a preset optical variation trend with surrounding pixels from the target image as contours to be detected;
the judging unit is used for judging whether the target visual characteristics of the outline to be detected meet preset detection conditions or not; the preset detection conditions are set based on standard visual characteristics of the sealing edge image area and/or the transverse sealing image area;
and the determining unit is used for determining that the medicine package is qualified if the target visual characteristics meet preset detection conditions.
9. A computing device, the computing device comprising:
at least one processor, memory, and input output unit;
wherein the memory is for storing a computer program and the processor is for invoking the computer program stored in the memory to perform the closure detection method of the pharmaceutical product package of any one of claims 1 to 7.
10. A computer readable storage medium comprising instructions that when executed on a computer cause the computer to perform the method of tamper evident detection of pharmaceutical product packaging according to any one of claims 1 to 7.
CN202311125466.XA 2023-09-01 2023-09-01 Method, device, equipment and storage medium for detecting seal of medicine package Active CN117152088B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311125466.XA CN117152088B (en) 2023-09-01 2023-09-01 Method, device, equipment and storage medium for detecting seal of medicine package

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311125466.XA CN117152088B (en) 2023-09-01 2023-09-01 Method, device, equipment and storage medium for detecting seal of medicine package

Publications (2)

Publication Number Publication Date
CN117152088A CN117152088A (en) 2023-12-01
CN117152088B true CN117152088B (en) 2024-02-06

Family

ID=88911469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311125466.XA Active CN117152088B (en) 2023-09-01 2023-09-01 Method, device, equipment and storage medium for detecting seal of medicine package

Country Status (1)

Country Link
CN (1) CN117152088B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102496161A (en) * 2011-12-13 2012-06-13 浙江欧威科技有限公司 Method for extracting contour of image of printed circuit board (PCB)
CN105675614A (en) * 2016-02-19 2016-06-15 清华大学 Packaging bag sealing quality detection device and method
CN115170493A (en) * 2022-06-28 2022-10-11 中国人民解放军南部战区总医院 Identification method and system for micro-defect of sterile package and storage medium
CN115294135A (en) * 2022-10-09 2022-11-04 临沂华太电池有限公司 Battery edge curling and sealing quality detection method
WO2022241879A1 (en) * 2021-05-19 2022-11-24 上海浚真生命科学有限公司 Image processing method, image processing device, and optical detection apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102496161A (en) * 2011-12-13 2012-06-13 浙江欧威科技有限公司 Method for extracting contour of image of printed circuit board (PCB)
CN105675614A (en) * 2016-02-19 2016-06-15 清华大学 Packaging bag sealing quality detection device and method
WO2022241879A1 (en) * 2021-05-19 2022-11-24 上海浚真生命科学有限公司 Image processing method, image processing device, and optical detection apparatus
CN115170493A (en) * 2022-06-28 2022-10-11 中国人民解放军南部战区总医院 Identification method and system for micro-defect of sterile package and storage medium
CN115294135A (en) * 2022-10-09 2022-11-04 临沂华太电池有限公司 Battery edge curling and sealing quality detection method

Also Published As

Publication number Publication date
CN117152088A (en) 2023-12-01

Similar Documents

Publication Publication Date Title
WO2021000702A1 (en) Image detection method, device, and system
CN105303189B (en) It is a kind of for detecting the method and device of specific identifier image in presumptive area
US11443133B2 (en) Computer vision system for industrial equipment gauge digitization and alarms
TWI225624B (en) Method and apparatus for digital image segmentation using an iterative method
TW512636B (en) Optical inspection system
JP5810628B2 (en) Image processing apparatus and image processing program
WO2015149009A1 (en) Systems and methods for identifying traffic control devices and testing the retroreflectivity of the same
US9064314B2 (en) Robust automatic determination and location of MacBeth color checker charts
BRPI0719838B1 (en) method to identify a person's facial region in a digital image
CN105069453A (en) Image correction method and apparatus
CN110909640A (en) Method and device for determining water level line, storage medium and electronic device
CN108510477B (en) Method and device for positioning color block of test paper
CN110264523B (en) Method and equipment for determining position information of target image in test image
CN111325717A (en) Mobile phone defect position identification method and equipment
CN108615030A (en) A kind of title consistency detecting method, device and electronic equipment
CN112347292A (en) Defect labeling method and device
KR101330567B1 (en) pill-detection method for pill box
JP2012249065A (en) Image processor and image processing program
CN113283439B (en) Intelligent counting method, device and system based on image recognition
CN117152088B (en) Method, device, equipment and storage medium for detecting seal of medicine package
CN105136818B (en) The image detection method of printed base plate
CN110310341B (en) Method, device, equipment and storage medium for generating default parameters in color algorithm
WO2021129374A1 (en) Method and device for identifying changes in composition of object
CN115311237A (en) Image detection method and device and electronic equipment
CN110866928B (en) Target boundary segmentation and background noise suppression method and device based on neural network

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