The present invention relates to a technique of determining a state of a container in which a collection target such as a sample, a reagent, or a reaction solution is stored or a state of the collection target in an automatic analysis system including an immune analyzing apparatus or the like.
In an automatic analysis system including an immune analyzing apparatus or the like, in order to analyze components of a sample such as blood and urine, a state of color development or light emission generated from a reaction solution obtained by reacting the sample with a reagent is measured. The sample, the reagent, the reaction solution, and the like used for analysis are stored in a container such as a test tube, and are collected from the container by a collection unit such as a dispensing probe. The container containing the sample, the reagent, the reaction solution, and the like, which are collection targets of the collection unit, has a plurality of types of different inner diameters and lengths, and it is desirable that the type of the container is automatically determined in a situation in which a plurality of containers are mixed.
JP-A-2004-151025 (PTL 1) discloses that a type of a container is determined by comparing a figure obtained by imaging the container from two directions of an opening portion direction and a side surface direction with a standard figure stored in a memory.
However, in PTL 1, in order to determine the type of the container, a plurality of cameras that capture images of the container from the two directions, that is, the opening portion direction and the side surface direction, are required, which increases a hardware cost. In PTL 1, only the determination of the type of the container is performed, and the determination of the state of the container or the collection target, such as an inclination of the container or an amount of the collection target is not considered.
An object of the invention is to provide an image processing apparatus, an automatic analysis system, and an image processing method capable of determining a state of a container or a collection target based on an image acquired by a single camera.
In order to achieve the above object, the invention provides an image processing apparatus including: an image acquisition unit configured to acquire an upper image that is an image obtained by capturing an image of a container accommodating a collection target including a sample, a reagent, and a reaction solution from above; a region calculation unit configured to calculate an edge region of the container or an upper surface region of the collection target from the upper image; and a state determination unit configured to determine a state of the container or a state of the collection target based on the edge region or the upper surface region.
The invention further provides an automatic analysis system including the image processing apparatus, automatic analysis system including: a collection unit configured to collect the collection target from the container; and a control unit configured to control the collection unit based on a determination result of the state determination unit.
The invention further provides an image processing method including: an image acquiring step of acquiring an upper image that is an image obtained by capturing an image of a container accommodating a collection target including a sample, a reagent, and a reaction solution from above; a region calculating step of calculating an edge region of the container or an upper surface region of the collection target from the upper image; and a state determination step of determining a state of the container or a state of the collection target based on the edge region or the upper surface region.
The invention further provides an image processing method for dividing an image into a plurality of regions, the method including: creating a dilate kernel by inserting a predetermined number of zeros between elements of a kernel used in a convolution processing and a pooling processing; and executing the convolution processing and the pooling processing by using the dilate kernel.
According to the invention, an image processing apparatus, an automatic analysis system, and an image processing method capable of determining a state of a container or a collection target based on an image acquired by a single camera can be provided.
Preferred embodiments of an image processing apparatus, an automatic analysis system, and an image processing method according to the invention will be described below with reference to accompanying drawings. In the following description and the accompanying drawings, components having the same function and structure are denoted by the same reference numerals, and repeated description thereof will be omitted.
An example of a hardware configuration of an automatic analysis system 100 according to the present embodiment will be described with reference to
The imaging unit 111 is a device that images a container 112 and a collection target 113 stored in the container 112, and is, for example, a camera. The container 112 is a test tube or the like of a cylindrical shape or a tapered shape, and has a bottom surface at one end and an opening portion at the other end. The container 112 has a plurality of types of different inner diameters and lengths. The collection target 113 is a sample such as blood or urine, a reagent to be reacted with the sample, a reaction solution obtained by reacting the sample with the reagent, or the like, and is a liquid or powder. The imaging unit 111 is a single unit, is installed on an opening portion side of the container 112, that is, above the container 112, and images the container 112 and the collection target 113 from above the container 112. An image captured from above the container 112 by the imaging unit 111 is referred to as an upper image. A telecentric or non-telecentric lens is attached to the imaging unit 111.
The input unit 102 is an interface that receives data of an upper image from the imaging unit 111 or a recording device in which the upper image is recorded, and receives an operation signal generated by an operator operating a keyboard, a mouse, or the like. The upper image may be a still image such as BMP, PNG, or JPEG, or may be a frame image extracted from a moving image such as MPEG or H.264 at regular intervals.
The calculation unit 103 is a device that executes various processing in the image processing apparatus 101, and is, for example, a central processing unit (CPU) or a field-programmable gate array (FPGA). Functions executed by the calculation unit 103 will be described later with reference to
The memory 104 is a device that stores programs executed by the calculation unit 103, parameters, coefficients, processing results, and the like, and is a HDD, a RAM, a ROM, a flash memory, or the like.
The output unit 105 is an interface that transmits a result of the processing by the calculation unit 103 to the outside, and outputs the result of the processing to, for example, a display device such as a display or a printer, a recording device that records the result of the processing, or a control device that controls other devices.
The control unit 121 is a device that controls the operation of the collection unit 122 based on the result of the processing output from the output unit 105, and is specifically a central processing unit (CPU) or the like.
The collection unit 122 is a device that collects the collection target 113 from the container 112 by the control unit 121, and is, for example, a dispensing probe.
The analysis unit 123 is a device that performs analysis using the collection target 113, and is, for example, an immune analyzing apparatus. A result of the analysis by the analysis unit 123 is displayed on a display or the like.
An example of a functional block diagram of the present embodiment will be described with reference to
The image acquisition unit 201 acquires an upper image 212 captured by the imaging unit 111. The upper image 212 includes an edge 213 and an inner wall 214 of the container 112, an upper surface 215 of the collection target 113, a mixture 216, and a fixing unit 217. The mixture 216 is bubbles, lipids, or the like present inside or on the upper surface of the collection target 113. The fixing unit 217 is a holder or the like that fixes the container 112. For each part included in the upper image 212, reference is also made to a side view 211.
The region calculation unit 202 calculates a region of each portion, for example, a region of the edge 213 of the container 112 or a region of the upper surface 215 of the collection target 113, from the upper image 212 acquired by the image acquisition unit 201. In order to calculate the region, threshold processing using a luminance value of an image, region segmentation processing using fully convolutional networks (FCN), and the like are executed.
The state determination unit 203 determines states of the container 112 and the collection target 113, for example, a type of the container 112, an inclination of the container 112, and an amount of the collection target 113, based on one of the regions calculated by the region calculation unit 202.
An example of a processing flow of the present embodiment will be described with reference to
(S301)
The image acquisition unit 201 acquires the upper image 212 via the input unit 102. The acquired upper image 212 may be an image captured by the imaging unit 111 or an image recorded in a recording device or the like (not shown).
(S302)
The region calculation unit 202 calculates a region of the edge 213 of the container 112 from the upper image 212 acquired in S301. In order to calculate the region of the edge 213, one of the threshold processing using the luminance value of the upper image 212, region segmentation processing using FCN, or the like is executed. The region segmenting processing using FCN will be described later with reference to
An example of a region segmentation image 401 obtained by performing the region segmentation processing on the upper image 212 will be described with reference to
(S303)
The state determination unit 203 determines the type of the container 112 based on the edge region 402 calculated in S302. The step will be described with reference to
The state determination unit 203 creates a binarized image 501 of the edge based on the calculation result in S302. The edge binarized image 501 includes the edge region 402 and a region 503 other than the edge region 402. For example, a luminance value of 0 is given to the edge region 402, and a luminance value of 255 is given to the other region 503.
The state determination unit 203 extracts a boundary of the edge region 402 by applying a Sobel filter or the like to the binarized image 501 of the edge, and creates a boundary image 502 of the edge. Since the edge 213 of the container 112 has an annular shape, the boundary image 502 of the edge includes an inner boundary 505, which is a boundary on an inner wall side of the container 112, and an outer boundary 506, which is a boundary on an outer wall side of the container 112.
The state determination unit 203 performs elliptical fitting on the inner boundary 505 and the outer boundary 506, calculates long diameters of the inner boundary 505 and the outer boundary 506, sets the long diameter of the inner boundary 505 as an inner diameter of the container 112, and obtains a thickness of the container 112 from the long diameters of the inner boundary 505 and the outer boundary 506 using the following equation.
D=(Lo−Lc)/2 [Equation 1]
Here, D is the thickness of the container 112, Lo is the long diameter of the outer boundary 506, and Lc is the long diameter of the inner boundary 505.
A reason why the long diameter is used instead of a short diameter is to reduce the influence of an inclination of the container 112. That is, as the container 112 is inclined from an upright state, short diameters of the inner boundary 505 and the outer boundary 506 become shorter, while the long diameters are less likely to change. For the elliptical fitting, all points of the inner boundary 505 or the outer boundary 506 may be used, or at least three extraction points 508 arbitrarily extracted from the inner boundary 505 or the outer boundary 506 may be used. As the extraction point 508, for example, a point reaching the inner boundary 505 or the outer boundary 506 is extracted by scanning in upward, downward, left, and right directions from a center of gravity 507 obtained by arithmetically averaging coordinates of the edge region 402.
The state determination unit 203 determines the type of the container 112 by comparing the inner diameter and the thickness of the container 112 obtained from the long diameters of the inner boundary 505 and the outer boundary 506 with a table shown in
The table shown in
(S304)
The output unit 105 outputs the type of the container 112 determined in S303. The result of the determination is transmitted to, for example, the control unit 121, and the control unit 121 controls the collection unit 122 based on the result of the determination. For example, when it is determined that the container 112 is an unknown container, the control unit 121 may stop the collection unit 122. When the container 112 is an unknown container, collision between the collection unit 122 and the container 112 can be avoided by stopping the collection unit 122.
The control unit 121 may adjust the height of the collection unit 122 according to the type of the container 112. For example, the height of the collection unit 122 may be adjusted based on the length of the container 112 acquired by comparing the type of the container 112, which is the determination result, with a table shown in
The output unit 105 may output the determination result to a display or a printer to present the type of the container 112 to the operator, or may display a message prompting the operator to change the container 112 when the container 112 is an unknown container. Further, the output unit 105 may output the type of the container 112 to another image processing apparatus, and may output an image on which a correction processing according to the type of the container 112 is performed together with the type of the container 112. The correction processing according to the type of the container 112 is, for example, processing of normalizing the image size according to the inner diameter of the container 112 or processing of correcting the contrast according to the type of the container 112.
According to the processing flow described above, the image processing apparatus 101 can determine the type of the container 112, which is one of the states of the container 112, based on the upper image 212 acquired by the single imaging unit 111. The automatic analysis system 100 can appropriately control the collection unit 122 according to the determination result by the image processing apparatus 101, and thus can perform more accurate analysis without reducing an inspection efficiency.
Here, the region segmentation processing using FCN will be described. The FCN is one of deep neural network (DNN), and is a region segmentation processing of segmenting an image into regions by constructing all layers with convolutional neural network (CNN). The CNN includes three pieces of processing, that is, a convolution processing, a pooling processing, and an activation processing. The convolution processing is processing of creating a map of a feature amount from input data, the pooling processing is processing of extracting a representative value from the input data, and the activation processing is processing of applying a nonlinear function to the input data.
With reference to
Equation 2 shows an example of a calculation equation of the convolution processing.
Here, the input data Ic is data having three dimensions of a channel ch, a vertical direction position y, and a horizontal direction position x, and the output data Oc is data having three dimensions of a feature amount number d, a vertical direction position y, and a horizontal direction position x. The multiplication coefficient Wc is a coefficient having four dimensions of the feature amount number d, the channel ch, a vertical direction position fy, and a horizontal direction position fx, and is also referred to as a kernel, and an addition coefficient Bc is a coefficient having a dimension of the feature amount number d. The size of the kernel is represented by a kernel height Fy and a kernel width Fx, and an amount by which the kernel slides per time is represented by a vertical direction stride amount Sy and a horizontal direction stride amount Sx.
The multiplication coefficient Wc and the addition coefficient Bc are obtained in advance by machine learning using a stochastic gradient descent method or the like using a teacher image, which is an image obtained by correctly segmenting each region, as input data, and are stored in the memory 104 as coefficients of the region segmentation processing. That is, machine learning is performed using a teacher signal correctly indicating which of the edge region 402, the inner wall region 403, the upper surface region 404, and the background region 405 each pixel of the plurality of upper images 212 belongs to.
With reference to
Equation 3 shows an example of a calculation equation of the pooling processing.
Op(ch,y,x)=max(Ip(ch,y*Sy+fy,x*Sx+fx) where fy∈[0,Fy],fx∈[0,Fx] [Equation 3]
Here, the input data Ip and the output data Op are data having three dimensions of a channel ch, a vertical direction position y, and a horizontal direction position x. Also in the pooling processing, similar to the convolving processing, the acquired luminance values of the plurality of pixels are multiplied by a coefficient called a kernel, and the size of the kernel is represented by Fy and Fx, and stride amounts of the kernel is represented by Sy and Sx. In the pooling processing, Sy=Fy and Sx=Fx are often set, and all elements of the kernel are 1. The kernel used for the pooling processing is referred to as a P kernel, and the kernel used for the convolution processing is referred to as a C kernel.
The activation processing is processing of applying nonlinear functions of Equation 4 and Equation 5 to the output data Oc of the convolution processing and the output data Op of the pooling processing, and identifying whether a certain pixel is the edge region 402, for example.
ReLU(α)=max(O,α) [Equation 5]
The CNN obtains a feature amount and an identification result by combining the above-described convolution processing, pooling processing, and activation processing. The FCN is a region segmentator including only CNN, and to which an image of an arbitrary size can be input.
A first layer output data 904 is a result of applying the convolution processing to the input image 901, and a second layer output data 905 is a result of applying the pooling processing to the first layer output data 904. A third layer output data 906 is a result of applying the convolution processing to the second layer output data 905, and a fourth layer output data 907 is a result of applying the pooling processing to the third layer output data 906. Further, a region segmentation result 908 indicates which position in the input image the fourth layer output data 907 corresponds to. Kernel sizes Fy and Fx and the stride amounts Sy and Sx of the convolution processing and the pooling processing are as shown in
As shown in
The high-resolution region segmentation processing will be described with reference to
Therefore, in the present embodiment, the kernel used for the convolution processing and the pooling processing of the FCN is changed by the dilate processing, and the high-resolution region segmentation result is acquired by one region segmentation processing. Dilate processing is processing of inserting a predetermined number of zeros between elements of a kernel and expanding the kernel, and the kernel after the dilate processing is referred to as a dilate kernel or a D kernel. The convolution processing and the pooling processing using the D kernel are referred to as “dilated convolution processing” and “dilated pooling processing”.
With reference to
Equation 6 shows an example of a calculation equation of the dilated convolution processing.
In Equation 6, if Dy and Dx=1 and 1, Equation 2 is obtained.
With reference to
Equation 7 shows an example of a calculation equation of the dilated pooling processing.
Op(ch,y,x)=max(Ic(ch,y*Sy+fy*Dy,x*Sx+fx*Dx) where fy∈[0,Fy],fx∈[0,Fx] [Equation 7]
In Equation 7, if Dy and Dx=1 and 1, Equation 3 is obtained.
The Dilated convolution processing and the dilated pooling processing will be described with reference to
The convolution processing or the pooling processing corresponds to the dilated convolution processing or the dilated pooling processing when both the dilate amounts Dy and Dx are set to 1. The dilate amounts Dy and Dx of the first D kernel 1303 and the second D kernel 1304 are both 2.
A processing range of each kernel may include a region outside the input data. For example, in the case of the second kernel 1302, a first row corresponds to a region outside the input data. In the present embodiment, the luminance value of 0 is embedded in the region outside the input data. The FCN using the dilated convolution processing and the dilated pooling processing is referred to as a dilated FCN (DFCN).
An example of a processing flow of converting a FCN model into a DFCN model will be described with reference to
In S1401, a variable L is initialized. The variable L represents an index of a layer to be processed.
In S1402, the type of the layer is determined. If the type of the layer is a convolution layer or a pooling layer, the processing proceeds to S1403, and if the type of the layer is an activation layer, the processing proceeds to S1406.
In S1403, the type of the layer is converted. If the L-th layer is a convolution layer, the L-th layer is converted into a dilated convolution layer, and if the L-th layer is a pooling layer, the L-th layer is converted into a dilated Pooing layer. Parameters such as the size of the kernel, the number of types of kernels, the coefficients of the kernels, and the pooling size of the dilated convolution layer and the dilated pooling layer after the conversion are the same as setting values of the convolution layer and the pooling layer before the conversion.
In S1404, the dilate amount of the L-th layer is determined. An example of a procedure for determining the dilate amounts Dy in the vertical direction will be described. The dilate amount Dx in the horizontal direction is also determined in a similar manner by replacing the subscript from y to x. First, a product Psy of stride amounts Sy in the vertical direction from a 0th layer to a (L−1)th layer of the input FCN model is calculated. Next, a greatest common divisor GCy of the product Psy of the stride amount Sy and a pitch Ky in the vertical direction of the region division result are obtained. The product Psy of the stride amounts Sy and the greatest common divisor GCy are substituted into the following equation, and the dilate amount Dy in the vertical direction of the L-th layer is determined.
Dy=PSy/GCy [Equation 8]
Further, the pitch Ky is updated by the following equation.
Ky=Ky/GCy [Equation 9]
In S1405, the stride amount of the L-th layer is determined. An example of a determination procedure of the stride amount Sy in the vertical direction will be described. The stride amount Sx in the horizontal direction is also determined in a similar manner by replacing the subscript from y to x. Then, the greatest common divisor GCy calculated in 1404 is substituted into the following equation, and the stride amount Sy of the L-th layer in the vertical direction is determined.
Sy=GCy [Equation 10]
In S1406, the variable L is incremented. That is, the processing target is switched to the next layer.
In S1407, it is determined whether the conversion processing for all layers is completed. For example, if the variable L is equal to or greater than the number of layers constructing the FCN model, it is determined that the processing is completed, otherwise, it is determined that the processing is not completed. If the processing is completed, the processing flow ends, and if the processing is not completed, the processing proceeds to S1402.
With the above processing flow, the FCN model can be converted into a DFCN model capable of obtaining a high-resolution region division result at high speed.
A first layer output data 1504 is a result of applying the dilated convolution processing to the input image 1501, and a second layer output data 1505 is a result of applying the dilated pooling processing to the first layer output data 1504. A third layer output data 1506 is a result of applying the dilated convolution processing to the second layer output data 1505, and a fourth layer output data 1507 is a result of applying the dilated pooling processing to the third layer output data 1506. Since the resolution is not reduced by the processing of each layer, the fourth layer output data 1507 becomes a region segmentation result having the same resolution as that of the input image 1501.
In order to obtain a high-resolution region segmentation result by the FCN, it is necessary to perform the region segmentation processing for each image of different acquisition positions as shown in
Although the FCN model is converted into the DFCN model in
The first embodiment describes that the type of the container 112 is determined based on the edge region 402 of the container 112 calculated from the upper image 212. A determination result output by the image processing apparatus 101 is not limited to the type of the container 112. The present embodiment describes that an amount of the collection target 113 is determined based on the edge region 402 of the container 112 and the upper surface region 404 of the collection target 113 calculated from the upper image 212. A hardware configuration and a functional block diagram of the present embodiment are the same as those of the first embodiment, and thus the description thereof will be omitted.
An example of a processing flow of the present embodiment will be described with reference to
(S1604)
The region calculation unit 202 calculates the upper surface region 404 of the collection target 113 from the upper image 212 acquired in S301. In the calculation of the upper surface region 404, similar to S302, threshold processing using the luminance value of the upper image 212, region segmentation processing using FCN or DFCN, or the like is executed.
(S1605)
The state determination unit 203 determines the amount of the collection target 113 based on the edge region 402 calculated in S302 and the upper surface region 404 calculated in S1604. The step will be described with reference to
The state determination unit 203 creates a binarized image 1701 of the upper surface of the collection target 113 based on the calculation result in S1604. The upper surface binarized image 1701 includes the upper surface region 404 and another region 1704 other than the upper surface region 404. For example, a luminance value of 0 is given to the upper surface region 404, and a luminance value of 255 is given to the other region 1704.
The state determination unit 203 extracts a boundary of the upper surface region 404 by applying a Sobel filter or the like to the binarized image 1701 of the upper surface, and creates a boundary image 1702 of the upper surface. The upper surface boundary image 1702 includes an upper surface boundary 1705. The state determination unit 203 performs elliptical fitting on at least three extraction points 1706 arbitrarily extracted from the upper surface boundary 1705, and calculates a long diameter and a short diameter of the upper surface region 404. Since the short diameter of the upper surface region 404 is less likely to change than the long diameter even when the container 112 is inclined, the short diameter is used in the subsequent processing.
The determination of the amount of the collection target 113 will be described with reference to
A case of a non-telecentric lens will be described with reference to
Specifically, first, the short diameter of the upper surface region 404 is collated with a table shown in
Equation 11 is an expression in a case where the inner diameter D of the container 112 is constant regardless of the distance H. When the container 112 has a tapered shape or the like and the inner diameter D of the container 112 changes depending on the distance H, a relationship between the distance H and the inner diameter D is stored in advance in the memory 104 or the like, and is referred to as necessary, whereby the amount Q of the collection target 113 is obtained using Equation 11.
A case of a telecentric lens will be described with reference to
Therefore, in the case of the telecentric lens, the amount of the collection target 113 is determined based on the upper image captured by inclining the imaging unit 111 as shown in
When the container 112 has a tapered shape or the like, similar to the case of the non-telecentric lens, a relationship between the distance H and the inner diameter D stored in advance in the memory 104 or the like is referred to as necessary, and the amount Q of the collection target 113 is obtained using Equation 11.
(S1606)
The output unit 105 outputs the amount of the collection target 113 determined in S1605. The result of the determination is transmitted to, for example, the control unit 121, and the control unit 121 controls the collection unit 122 based on the result of the determination. For example, when it is determined that the amount of the collection target 113 does not reach a predetermined amount, the control unit 121 may stop the collection unit 122. The output unit 105 may output the result of the determination to a display or a printer to present the amount of the collection target 113 to the operator, or may display a message indicating that the amount of the collection target 113 does not reached a predetermined amount when the amount of the collection target 113 does not reached the predetermined amount.
According to the processing flow described above, the image processing apparatus 101 can determine the amount of the collection target 113, which is one of the states of the collection target 113, based on the upper image 212 acquired by the single imaging unit 111. The automatic analysis system 100 can appropriately control the collection unit 122 according to the determination result by the image processing apparatus 101, and thus can perform more accurate analysis without reducing an inspection efficiency.
In the first embodiment, the determination of the type of the container 112 has been described, and in the second embodiment, the determination of the amount of the collection target 113 has been described. The present embodiment describes that an inclination of the container 112 is determined based on the edge region 402 of the container 112 and the upper surface region 404 of the collection target 113 calculated from the upper image 212. A hardware configuration and a functional block diagram of the present embodiment are the same as those of the first embodiment, and thus the description thereof will be omitted.
An example of a processing flow of the present embodiment will be described with reference to
(S2005)
The state determination unit 203 determines the inclination of the container 112 based on the edge region 402 calculated in S302 and the upper surface region 404 calculated in S1604. In the determination of the inclination of the container 112, the presence or absence of the inclination or the inclination angle is determined.
The determination of the presence or absence of the inclination of the container 112 will be described with reference to
The case of the non-telecentric lens will be described with reference to
As can be seen from the comparison between the upright upper image 2102 and the inclined upper image 2106, the center 2103 of the edge region 402 and the center 2104 of the upper surface region 404 coincide with each other in an upright state, whereas the center 2103 and the center 2104 do not coincide with each other in an inclined state, and a distance between the center 2103 and the center 2104 increases as the inclination increases. Therefore, the state determination unit 203 determines the presence or absence of the inclination of the container 112 based on the distance between the center 2103 of the edge region 402 and the center 2104 of the upper surface region 404. That is, when the distance between the center 2103 of the edge region 402 and the center 2104 of the upper surface region 404 is equal to or greater than a predetermined threshold value, it is determined that the container 112 is inclined, and when the distance is less than the threshold value, it is determined that the container 112 is not inclined.
The case of the telecentric lens will be described with reference to
In addition to the distance between the center 2103 of the edge region 402 and the center 2104 of the upper surface region 404, the presence or absence of the inclination of the container 112 may be determined based on the inner wall region 403 or the like of the container 112. For example, since the shape of the inner wall region 403 changes when the container 112 is inclined compared with when the container 112 is upright, the presence or absence of inclination of the container 112 may be determined using a width or area of the inner wall region 403. Not only the inner wall region 403 but also an outer wall region of the container 112 may be used to determine the presence or absence of the inclination of the container 112.
The determination of an angle of the inclination of the container 112 will be described with reference to
The case of the non-telecentric lens will be described with reference to
Here, Sh is the center-to-center horizontal distance 2205, and H is the center-to-center vertical distance 2206.
However, since the image captured by the imaging unit 111 is the upper image 2202 at the time of inclination, it is necessary to acquire the center-to-center horizontal distance 2205 and the center-to-center vertical distance 2206 from the upper image 2202 at the time of inclination in order to obtain the inclination angle θ of the container 112 using Equation 13. First, the center-to-center vertical distance 2206, that is, the distance H from the edge 213 of the container 112 to the upper surface 215 of the collection target 113 is obtained by comparing the short diameter of the upper surface region 404 with the table shown in
Next, the center-to-center horizontal distance 2205 is obtained from the upper image 2202 at the time of inclination. In the case of the non-telecentric lens, since the size of the imaged object decreases as a distance from the imaging unit 111 to the imaged object increases, it is preferable that a length of the collection target 113 on the upper surface 215 is corrected to the length of the edge 213 of the container 112 and handled. Specifically, it is preferable that a region center-to-center distance 2209, which is the distance between a center 2207 of the edge region 402 and a center 2208 of the upper surface region 404 in the upper image 2202 at the time of inclination, is corrected based on a ratio between the short diameter of the upper surface region 404 and the inner diameter of the edge region 402. For example, Sh, which is the center-to-center horizontal distance 2205, is calculated by the following equation.
Here, F1 is a first center-to-center distance 2212 that is a distance from a lens center 2210 to the center 2208 of the upper surface region 404, and F0 is a second center-to-center distance 2211 that is a distance from the lens center 2210 to the center 2207 of the edge region 402. B0 is an inner diameter 2213 of the edge region 402, and B1 is a short diameter 2214 of the upper surface region 404. According to Equation 14, after the second center-to-center distance 2211, which is the length of the collection target 113 on the upper surface 215, is corrected to the length of the container 112 on the edge 213, a difference between the second center-to-center distance 2211 and the first center-to-center distance 2212 is calculated, and an absolute value thereof is calculated as Sh, which is the center-to-center horizontal distance 2205. That is, the size of the imaged object, which changes according to the distance from the imaging unit 111 to the imaged object, is corrected, and Sh, which is the center-to-center horizontal distance 2205, is calculated.
By substituting the calculated Sh and the previously obtained distance H into Expression 13, the inclination angle θ of the container 112 is obtained.
The case of the telecentric lens will be described with reference to
The inclination angle θ of the container 112 may be an inclination angle of the imaging unit 111 when the imaging unit 111 is inclined as shown in
(S2006)
The output unit 105 outputs the inclination of the container 112 determined in S2005. The result of the determination is transmitted to, for example, the control unit 121, and the control unit 121 controls the collection unit 122 based on the result of the determination. For example, when it is determined that the container 112 is inclined or the inclination angle of the container 112 exceeds a predetermined threshold value, the control unit 121 may stop the collection unit 122. Alternatively, the position and inclination of the collection unit 122 may be adjusted according to the inclination angle of the container 112.
The output unit 105 may output the determination result to a display or a printer and present to the operator whether the container 112 is inclined and the inclination angle, and a message or the like calling attention may be displayed when a ratio of the number of inclined containers 112 exceeds a predetermined threshold value. Further, the output unit 105 may output the inclination angle of the container 112 to another image processing apparatus, and may output an image on which a correction processing according to the type of the container 112 is performed together with the inclination angle of the container 112. The correction processing according to the inclination angle of the container 112 is, for example, processing of correcting deformation of the image due to the inclination of the container 112 by converting coordinates of the image according to the inclination angle of the container 112.
According to the processing flow described above, the image processing apparatus 101 can determine the inclination of the container 112, which is one of the states of the container 112, based on the upper image 212 acquired by the single imaging unit 111. The automatic analysis system 100 can appropriately control the collection unit 122 according to the determination result by the image processing apparatus 101, and thus can perform more accurate analysis without reducing an inspection efficiency.
The first to third embodiment describes that the states of the container 112 and the collection target are determined based on the edge region 402 of the container 112 and the upper surface region 404 of the collection target 113 calculated from the upper image 212. In order for the image processing apparatus 101 to accurately perform region segmentation processing on the upper image 212 using FCN, DFCN, or the like, an appropriate teacher signal used for machine learning is required. In the embodiment, it will be described that a teacher signal for machine learning is efficiently created. A hardware configuration of the present embodiment is the same as that of the first embodiment, and thus the description thereof will be omitted.
An example of a functional block diagram of the present embodiment will be described with reference to
The likelihood acquisition unit 2301 acquires the likelihood that whether each pixel in each region calculated by the region calculation unit 202 is, for example, the edge region 402, the inner wall region 403, the upper surface region 404, or the like. The likelihood is normalized such that a sum is 1.0 for each pixel, and a maximum likelihood in each pixel is called the maximum likelihood. A pixel with a large maximum likelihood has a high degree of certainty in a corresponding region, and a pixel with a small maximum likelihood has a low certainty degree.
The image selection/display unit 2302 selects an image to be used for applying the teacher signal based on, for example, the maximum likelihood of each pixel in the image, and displays the selected image on a display or the like.
The teacher signal acquisition unit 2303 acquires a teacher signal from a teacher image that is an image including the teacher signal. The teacher signal is assigned by the operation of the operator or the region segmentation processing by another image processing apparatus.
The learning unit 2304 performs machine learning using the teacher signal included in the teacher image, and the region calculation unit 202 calculates or updates parameters such as coefficients used in the region segmentation processing.
An example of a processing flow of the present embodiment will be described with reference to
(S2401)
The image selection/display unit 2302 selects an image for assigning a teacher signal from a group of images recorded on a recording device or the like based on the likelihood of each pixel in the image, and displays the image on a display or the like. For example, an image in which the average value of the maximum likelihood of each pixel is less than a predetermined threshold value, that is, an image in which the certainty degree of each region is relatively low is selected.
An example of the screen displayed in this step will be described with reference to
The operator can check the number of images to which the teacher signal is assigned and the number of images to which no teacher signal is assigned from the screen for each type of the container 112, and can determine an image including a predetermined type of container 112 to which the teacher signal should be assigned, thereby improving the efficiency of the operation of assigning the teacher signal. The displayed list of images is not limited to a list classified for each type of the container 112.
(S2402)
The teacher signal acquisition unit 2303 acquires the teacher signal for the image displayed in S2401 based on the operation of the operator. An example of the screen used in this step will be described with reference to
The screen shown in
The image display portion 2601 displays an image corresponding to the selection by the image selection portion 2602. The image selection portion 2602 selects a condition of an image displayed on the image display portion 2601. In
In the correction tool 2603, a region in which the teacher signal is desired to be corrected is selected. For example, when an arbitrary pixel of the image displayed in the image display portion 2601 is selected in a state where the liquid surface, that is, the upper surface when the collection target 113 is liquid is selected by the correction tool 2603, a teacher signal of the upper surface region 404 is assigned to the selected pixel. The selection of pixel in the image displayed in the image display portion 2601 is performed by a mouse or the like.
The save button 2604 is a button to be pressed when a corrected teacher signal is saved. That is, when the save button 2604 is pressed, the teacher signal acquisition unit 2303 acquires the assigned teacher signal via the correction tool 2603. The original teacher signal is acquired for the pixel that has not been corrected by the correction tool 2603.
The read button 2605 is a button to be pressed when another image is selected. When the read button 2605 is pressed, for example, the image displayed in the image display portion 2601 may be updated, or the screen shown in
The screen shown in
The upper image 212, which is an image captured by the imaging unit 111, is displayed in the upper image display portion 2701.
In the container type display portion 2702, the type of the container 112 determined based on the region calculated by the region calculation unit 202 is displayed together with the inner diameter and the thickness. A length of the container 112, a printing content, a printing position, the presence or absence of a screw around the edge, a rib on the bottom surface, and the like may be displayed. Various kinds of information displayed in the container type display portion 2702 may be modified by the operator.
In the teacher signal input portion 2703, the teacher signal assigned to an arbitrary region of the image displayed on the upper image display portion 2701 is input. For example, a teacher signal corresponding to the upper surface region 404 is input to bubbles, lipids, or the like in the image displayed in the upper image display portion 2701. The teacher signal input portion 2703 is not limited to a text box shown in
The screens as shown in
(S2403)
It is determined whether a predetermined number or more of new teacher images are collected. If the predetermined number or more of teacher images are collected, the processing proceeds to S2404, and if the predetermined number or more of teacher images are not collected, the processing returns to S2401.
(S2404)
The learning unit 2304 updates the coefficient by machine learning using the predetermined number or more of teacher images. For the update of the coefficient, for example, a stochastic gradient descent method is used. As an initial value of the coefficient, the coefficient stored in the memory 104 may be used, or a random number may be used.
(S2405)
The learning unit 2304 evaluates the updated coefficient. For example, an image group with correct answer information is prepared in advance for evaluation of the coefficient, and a region segmentation processing using the coefficient updated in S2404 and the coefficient before update is performed on the image group, and the coefficient after update is evaluated based on whether a correct answer rate increases.
(S2406)
It is determined whether a coefficient in the memory 104 is overwritten. An evaluation result in S2405 may be used to determine whether the information is overwritten. If the coefficient is overwritten, the processing proceeds to S2407, and if the coefficient is not overwritten, the processing flow ends.
(S2407)
The learning unit 2304 overwrites the coefficient in the memory 104 and stores the coefficients before and after the update.
According to the processing flow described above, an appropriate teacher signal is efficiently assigned to an image having a relatively low certainty degree of a region segmentation result, and the image processing apparatus 101 can efficiently perform appropriate machine learning since an appropriate teacher signal is efficiently assigned. An appropriate teacher signal to air bubbles, foreign matter, and the like can be applied. Since the accuracy of the region segmentation processing can be improved by appropriate machine learning, the image processing apparatus 101 can more accurately determine the state of the container 112 or the collection target 113, and the automatic analysis system 100 can perform analysis more accurately.
A plurality of embodiments of the invention have been described above. The invention is not limited to these embodiments, and includes various modifications. For example, the embodiments described above are described in detail for easy understanding of the invention, and the invention is not limited to those including all the configurations described above. A part of the configuration of one embodiment can be replaced with the configuration of another embodiment. Further, a configuration of another embodiment can be added to the configuration of one embodiment. A part of the configuration of one embodiment may be added, deleted, or replaced with another configuration.
Number | Date | Country | Kind |
---|---|---|---|
2019-073334 | Apr 2019 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2020/002860 | 1/28/2020 | WO | 00 |