Pill inspection apparatus and pill inspection method

A pill inspection apparatus of the present invention includes: an illumination portion 30 for irradiating light to a medical envelope 20 in which at least a translucent pill 22 is enclosed; an imaging portion 11 for acquiring a transmission image of the irradiated medical envelope 20; and an image processing portion 12 for detecting, as the translucent pill 22, a pill having a brightness value of its outer periphery lower than that of its center using the transmission image, the illumination portion 30 includes a light emitting portion 31, and a light-collecting portion 33 for collecting light is provided between the light emitting portion 31 and the medical envelope 20. By obtaining a uniform outline of the translucent pill 22 irrespective of a shooting position, it is possible to inspect the translucent pill 22 irrespective of a permeation rate.

TECHNICAL FIELD

The present invention relates to a pill inspection apparatus and a pill inspection method for inspecting a pill enclosed in a medical envelope.

BACKGROUND TECHNIQUE

In a hospital and a pharmacy, it is necessary to precisely prepare a medicine based on a prescription. Hence, inspection of preparation of a medicine is carried out after the medicine is prepared. As the preparation operation of a medicine, a pill packaging machine first carries out a packaging operation for packaging different kinds of pills in a medical envelope which is a medical bag. As the inspection of preparation of a medicine, a pill inspection apparatus takes an image of the medical envelope and binarizes the shot images (taken pictures) and then, counts the number of pills existing in the binarized image, and inspects the pills.

As pills, there are translucent pills through which light can pass and opaque pills which block light.

Permeation rates of the translucent pills vary depending upon their kinds, and brightness values of the translucent pills on their images are also different from each other. Depending upon kinds of the translucent pills, brightness value distribution of translucent pills partially overlap brightness value distribution of a back ground. Therefore, it is difficult to precisely carry out the inspection.

FIG. 6show a conceptual diagram and a shot image of transmission of a translucent pill when diffusion light is used as illumination.

As shown inFIG. 6(a), light which can be received by an imaging portion11is limited to light which moves along lines35a,35b,35c,35d,35e,35fand35g. Light which passes through centers of translucent pills22straightly travels along the line35d, and as the light comes close to an outer peripheral portion in the order of the lines35c,35band35a, refraction at the translucent pills22becomes large. If light irradiated from a light emitting portion31is diffusion light in this manner, since irradiation angles of light are various, light irradiated from the light emitting portion31reaches the imaging portion11at any angles of the lines35a,35b,35c,35d,35e,35fand35g. Hence, pixels having low brightness values showing the translucent pills22are not produced, outlines of the translucent pills22are clearly shot on the transmission image which is acquired by the imaging portion11.

When diffusion light is used as illumination, opaque pills21in a medical envelope20are clearly shot as shown in a transmission image inFIG. 6(b). However, light passes through a transparency film of the medical envelope20which becomes a back ground, and light also passes through the translucent pills22depending upon a permeation rate thereof. Hence, brightness values of the back ground and the translucent pill22become almost the same. Therefore, even if the binarization processing and edge extraction processing are carried out for the shot image, it is only possible to slightly extract only the outer periphery of the translucent pill22, and it is difficult to clearly distinguish from the translucent pill22the back ground. In this case, it is difficult to adjust a threshold value by binarization of the shot image, and an outline of the translucent pill22is frequently cut. Further, if the shot image is subjected to smoothing processing to remove other noises, the outline of the translucent pill22is removed like the noises. Hence, even if imaging processing is carried out, it is not possible to detect as the translucent pill22. Here, the back ground means a region where pills do not exist in the shot image, and is a region which passes through only the transparency film.

FIG. 7show a conceptual diagram and a shot image of transmission of a translucent pill when parallel light is used as illumination.

InFIG. 7, to emit parallel light, an illumination portion30includes a parallel light converting portion32for converting diffusion light into parallel light and also includes a light emitting portion31.

As shown inFIG. 7(a), if light irradiated from the illumination portion30is parallel light, since variation of irradiation angle is small, a location through which light cannot pass is generated in the translucent pill22. Light having an angle which is close to the irradiation angle like the line35dreaches the imaging portion11. However, in the case of light having the angles like the lines35a,35b,35c,35e,35fand35g, since irradiation light which is irradiated from the parallel light converting portion32does not have an angle, light which enters the imaging portion11becomes weak, and a brightness value of the outer periphery of the translucent pill22becomes low.

Hence, as shown inFIG. 7(b), a brightness value of a center of the translucent pill22becomes high and a brightness value of the outer periphery becomes low. Therefore, an outline of the translucent pill22is clearly shot on the transmission image which is acquired by the imaging portion11.

FIG. 8is a diagram for explaining parallel light which is irradiated from an illumination portion.

As shown inFIG. 8, out of parallel light which is irradiated from the illumination portion30, light (lines36a,36g) which passes through a medical envelope is not refracted and thus, such light straightly travels. However, out of light (lines36bto36f) which passes through a transparent pill, light which passes through the outer periphery of the translucent pill22is refracted significantly. Therefore, such light does not reach the imaging portion11, and a brightness value of the outer periphery of the translucent pill22is lowered. On the other hand, in the case of light which passes through a location in the vicinity of the center of the translucent pill22, since a degree of refraction thereof is small, the imaging portion11receives the light and a brightness value becomes high.

Here, since a refraction index is determined by curvature of the translucent pill22, a brightness value of the outer periphery of the translucent pill22becomes low irrespective of a permeation rate of the translucent pill22. By utilizing the fact that the brightness value of the outer periphery of the translucent pill22is lowered by the parallel light, it is possible to clearly distinguish the translucent pill22and the back ground from each other, and to precisely detect the translucent pill22.

Irradiation of parallel light is described in patent document 1.

PRIOR ART DOCUMENT

Patent Document

SUMMARY OF THE INVENTION

Problem to be Solved by the Invention

If parallel light is used, it is possible to clarify an outline of the translucent pill22as compared with a case where diffusion light is used.

However, when the translucent pill22exists directly below the imaging portion11, the outline can be clarified, but when the translucent pill22exists at a position deviated from directly below the imaging portion11, deviation is generated in the outline.

FIG. 9(a)is an explanatory diagram when the translucent pill22exists at the position deviated from directly below the imaging portion11, andFIG. 9(b)is a shot image.

As shown inFIG. 9(b), when an imaging position (shooting position, hereinafter) is deviated from below the imaging portion11in the vertical direction, deviation is generated in the outline of the translucent pill22, and a case where the outline cannot be recognized by this deviation is generated.

Hence, it is an object of the present invention to provide a pill inspection apparatus and a pill inspection method capable of inspecting a translucent pill irrespective of a permeation rate by obtaining a uniform outline of the translucent pill irrespective of a shooting position.

Means for Solving the Problem

A first aspect of the present invention provides a pill inspection apparatus including: an illumination portion for irradiating light to a medical envelope in which at least a translucent pill is enclosed; an imaging portion for acquiring a transmission image of the irradiated medical envelope; and an image processing portion for detecting, as the translucent pill, a pill having a brightness value of its outer periphery lower than that of its center using the transmission image, wherein the illumination portion includes a light emitting portion, and a light-collecting portion for collecting the light is provided between the light emitting portion and the medical envelope.

According to a second aspect of the invention, in the pill inspection apparatus of the first aspect, the light emitting portion emits diffusion light, and a parallel light converting portion for converting the diffusion light into parallel light is provided between the light emitting portion and the light-collecting portion.

According to a third aspect of the invention, in the pill inspection apparatus of the second aspect, the light-collecting portion is a convex lens or a Fresnel lens.

According to a fourth aspect of the invention, in the pill inspection apparatus of the any one of first to third aspects, a domical illumination portion is provided between the medical envelope and the imaging portion.

A fifth aspect of the present invention provides a pill inspection method including: a step of irradiating light to a medical envelope in which at least a translucent pill is enclosed to acquire a transmission image; a step of detecting, as the translucent pill, a pill having a brightness value of its outer periphery lower than that of its center using the transmission image; and a step of collecting the light from an illumination portion into an imaging portion.

Effect of the Invention

According to the present invention, it is possible to provide a pill inspection apparatus and a pill inspection method capable of inspecting a translucent pill irrespective of a permeation rate by obtaining a uniform outline of the translucent pill irrespective of a shooting position.

MODE FOR CARRYING OUT THE INVENTION

A pill inspection apparatus according to a first aspect of the present invention includes a light-collecting portion for collecting the light is provided between the light emitting portion and the medical envelope. According to this aspect, it is possible to inspect a translucent pill irrespective of a permeation rate by obtaining a uniform outline of the translucent pill irrespective of a shooting position.

According to a second aspect, in the pill inspection apparatus of the first aspect, the light emitting portion emits diffusion light, and a parallel light converting portion for converting the diffusion light into parallel light is provided between the light emitting portion and the light-collecting portion. According to this aspect, by collecting the parallel light after the diffusion light is converted into the parallel light, it is possible to obtain a uniform outline of the translucent pill.

According to a third aspect, in the pill inspection apparatus of the second aspect, the light-collecting portion is a convex lens or a Fresnel lens. According to this aspect, by using the Fresnel lens, it is possible to shorten a distance between an illumination portion and the medical envelope.

According to a fourth aspect, in the pill inspection apparatus of any one of the first to third aspects, a domical illumination portion is provided between the medical envelope and the imaging portion. According to this aspect, even if the domical illumination is provided, it is possible to obtain a uniform outline of the translucent pill without being influenced by the domical illumination.

A pill inspection method according to a fifth aspect of the present invention includes a step of irradiating light to a medical envelope in which at least a translucent pill is enclosed to acquire a transmission image; a step of detecting, as the translucent pill, a pill having a brightness value of its outer periphery lower than that of its center using the transmission image; and a step of collecting the light from an illumination portion into an imaging portion. According to this aspect, it is possible to inspect a translucent pill irrespective of a permeation rate by obtaining a uniform outline of the translucent pill irrespective of a shooting position.

Embodiment

An embodiment of the present invention will be described together with the drawings.

FIG. 1is a block diagram showing a pill inspection apparatus according to the embodiment of the invention, andFIG. 2is a perspective view of a parallel light converting portion used in the pill inspection apparatus. The same reference symbols are allocated to the same constituent elements, and explanation thereof will be omitted in some cases. For ease of comprehension, the drawings are illustrated schematically mainly based on the respective constituent elements.

The pill inspection apparatus inspects whether appropriate pills are enclosed in a medical envelope20in accordance with prescription. Pills according to the prescription are enclosed in the medical envelope20by a pill packaging machine (not shown).

As shown inFIG. 1, to carry out an inspection operation, the pill inspection apparatus acquires an image of the medical envelope20including an opaque pill and a translucent pill by an imaging portion11. An image processing portion12counts the number of pills based on the image of the medical envelope20acquired by the imaging portion11, brings the counted number and the number of pills described in the prescription into check, and determines whether the pills are appropriately enclosed in the medical envelope20. A camera portion is used as the imaging portion11for example. The imaging portion11acquires a transmission image of the medical envelope20into which light is irradiated from an illumination portion30. The imaging portion11includes an image element and a lens. A mounting table13conveys the medical envelope20.

The mounting table13includes a guide portion15provided on an end of a mounting surface. The medical envelope20is mounted on the mounting surface. The mounting table13also includes a transparent plate16through which light of the illumination portion30passes. The guide portion15is provided therein with a drive roller and a guide roller (both not shown). An end of the medical envelope20is sandwiched between the drive roller and the guide roller, and the drive roller is rotated. According to this, the medical envelope20is moved along the guide portion15. The mounting table13is placed between the imaging portion11and the illumination portion30.

The imaging portion11is opposed to the mounting surface of the mounting table13on which the medical envelope20is mounted, and the imaging portion11is located above the illumination portion30. The imaging portion11shots, from above, an image of the medical envelope20into which light is irradiated from below the mounting surface, and acquires a transmission image of the medical envelope20.

A display portion14is connected to the image processing portion12, and displays an image of pills detected by the image processing portion12. Hence, a tester (examiner) can visually inspects using the display portion14.

A domical illumination portion40is provided below the imaging portion11and above the transparent plate16. The medical envelope20is irradiated with light from the domical illumination portion40, and the medical envelope20is shot by the camera unit11.

The illumination portion30irradiates, with light, the medical envelope20enclosing the translucent pills22and the opaque pills21. The illumination portion30includes a light emitting portion31which emits diffusion light, a parallel light converting portion32which converts diffusion light into parallel light, and a light-collecting portion33which collects parallel light. A LED which is mounted to a diffusion plate is used as the light emitting portion31. A convex lens or a Fresnel lens is used as the light-collecting portion33.

A distance from the imaging portion11to the light-collecting portion33is equal to a focal distance of the light-collecting portion33. In this embodiment, light is collected by the light-collecting portion33after diffusion light is converted into the parallel light by the parallel light converting portion32. Alternatively, light diffused from a single light source may be collected. In this case, the distance from the imaging portion11to the light-collecting portion33is equal to a half of the focal distance of the light-collecting portion33.

The opaque pills21which block light and translucent pills22through which light passes with a constant transmission factor are enclosed in the medical envelope20.

The opaque pill21blocks light. Many of general pills are opaque pills21.

Each of the translucent pills22encloses medicinal solution with a transparent film. Hence a degree of transmission of light differs depending upon a degree of transmission of the medicinal solution. Since the translucent pill22encloses the medicinal solution, the translucent pill22has a roundish shape such as a ball shape, a spheroid shape and a capsule shape.

The medical envelope20includes a pasted board region20ahaving a permeation rate lower than that of the transparency film so that information is printed. The medical envelope20also includes non-pasted board regions20bof transparency films.

As shown inFIG. 1, the imaging portion11acquires a transmission image of the medical envelope20. The transmission image includes translucent pills22having low brightness values of an obtained outer periphery. Utilizing the fact that the brightness value of the outer periphery of the translucent pill22becomes low, the image processing portion12detects an outline of the translucent pill22from the transmission image of the medical envelope20.

After the pill inspection apparatus acquires the transmission image of the medical envelope20by the imaging portion11, the pill inspection apparatus detects translucent pills22included in the transmission image of the medical envelope20and detects opaque pills21included in the transmission image of the medical envelope20. The number of pills of the prescription and a sum of the number of detected translucent pills22and the number of detected opaque pills21are compared with each other, and it is determined whether an appropriate number of pills exist in the medical envelope20, thereby checking the number of pills. The pill inspection apparatus inspects the pills in such a method. Details of the checking operation of the number of pills carried out by the pill inspection apparatus will be described based on a flowchart shown inFIG. 5.

As shown inFIG. 2, the parallel light converting portion32converts diffusion light into parallel light. The parallel light converting portion32is formed of laminated bodies32cand32dwhich are formed by laminating, on one another, transmission bands32athrough which visible light passes and absorption belts32bwhich absorb visible light. Here, the laminated body32cand the laminated body32dare superposed on each other such that a laminating direction of the transmission band32aand the absorption belt32bof the laminated body32cand a laminating direction of the transmission band32aand the absorption belt32bof the laminated body32dintersect with each other at right angles. Out of diffusion light which is emitted from the light emitting portion31, only light which enters at a predetermined incident angle passes through the parallel light converting portion32, and the parallel light converting portion32absorbs light which enters at incident angles other than the former incident angle. Since only the light having the predetermined incident angle passes through the parallel light converting portion32, light radiated from the parallel light converting portion32becomes parallel light. This parallel light is collected by the light-collecting portion33. A louvered film can be used as the parallel light converting portion32.

Next, a reason why the translucent pills22can precisely be detected using the transmission image of the medical envelope20acquired by the imaging portion11will be described.

FIG. 3(a)is a conceptual diagram of transmission of the translucent pills22when light is collected at the imaging portion11, andFIG. 3(b)is a diagram showing transmission image of the shot translucent pills22.

FIG. 3(a)shows a translucent pill22A located directly below the imaging portion11in the vertical direction, and a translucent pill22B located at a position deviated from directly below the imaging portion11in the vertical direction.

Each of the translucent pills22has a roundish shape. Hence, the translucent pill22plays a role as a lens, light passing through the outer periphery of the translucent pill22is refracted, and light passing through a center thereof straightly travels.

At the translucent pill22A located directly below the imaging portion11in the vertical direction, light passing through the center reaches the imaging portion11and its brightness value becomes high like the parallel light, but light passing through the outer periphery which enters the imaging portion11becomes weak, and its brightness value becomes low. The translucent pill22has a roundish shape such as a ball shape, a spheroid shape and a capsule shape, and a refraction index thereof is gradually varied from the outer periphery toward the center of the translucent pill22. Therefore, the outer periphery where the brightness value becomes low has a width of a certain level. A shape of a region having the low brightness value matches with an outline shape of the translucent pill22. Therefore, image processing for comparing the shapes, e.g., image processing such as pattern matching becomes easy.

At the translucent pill22B located at the position deviated from directly below the imaging portion11in the vertical direction, its outline is deviated as shown inFIG. 9in the case of the parallel light. In this embodiment, however, all of light passing through the translucent pill22B travels toward the imaging portion11, its outline is not deviated, light passing through the center reaches the imaging portion11, a brightness value thereof becomes high, light passing through the outer periphery which enters the imaging portion11becomes weak and its brightness value becomes low.

FIG. 4are conceptual diagrams of transmission of translucent pills when the domical illumination shown inFIG. 1is provided,FIG. 4(a)shows the present embodiment where light is collected by the imaging portion andFIG. 4(b)shows a transmission image of the translucent pills.FIG. 4(c)shows a comparative example using diffusion light, andFIG. 4(d)shows a comparative example using parallel light. In the drawings, thickness of arrows shows intensity of light.

InFIG. 4(a), since light is collected at the imaging portion11by the light-collecting portion33, light from the light-collecting portion33is not reflected by the domical illumination portion40so often. Since the amount of light reflected from the domical illumination portion40is small, a feature of illumination using parallel light, i.e., a feature that a brightness value of the center of the translucent pill22is high and a brightness value of the outer periphery is low is emphasized.

On the other hand, in the comparative example using diffusion light shown inFIG. 4(c)and in the comparative example using parallel light shown inFIG. 4(d), since a periphery of the domical illumination portion40is illuminated with strong light, such light is reflected by the domical illumination portion40. Hence, translucent pill22is also illuminated with such the reflection light from the domical illumination portion40, and a brightness value of the entire translucent pill22becomes high. According to this, the feature of illumination using parallel light, i.e., the feature that the brightness value of the center of the translucent pill22is high and the brightness value of the outer periphery is low becomes weak due to the fact that the brightness value of the entire translucent pill22becomes high, and it becomes difficult to detect the translucent pill22.

In the case of the transmission image of the present embodiment obtained by collecting light at the imaging portion11, an outline of the opaque pill21located at a position away from directly below the imaging portion11in the vertical direction is also clear, and the outline of the outer periphery of the translucent pill22is also uniform and clear. Hence, the image processing portion12can easily detect the outlines of the opaque pill21and the translucent pill22by the transmission image. In this embodiment, detection of the translucent pill22is carried out by pattern matching between the transmission image and sample images of the translucent pills22, and the number of detected translucent pills22is calculated. Further, since images of the opaque pill21and the translucent pill22are different from each other due to a difference in the transmission factor, it is possible to clearly distinguish between the opaque pill21and the translucent pill22in this embodiment.

Before the pattern matching between the transmission image and the sample image of the translucent pill22is carried out, the image processing portion12carries out a thinning operation and edge extraction by an extreme value with respect to the transmission image, and detects an outline of the translucent pill22by the transmission image. By carrying out the thinning operation and edge extraction by the extreme value with respect to the transmission image in this manner, noise is removed, and the outline of the pill is clarified. Here, the brightness value of the outer periphery of the translucent pill22is low and its width is constant as described above. However, if parallel light in which light is not collected is used, a refraction index of light which reaches the imaging portion11is changed depending upon an attitude of the pill and a relative position from the imaging portion11. Hence, even if a kind of pills is the same, a wide portion and a narrow portion of the outer periphery having the low brightness value are generated. By collecting parallel light, influence of a relative position from the imaging portion11is reduced, and a width of the outer periphery having a low brightness value becomes uniform. At the time of detection of the translucent pill22such as the pattern matching, since the width of the outer periphery becomes uniform, it is possible to minimize adverse influence such as cut of the outline of the translucent pill22. Since the refraction index of the translucent pill22from the center to the outer periphery is changed in stages, the brightness value of the outer periphery of the translucent pill22is changed from the center in stages. Concerning the outermost side of the translucent pill22, however, the brightness value is changed extremely. Therefore, when the transmission image is subjected to the differential processing to extract an edge, the thinning operation for leaving only an extreme value having a large changing amount is carried out. According to this, it is possible to leave only the outermost outer periphery. Concerning the outermost outer periphery, i.e., the outline of the translucent pill22, since a size of the outline is also determined by a size of each of the pills, stable pattern matching which is not influence by a position and an attitude of the pill can be realized.

Here, the medical envelope20includes a pasted board region20ahaving a permeation rate lower than that of the transparency film for printing, and a non-pasted board region20bof the transparency film. In the pasted board region20a, if the translucent pill22exists on a boundary between the pasted board region20aand the non-pasted board region20bfor weakening light of the illumination portion30, a brightness value of one translucent pill22differs on the side of the pasted board region20aand on the side of the non-pasted board region20b. As a result, if attempt is made to detect the outline of the translucent pill22, the outline is erroneously detected in some cases. Hence, when the outline of the translucent pill22is detected by the transmission image of the medical envelope20, the transmission image of the medical envelope20is divided into the pasted board region20aand the non-pasted board region20b, and the outline of the translucent pill22is detected using two threshold values, i.e., a pasted board region threshold value for detecting the outline of the translucent pill22by the pasted board region20a, and a non-pasted board region threshold value for detecting the outline of the translucent pill22by the non-pasted board region20b.

If the image processing portion12uses the two threshold values for detecting the outline of the translucent pill22in this manner, even if the translucent pills22exist in the pasted board region20aand the non-pasted board region20b, the translucent pills22can be detected as one pill.

When the image processing portion12extracts the edge, the image processing portion12recognizes the longest line and the second longest as a boundary line of the pasted board region20a, and recognizes a space between these two lines as the pasted board region20a. Since the pasted board region20ais formed as a wide range so that it is easy to notice, it is possible to easily discriminate the pasted board region20aby detecting the longest line and the second longest line.

Next, a pill inspection method which is carried out by using the above-described pill inspection apparatus will be described.

FIG. 5is a flowchart showing the pill inspection method using the pill inspection apparatus of the present embodiment.

First, the pill inspection apparatus collects parallel light from the parallel light converting portion32at the imaging portion11by the light-collecting portion33, the pill inspection apparatus irradiates the light to the medical envelope20including the translucent pill22, and acquires the transmission image including the translucent pill22having a low brightness value of the outer periphery (step S01). Here, the transmission image includes an image of the opaque pill21and an image of the translucent pill22.

Next, the pill inspection apparatus detects the translucent pills22by the transmission image. To calculate a threshold value for detecting the translucent pill22, the pill inspection apparatus carries out the edge extraction processing by a Canny method for the transmission image of the medical envelope20. Straight lines are extracted by haugh conversion from the edge image obtained by the edge extraction processing. Out of straight lines obtained by the straight line extraction, the longest two straight lines extending in the longitudinal direction of the pasted board region20aare combined as one group, and an interior thereof is extracted as the pasted board region20a. A mode value of the pasted board region20aand a mode value of a pixel other than the pasted board region20aare compared with each other, and a threshold value for extracting the edge of step S03is calculated by the ratio (step S02). To clarify the outlines of the opaque pill21and the translucent pill22, the pill inspection apparatus carries out the thinning operation for the transmission image of the medical envelope20by the edge extraction by the Canny method and the extreme value (step S03). In step S03, the translucent pills22are detected by pattern matching with respect to the sample image from the edge extraction image which is subjected to the edge extraction. More specifically, a sample image of only the outline is prepared by the image processing portion12from a size of the translucent pill22described in a prescription, pattern matching is carried out between the sample image and the edge image of the transmission image of the medical envelope20, and the translucent pills22are detected from the transmission image. The number of the detected translucent pills22is calculated as the number of the translucent pills22(step S04). From step S01to step S04, the number of translucent pills22enclosed in the medical envelope20can precisely be calculated.

Next, the pill inspection apparatus detects the opaque pills21. First, the translucent pills22are removed from the transmission image of the medical envelope20(step S05). Next, the transmission image from which the translucent pills22are removed is binarized (step S06). The number of opaque pills21is calculated from the binarized transmission image by corner extraction. Since the opaque pills21are left in the transmission image of the binarized medical envelope20, the number of calculated pills becomes equal to the number of opaque pills21(step S07).

Next, the number of pills of the prescription and a sum of the number of the detected translucent pills22and the number of the detected opaque pills21are compared with each other, and it is determined whether an appropriate number of pills exist in the medical envelope20(step S08). By determining whether the sum of the number of translucent pills22calculated in step S04and the number of opaque pills21calculated in step S07is the appropriate number, the number of pills is checked. From step S01to step S08, the total number of pills enclosed in the medical envelope20is calculated.

In this manner, the pill inspection apparatus can inspect the translucent pills22irrespective of the permeation rate of the translucent pills22.

In the above-described pill inspection apparatus, to irradiate light to the medical envelope20, the light emitting portion31, the parallel light converting portion32and the light-collecting portion33are combined with each other to form the illumination portion30. However, this is only one example, and the light-collecting portion33may be formed by using Fresnel lens as the transparent plate. It is possible to use a honeycomb board as the parallel light converting portion32other than the louvered film. It is possible to irradiate parallel light from the light emitting portion31at a position away from the medical envelope20more than 1 m without using the parallel light converting portion32.

If attempt is made to detect the translucent pill22by pattern matching from the transmission image, when there exist an opaque pill21and a translucent pill22having similar shape of their outer peripheries, the opaque pill21is detected as the translucent pill22in some cases. Hence, to precisely detect the translucent pill22, it is preferable that the image processing portion12detects, as the translucent pill22, a pill having a pixel having a high brightness value at a center of the detected pill in the transmission image.

If the pill inspection apparatus in this embodiment is used, a pixel having a high brightness value necessarily exits at the center of the translucent pill22. Hence, even if a shape of the opaque pill21and a shape of a sample image of the translucent pill22are the same, if a pixel having a high brightness value does not exist at the center of the pill, the pill inspection apparatus determines this pill as the opaque pill21, and if a pixel having a high brightness value exists at the center of the pill, the pill inspection apparatus may determine this pill as the translucent pill22.

According to this, it is possible to detect the opaque pill21and the translucent pill22distinctively.

INDUSTRIAL APPLICABILITY

The pill inspection apparatus and the pill inspection method of the present invention are useful in a pharmacy and a hospital where a preparation operation of a medicine must be carried out.

EXPLANATION OF SYMBOLS