JP5449444B2 - Colony counting device, colony counting method, and program - Google Patents

Colony counting device, colony counting method, and program Download PDF

Info

Publication number
JP5449444B2
JP5449444B2 JP2012097782A JP2012097782A JP5449444B2 JP 5449444 B2 JP5449444 B2 JP 5449444B2 JP 2012097782 A JP2012097782 A JP 2012097782A JP 2012097782 A JP2012097782 A JP 2012097782A JP 5449444 B2 JP5449444 B2 JP 5449444B2
Authority
JP
Japan
Prior art keywords
connected component
image
colony
value
threshold
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.)
Expired - Fee Related
Application number
JP2012097782A
Other languages
Japanese (ja)
Other versions
JP2013223463A (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.)
Elmex Ltd
Original Assignee
Elmex 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 Elmex Ltd filed Critical Elmex Ltd
Priority to JP2012097782A priority Critical patent/JP5449444B2/en
Publication of JP2013223463A publication Critical patent/JP2013223463A/en
Application granted granted Critical
Publication of JP5449444B2 publication Critical patent/JP5449444B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、コロニー計数装置、コロニー計数方法、及び、プログラムに関する。   The present invention relates to a colony counting device, a colony counting method, and a program.

現在、食品衛生に関する意識がますます高くなっている。このため、国内外の食品について、厳格な食品衛生検査が実施されている。食品衛生検査では、例えば、食品から採取された検体を培地で培養した後に、検体に発生した大腸菌群などの微生物のコロニーの個数をカウントし、発生したコロニーの個数が所定値未満であるか否かを検査する。   At present, awareness of food hygiene is increasing. For this reason, strict food hygiene inspections are carried out on domestic and foreign foods. In food hygiene inspection, for example, after culturing a sample collected from food in a medium, the number of colonies of microorganisms such as coliforms generated in the sample is counted, and whether the number of generated colonies is less than a predetermined value. Inspect.

現在、コロニーの個数を自動でカウントすることができるコロニー計数装置が開発されている。例えば、特許文献1には、コロニーが発生した培地を撮像して得られた画像データに基づいてコロニーに対応する連結領域を求め、連結領域に外接する長方形の長辺と短辺との比率などを考慮してコロニーの個数をカウントするコロニー計数装置などが開示されている。   Currently, a colony counting device capable of automatically counting the number of colonies has been developed. For example, in Patent Document 1, a connection region corresponding to a colony is obtained based on image data obtained by imaging a culture medium in which a colony is generated, and a ratio between a long side and a short side of a rectangle circumscribing the connection region, etc. A colony counting device that counts the number of colonies in consideration of the above is disclosed.

このようなコロニー計数装置は、培地を撮像して得られた画像を、コロニーを表す画素の輝度値よりも高い閾値で二値化し、二値化された画像に対してラベリング処理を施すことにより、コロニーに対応する連結成分の個数をカウントする。二値化の際に使用する閾値は、コロニーの色の濃さなどに応じて設定することができる。   Such a colony counting apparatus binarizes an image obtained by imaging a culture medium with a threshold value higher than the luminance value of a pixel representing the colony, and performs a labeling process on the binarized image. Count the number of connected components corresponding to the colony. The threshold used for binarization can be set according to the color density of the colony.

特許第2791303号公報Japanese Patent No. 2791303

しかしながら、培地に発生するコロニーの色の濃さは均一ではなく、培地には様々な色の濃さを有するコロニーが同時に存在する。特に、大腸菌群は、多くの種類の菌が存在し、その菌によって代謝活性は様々である。例えば、大腸菌群は酵素基質X−GAL(5−Bromo−4−Chloro−3−indolyl−β−D−galactopyranoside)を分解し、青色色素5,5’−dibromo−4,4’−dichloro−indigoを産出するが、その濃度は菌種により異なる。特に、フィルムないしシート状培地においては、その濃度差が顕著なため、コロニーの個数は大変計測し難くなっている。黄色ブドウ球菌においても、X−Phosphateの分解により、同様の色素産生を確認している。   However, the color density of the colonies generated in the medium is not uniform, and colonies having various color densities exist simultaneously in the medium. In particular, the coliform group has many types of bacteria, and the metabolic activity varies depending on the bacteria. For example, Escherichia coli group degrades the enzyme substrate X-GAL (5-Bromo-4-Chloro-3-indolyl-β-D-galactopyranoside), and the blue pigment 5,5′-dibromo-4,4′-dichloro-indigo. The concentration varies depending on the bacterial species. In particular, in the case of a film or sheet-like medium, the concentration difference is remarkable, and therefore the number of colonies is very difficult to measure. In S. aureus, similar pigment production has been confirmed by the degradation of X-phosphate.

ここで、例えば、近距離に存在する複数個の濃い色のコロニーの間の領域は、薄い色のコロニーよりも濃い色を有することがある。このような場合、例えば、薄い色のコロニーを検出しようとして閾値を高くすると、近距離に存在する複数個の濃い色のコロニーが1つのコロニーとして検出され、コロニーの数を正確にカウントすることができない。そこで、様々な色の濃さを有するコロニーの個数を正確にカウントすることが可能なコロニー計数装置が望まれている。   Here, for example, a region between a plurality of dark-colored colonies existing at a short distance may have a darker color than a light-colored colony. In such a case, for example, if the threshold value is increased in order to detect light-colored colonies, a plurality of dark-colored colonies existing at a short distance are detected as one colony, and the number of colonies can be accurately counted. Can not. Therefore, a colony counting device capable of accurately counting the number of colonies having various color densities is desired.

本発明は、このような状況に鑑みてなされたものであり、様々な色の濃さを有するコロニーの個数を正確にカウントすることが可能なコロニー計数装置、コロニー計数方法、及び、プログラムを提供することを目的とする。   The present invention has been made in view of such circumstances, and provides a colony counting device, a colony counting method, and a program capable of accurately counting the number of colonies having various color densities. The purpose is to do.

上記目的を達成するために、本発明の第1の観点に係るコロニー計数装置は、
検体に含まれる微生物の培養後の培地の様子を示すグレースケール画像を取得するグレースケール画像取得手段と、
閾値が供給される毎に、前記グレースケール画像取得手段により取得されたグレースケール画像を前記閾値により二値化することにより二値化画像を生成する二値化画像生成手段と、
前記二値化画像生成手段により前記二値化画像が生成される毎に、前記二値化画像にラベリング処理を実行することにより前記二値化画像から1つのコロニーを示す画素のまとまりである連結成分を抽出する連結成分抽出手段と、
前記連結成分抽出手段により前記連結成分が抽出される毎に、前記連結成分のうち記憶装置に記憶済みの連結成分情報により示される連結成分を包含しない連結成分を示す連結成分情報を、前記記憶装置にさらに記憶させる連結成分情報追加手段と、
前記閾値が下限値から上限値に至るまでの間、前記連結成分情報追加手段の処理が完了する毎に、前記閾値を所定値ずつ増加させて前記二値化画像生成手段に供給する閾値供給手段と、
前記記憶装置に記憶されている連結成分情報に基づいて、前記微生物のコロニーの個数を計数するコロニー計数手段と、を備える、
ことを特徴とする。
In order to achieve the above object, the colony counting device according to the first aspect of the present invention comprises:
A grayscale image acquisition means for acquiring a grayscale image showing the state of the culture medium after culturing the microorganisms contained in the specimen;
Binarized image generating means for generating a binarized image by binarizing the grayscale image acquired by the grayscale image acquiring means by the threshold value every time a threshold is supplied;
Each time the binarized image is generated by the binarized image generating means, a labeling process is performed on the binarized image, thereby connecting a group of pixels indicating one colony from the binarized image. Connected component extraction means for extracting the components;
Each time the connected component is extracted by the connected component extraction means, the storage device stores connected component information indicating a connected component that does not include the connected component indicated by the connected component information stored in the storage device. Connected component information adding means for further storing
Threshold supply means for increasing the threshold value by a predetermined value and supplying it to the binarized image generating means each time processing of the connected component information adding means is completed until the threshold value reaches the upper limit value. When,
Colony counting means for counting the number of colonies of the microorganism based on the connected component information stored in the storage device,
It is characterized by that.

前記グレースケール画像を構成する画素の輝度値の分布に基づいて、前記下限値と前記上限値とを決定する閾値範囲決定手段、をさらに備えてもよい。   You may further provide the threshold range determination means which determines the said lower limit and the said upper limit based on distribution of the luminance value of the pixel which comprises the said gray scale image.

前記閾値範囲決定手段は、前記グレースケール画像を構成する画素の輝度値毎の度数を表す輝度ヒストグラムに含まれる最大の山状の度数分布の輝度範囲の中で度数が最多である輝度値を特定し、特定した輝度値よりも低く、かつ、前記特定した輝度値の度数に対して所定の割合以下の度数である輝度値のうち、最高の輝度値を前記上限値に決定してもよい。   The threshold range determination means identifies a luminance value having the highest frequency in the luminance range of the maximum mountain-shaped frequency distribution included in the luminance histogram representing the frequency for each luminance value of the pixels constituting the grayscale image. The highest luminance value may be determined as the upper limit value among the luminance values that are lower than the specified luminance value and have a frequency equal to or less than a predetermined ratio with respect to the frequency of the specified luminance value.

前記閾値範囲決定手段は、前記グレースケール画像を構成する画素の輝度値の最小の輝度値を特定し、特定した輝度値を前記下限値に決定してもよい。   The threshold range determining unit may specify a minimum luminance value of luminance values of pixels constituting the gray scale image, and determine the specified luminance value as the lower limit value.

前記培地を撮像して得られたカラー画像を取得するカラー画像取得手段と、
前記カラー画像取得手段により取得されたカラー画像を構成する画素の色相の分布に基づいて、前記コロニーの色相範囲を特定する色相範囲特定手段と、
前記カラー画像取得手段により取得されたカラー画像をグレースケール化した画像を構成する画素のうち、前記色相範囲特定手段により特定された前記色相範囲に含まれない画素の輝度値を、前記上限値よりも高い輝度値に設定することにより取得されるグレースケール画像を、前記グレースケール画像取得手段に取得させるグレースケール画像として生成するグレースケール画像生成手段と、をさらに備えてもよい。
Color image acquisition means for acquiring a color image obtained by imaging the culture medium;
A hue range specifying means for specifying a hue range of the colony based on a hue distribution of pixels constituting the color image acquired by the color image acquiring means;
Among the pixels constituting the image obtained by converting the color image acquired by the color image acquisition unit into a gray scale, the luminance value of the pixel not included in the hue range specified by the hue range specifying unit is determined from the upper limit value. And a gray scale image generating unit that generates a gray scale image acquired by setting a higher luminance value as a gray scale image to be acquired by the gray scale image acquiring unit.

前記色相範囲特定手段は、前記カラー画像を構成する画素の色相毎の度数を表す色相ヒストグラムから最大の山状の度数分布の色相範囲を除外したのちに存在する山状の度数分布の色相範囲を前記コロニーの色相範囲として特定してもよい。   The hue range specifying means obtains a hue range of a mountain-shaped frequency distribution that exists after excluding the hue range of the maximum mountain-shaped frequency distribution from a hue histogram representing the frequency for each hue of pixels constituting the color image. You may specify as the hue range of the said colony.

前記培地を撮像して得られたカラー画像を取得するカラー画像取得手段と、
前記カラー画像取得手段により取得されたカラー画像をグレースケール化した画像にガウシアンフィルタをかけることに得られるグレースケール画像を、前記グレースケール画像取得手段に取得させるグレースケール画像として生成するグレースケール画像生成手段、をさらに備えてもよい。
Color image acquisition means for acquiring a color image obtained by imaging the culture medium;
Grayscale image generation for generating a grayscale image obtained by applying a Gaussian filter to a grayscale image obtained by converting the color image acquired by the color image acquisition unit to the grayscale image acquisition unit Means may be further provided.

上記目的を達成するために、本発明の第2の観点に係るコロニー計数方法は、
検体に含まれる微生物の培養後の培地の様子を示すグレースケール画像を取得するグレースケール画像取得ステップと、
閾値が供給される毎に、前記グレースケール画像取得ステップにより取得されたグレースケール画像を前記閾値により二値化することにより二値化画像を生成する二値化画像生成ステップと、
前記二値化画像生成ステップにより前記二値化画像が生成される毎に、前記二値化画像にラベリング処理を実行することにより前記二値化画像から1つのコロニーを示す画素のまとまりである連結成分を抽出する連結成分抽出ステップと、
前記連結成分抽出ステップにより前記連結成分が抽出される毎に、前記連結成分のうち記憶装置に記憶済みの連結成分情報により示される連結成分を包含しない連結成分を示す連結成分情報を、前記記憶装置にさらに記憶させる連結成分情報追加ステップと、
前記閾値が下限値から上限値に至るまでの間、前記連結成分情報追加ステップの処理が完了する毎に、前記閾値を所定値ずつ増加させて前記二値化画像生成ステップを実行させる閾値供給ステップと、
前記記憶装置に記憶されている連結成分情報に基づいて、前記微生物のコロニーの個数を計数するコロニー計数ステップと、を備える、
ことを特徴とする。
In order to achieve the above object, the colony counting method according to the second aspect of the present invention comprises:
A grayscale image acquisition step of acquiring a grayscale image showing the state of the culture medium after culturing the microorganisms contained in the specimen;
A binarized image generating step of generating a binarized image by binarizing the grayscale image acquired by the grayscale image acquiring step by the threshold value every time a threshold is supplied;
Each time the binarized image is generated by the binarized image generating step, a labeling process is performed on the binarized image, thereby connecting a group of pixels indicating one colony from the binarized image. A connected component extraction step for extracting components;
Each time the connected component is extracted by the connected component extracting step, connected storage information indicating connected components that do not include the connected components indicated by the connected component information stored in the storage device among the connected components is stored in the storage device. Connected component information adding step to be further stored in
A threshold supply step of increasing the threshold value by a predetermined value and executing the binarized image generation step each time the processing of the connected component information adding step is completed until the threshold value reaches the upper limit value. When,
A colony counting step for counting the number of colonies of the microorganism based on the connected component information stored in the storage device,
It is characterized by that.

上記目的を達成するために、本発明の第3の観点に係るプログラムは、
コンピュータを、
検体に含まれる微生物の培養後の培地の様子を示すグレースケール画像を取得するグレースケール画像取得手段、
閾値が供給される毎に、前記グレースケール画像取得手段により取得されたグレースケール画像を前記閾値により二値化することにより二値化画像を生成する二値化画像生成手段、
前記二値化画像生成手段により前記二値化画像が生成される毎に、前記二値化画像にラベリング処理を実行することにより前記二値化画像から1つのコロニーを示す画素のまとまりである連結成分を抽出する連結成分抽出手段、
前記連結成分抽出手段により前記連結成分が抽出される毎に、前記連結成分のうち記憶装置に記憶済みの連結成分情報により示される連結成分を包含しない連結成分を示す連結成分情報を、前記記憶装置にさらに記憶させる連結成分情報追加手段、
前記閾値が下限値から上限値に至るまでの間、前記連結成分情報追加手段の処理が完了する毎に、前記閾値を所定値ずつ増加させて前記二値化画像生成手段に供給する閾値供給手段、
前記記憶装置に記憶されている連結成分情報に基づいて、前記微生物のコロニーの個数を計数するコロニー計数手段、として機能させる、
ことを特徴とする。
In order to achieve the above object, a program according to the third aspect of the present invention provides:
Computer
A grayscale image acquisition means for acquiring a grayscale image showing the state of the culture medium after culturing the microorganisms contained in the specimen;
A binarized image generating unit that generates a binarized image by binarizing the grayscale image acquired by the grayscale image acquiring unit by the threshold every time a threshold is supplied;
Each time the binarized image is generated by the binarized image generating means, a labeling process is performed on the binarized image, thereby connecting a group of pixels indicating one colony from the binarized image. Connected component extraction means for extracting components;
Each time the connected component is extracted by the connected component extraction means, the storage device stores connected component information indicating a connected component that does not include the connected component indicated by the connected component information stored in the storage device. Connected component information adding means for further storing
Threshold supply means for increasing the threshold value by a predetermined value and supplying it to the binarized image generating means each time processing of the connected component information adding means is completed until the threshold value reaches the upper limit value. ,
Based on the connected component information stored in the storage device, function as colony counting means for counting the number of colonies of the microorganism,
It is characterized by that.

本発明によれば、様々な色の濃さを有するコロニーの個数を正確にカウントすることができる。   According to the present invention, it is possible to accurately count the number of colonies having various color densities.

本発明の実施形態に係るコロニー計数装置のハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the colony counting device which concerns on embodiment of this invention. 複数のフィルム型培地が装着された専用シートを示す図である。It is a figure which shows the exclusive sheet | seat with which the some film type culture medium was mounted | worn. 微生物のコロニーが発生した培地の様子を示す図である。It is a figure which shows the mode of the culture medium which the colony of microorganisms generate | occur | produced. 二値化画像を示す図である。It is a figure which shows a binarized image. ラベリング処理を説明するための図である。It is a figure for demonstrating a labeling process. 連結成分に外接する矩形を示す図である。It is a figure which shows the rectangle circumscribing a connection component. 本発明の実施形態に係るコロニー計数装置の機能ブロックを示す図である。It is a figure which shows the functional block of the colony counting device which concerns on embodiment of this invention. 本発明の実施形態に係るコロニー計数装置が実行するコロニー計数処理を示すフローチャートである。It is a flowchart which shows the colony counting process which the colony counting device which concerns on embodiment of this invention performs. ガウシアンフィルタに用いる5×5のオペレータを示す図である。It is a figure which shows the 5 * 5 operator used for a Gaussian filter. (A)は、ガウシアンフィルタリング処理未実行時に検出される連結成分を示す図である。(B)は、ガウシアンフィルタリング処理実行時に検出される連結成分を示す図である。(A) is a figure which shows the connected component detected when the Gaussian filtering process is not performed. (B) is a figure which shows the connected component detected at the time of Gaussian filtering process execution. 図8に示す閾値範囲決定処理を示すフローチャートである。It is a flowchart which shows the threshold value range determination process shown in FIG. 輝度値毎に度数を示すヒストグラムを示す図である。It is a figure which shows the histogram which shows frequency for every luminance value. 図8に示す色相バンドパスフィルタリング処理を示すフローチャートである。It is a flowchart which shows the hue band pass filtering process shown in FIG. 色相毎に度数を示すヒストグラムを示す図である。It is a figure which shows the histogram which shows frequency for every hue. 図8に示す連結成分カウント処理を示すフローチャートである。It is a flowchart which shows the connected component count process shown in FIG. (A)は、グレースケール画像を示す図である。(B)は、閾値を最低値に設定したときに検出される連結成分を示す図である。(A) is a figure which shows a gray scale image. (B) is a figure which shows the connected component detected when a threshold value is set to the minimum value. (A)は、閾値を最低値から1単位増加させたときに検出される連結成分を示す図である。(B)は、1単位増加後の閾値を設定したときに検出される連結成分を示す図である。(A) is a figure which shows the connected component detected when a threshold value is increased 1 unit from the lowest value. (B) is a figure which shows the connected component detected when the threshold value after 1 unit increase is set. (A)は、閾値をさらに1単位増加させたときに検出される連結成分を示す図である。(B)は、2単位増加後の閾値を設定したときに検出される連結成分を示す図である。(A) is a figure which shows the connected component detected when a threshold value is further increased by 1 unit. (B) is a figure which shows the connected component detected when the threshold value after 2 unit increase is set. コロニー計数装置が提示する画面を示す図である。It is a figure which shows the screen which a colony counting device presents. 全面が培地である基材シートを示す図である。It is a figure which shows the base material sheet which the whole surface is a culture medium.

以下、図面を参照して、本発明の実施形態に係るコロニー計数装置について説明する。   Hereinafter, a colony counting device according to an embodiment of the present invention will be described with reference to the drawings.

(実施形態)
まず、図1を参照して、本実施形態に係るコロニー計数装置100のハードウェア構成について説明する。なお、本発明が適用されるコロニー計数装置は、図1に示すコロニー計数装置100に限られない。例えば、コロニー計数装置100に種々の装置が組み込まれたコロニー計数装置に本発明が適用されてもよいし、コロニー計数装置100から適宜、種々の装置が除外されたコロニー計数装置に本発明が適用されてもよい。
(Embodiment)
First, a hardware configuration of the colony counting device 100 according to the present embodiment will be described with reference to FIG. The colony counting device to which the present invention is applied is not limited to the colony counting device 100 shown in FIG. For example, the present invention may be applied to a colony counting device in which various devices are incorporated in the colony counting device 100, or the present invention is applied to a colony counting device in which various devices are appropriately excluded from the colony counting device 100. May be.

まず、図1を参照して、コロニー計数装置100の物理的な構成について説明する。図1に示すようにコロニー計数装置100は、CPU(Central Processing Unit)101、ROM(Read Only Memory)102、RAM(Random Access Memory)103、記憶装置104、入力装置105、通信装置106、撮像制御部107、画像記憶部109、表示制御部110、音声処理部112、を備える。コロニー計数装置100が備えるこれらの構成要素は、バス120により相互に接続される。なお、撮像制御部107には、撮像装置108が接続される。また、表示制御部110には、表示装置111が接続される。そして、音声処理部112には、音声出力装置113が接続される。   First, the physical configuration of the colony counting apparatus 100 will be described with reference to FIG. As shown in FIG. 1, a colony counting apparatus 100 includes a CPU (Central Processing Unit) 101, a ROM (Read Only Memory) 102, a RAM (Random Access Memory) 103, a storage device 104, an input device 105, a communication device 106, and an imaging control. Unit 107, image storage unit 109, display control unit 110, and sound processing unit 112. These components included in the colony counting apparatus 100 are connected to each other by a bus 120. Note that an imaging device 108 is connected to the imaging control unit 107. In addition, a display device 111 is connected to the display control unit 110. An audio output device 113 is connected to the audio processing unit 112.

CPU101は、コロニー計数装置100の全体の動作を制御する。なお、CPU101は、ROM102に格納されているプログラムに従って動作し、RAM103をワークエリアとして使用する。   The CPU 101 controls the overall operation of the colony counting device 100. Note that the CPU 101 operates according to a program stored in the ROM 102 and uses the RAM 103 as a work area.

ROM102には、コロニー計数装置100の全体の動作を制御するためのプログラムやデータが記憶される。   The ROM 102 stores a program and data for controlling the entire operation of the colony counting apparatus 100.

RAM103は、CPU101のワークエリアとして機能する。つまり、CPU101は、RAM103にプログラムやデータを一時的に書き込み、これらのプログラムやデータを適宜参照する。   The RAM 103 functions as a work area for the CPU 101. That is, the CPU 101 temporarily writes programs and data in the RAM 103 and refers to these programs and data as appropriate.

従って、CPU101とROM102とRAM103とは、制御部を構成する。制御部は、バス120に接続された各部を制御して、コロニー計数処理などを実行する。   Therefore, the CPU 101, the ROM 102, and the RAM 103 constitute a control unit. The control unit controls each unit connected to the bus 120 to execute a colony counting process and the like.

記憶装置104は、撮像画像やパラメータなどを記憶する。記憶装置104は、内蔵型の記憶装置であってもよいし、リムーバル型の記憶装置であってもよい。記憶装置104は、例えば、ハードディスク装置、メモリカードを備えるメモリカードスロット、CD−ROM(Compact Disk Read Only Memory)を備えるCD−ROMドライブなどにより構成される。   The storage device 104 stores captured images and parameters. The storage device 104 may be a built-in storage device or a removable storage device. The storage device 104 includes, for example, a hard disk device, a memory card slot including a memory card, a CD-ROM drive including a CD-ROM (Compact Disk Read Only Memory), and the like.

入力装置105は、作業者などの操作入力を受け付ける装置である。入力装置105は、例えば、マウス、キーボード、タッチスクリーン、コントローラ、ボタンなどにより構成される。   The input device 105 is a device that receives an operation input from an operator or the like. The input device 105 includes, for example, a mouse, a keyboard, a touch screen, a controller, buttons, and the like.

通信装置106は、CPU101による制御のもと、無線通信もしくは有線通信により、コロニー計数装置100の外部の装置などと通信を確立し、データを受信したり送信したりする。例えば、通信装置106は、インターネットなどの電気通信網を介してコロニー計数装置100に接続されたデータベースサーバから、撮像装置108などにより撮像された撮像画像を受信する。通信装置106は、NIC(Network Interface Card)、USB(Universal Serial Bus)ポートなどにより構成される。   Under the control of the CPU 101, the communication device 106 establishes communication with a device outside the colony counting device 100 by wireless communication or wired communication, and receives and transmits data. For example, the communication device 106 receives a captured image captured by the imaging device 108 or the like from a database server connected to the colony counting device 100 via an electric communication network such as the Internet. The communication device 106 includes a NIC (Network Interface Card), a USB (Universal Serial Bus) port, and the like.

撮像制御部107は、CPU101による制御のもと、撮像制御部107に接続された撮像装置108を制御する。撮像制御部107は、例えば、撮像開始指示、撮像終了指示などを示す制御信号を撮像装置108に送信することにより、撮像装置108の動作を制御する。また、撮像制御部107は、例えば、解像度、露光時間、明るさなどの撮像設定を撮像装置108に送信することにより、撮像条件を撮像装置108に設定する。そして、撮像制御部107は、撮像装置108により取得された撮像画像を、撮像装置108から受信する。   The imaging control unit 107 controls the imaging device 108 connected to the imaging control unit 107 under the control of the CPU 101. For example, the imaging control unit 107 controls the operation of the imaging device 108 by transmitting a control signal indicating an imaging start instruction, an imaging end instruction, or the like to the imaging device 108. In addition, the imaging control unit 107 sets imaging conditions in the imaging device 108 by transmitting imaging settings such as resolution, exposure time, and brightness to the imaging device 108, for example. Then, the imaging control unit 107 receives the captured image acquired by the imaging device 108 from the imaging device 108.

撮像装置108は、被写体を撮像し、この被写体を示す撮像画像を生成する。撮像装置108は、撮像制御部107から供給される制御信号に従って、被写体を撮像する。撮像装置108は、生成した撮像画像を撮像制御部107に送信する。撮像画像は、例えば、各画素が、R(Red)の輝度値とG(Green)の輝度値とB(Blue)の輝度値とにより表されるカラー画像である。ただし、撮像画像は、各画素が1つの輝度値により表されるモノクロ画像であってもよい。撮像画像は、例えば、ディジタルデータにより表される。また、撮像画像のアスペクト比や解像度は、適宜調整が可能である。撮像装置108は、ディジタルカメラ、ディジタルビデオカメラ、フラットベッドスキャナ、専用リーダなどにより構成される。   The imaging device 108 images a subject and generates a captured image indicating the subject. The imaging device 108 images a subject in accordance with a control signal supplied from the imaging control unit 107. The imaging device 108 transmits the generated captured image to the imaging control unit 107. The captured image is, for example, a color image in which each pixel is represented by a luminance value of R (Red), a luminance value of G (Green), and a luminance value of B (Blue). However, the captured image may be a monochrome image in which each pixel is represented by one luminance value. The captured image is represented by digital data, for example. The aspect ratio and resolution of the captured image can be adjusted as appropriate. The imaging device 108 includes a digital camera, a digital video camera, a flat bed scanner, a dedicated reader, and the like.

なお、本実施形態では、撮像装置108による撮像の被写体は、検体に含まれる微生物の培養後の培地が複数装着された専用シート200である。ここで、検体は、検査対象の食品などから採取される。図2に示すように、専用シート200には、例えば、複数のフィルム型の基材シート210がマトリックス状に装着される。図2は、3×2=6個の基材シート210が専用シート200に装着されている例を示す。撮像装置108は、この専用シート200を撮像して、撮像画像を生成する。撮像画像は、例えば、300dpi、2472×3496Pixels、2.7Mbytesである。ただし、解像度等はこの例に限定されない。   In the present embodiment, the subject imaged by the imaging device 108 is the dedicated sheet 200 on which a plurality of culture media after culturing the microorganisms contained in the specimen are mounted. Here, the specimen is collected from a food to be examined. As shown in FIG. 2, for example, a plurality of film-type substrate sheets 210 are mounted on the dedicated sheet 200 in a matrix. FIG. 2 shows an example in which 3 × 2 = 6 substrate sheets 210 are attached to the dedicated sheet 200. The imaging device 108 images this dedicated sheet 200 and generates a captured image. The captured image is, for example, 300 dpi, 2472 × 3496 Pixels, 2.7 Mbytes. However, the resolution and the like are not limited to this example.

図3は、基材シート210に含まれる培養層230に、微生物のコロニー250が発生している様子を示している。また、基材シート210には、培養層230に関する識別情報220が記載される。識別情報220は、例えば、培養条件や日付などである。また、微生物は、例えば、大腸菌などの菌類である。なお、微生物の培養により、培養層230には、微生物のコロニー250が発生する。   FIG. 3 shows a state in which microbial colonies 250 are generated in the culture layer 230 included in the base sheet 210. In addition, identification information 220 relating to the culture layer 230 is described in the base sheet 210. The identification information 220 is, for example, culture conditions or dates. The microorganism is a fungus such as E. coli. Microorganism colonies 250 are generated in the culture layer 230 by culturing the microorganisms.

本実施形態では、専用シート200の全体を撮像して得られたカラーの撮像画像から、培養層230を含む領域240が抽出されるものとして説明する。ただし、抽出される領域は、この例に限られない。例えば、抽出される領域は、培養層230の一部の領域であってもよい。以下、専用シート200の全体を撮像して得られたカラーの撮像画像から抽出される領域240を示す画像を、単にカラー画像という。また、培養層230を適宜、培地といい、基材シート210を適宜、台紙という。   In the present embodiment, a description will be given assuming that a region 240 including the culture layer 230 is extracted from a color captured image obtained by imaging the entire dedicated sheet 200. However, the extracted area is not limited to this example. For example, the extracted region may be a partial region of the culture layer 230. Hereinafter, an image showing the region 240 extracted from a color captured image obtained by imaging the entire dedicated sheet 200 is simply referred to as a color image. The culture layer 230 is appropriately referred to as a medium, and the base sheet 210 is appropriately referred to as a mount.

ここで、培養層230の色とコロニー250の色とは異なるため、カラー画像上において培養層230を表す領域とコロニー250を表す領域とを区別することができる。本実施形態では、コロニー250の色が暗めの青緑色に近い色であり、培養層230の色が明るめの肌色に近い色であり、基材シート210の色は明るい白色に近い色であるものとする。カラー画像をグレースケール化したときに生成されるグレースケール画像では、例えば、培養層230を表す画素の輝度値よりも低い第1の閾値よりも低い輝度値の画素がコロニー250を表す画素であり、培養層230を表す画素の輝度値よりも高い第2の閾値よりも高い輝度値の画素が基材シート210を表す画素であり、第1の閾値よりも高く第2の閾値よりも低い輝度値の画素が培養層230の色である。以下、「第1の閾値」を、適宜、単に「閾値」という。カラー画像上において、コロニー250を表す画素や培養層230を表す画素を検出する方法の詳細については、後述する。   Here, since the color of the culture layer 230 and the color of the colony 250 are different, the region representing the culture layer 230 and the region representing the colony 250 can be distinguished on the color image. In this embodiment, the color of the colony 250 is a color close to dark blue-green, the color of the culture layer 230 is a color close to light skin color, and the color of the base sheet 210 is a color close to bright white And In the grayscale image generated when the color image is grayscaled, for example, a pixel having a luminance value lower than the first threshold value lower than the luminance value of the pixel representing the culture layer 230 is a pixel representing the colony 250. A pixel having a luminance value higher than the second threshold value higher than the luminance value of the pixel representing the culture layer 230 is a pixel representing the base sheet 210, and has a luminance higher than the first threshold value and lower than the second threshold value. The value pixel is the color of the culture layer 230. Hereinafter, the “first threshold value” is simply referred to as “threshold value” as appropriate. Details of a method for detecting a pixel representing the colony 250 and a pixel representing the culture layer 230 on the color image will be described later.

なお、基材シート210(台紙)がなくても、後述する二値化処理などは実行可能である。例えば、基材シート210の全面が培養層230となっている場合、第1の閾値のみによって、コロニー250を表す画素と培養層230を表す画素とを区別することができる。一方、基材シート210もしくは培養層230に、所定のサイズの格子を形成する罫線が付されている場合、この罫線を表す画素を、コロニー250を表す画素などと区別するための閾値が必要となる。この格子は、典型的には正方形である。この格子のサイズは、コロニー250の密度を求める際に用いられるスケールを示すことになる。   Even without the base sheet 210 (mounting paper), the binarization processing described later can be performed. For example, when the entire surface of the base sheet 210 is the culture layer 230, the pixel representing the colony 250 and the pixel representing the culture layer 230 can be distinguished only by the first threshold value. On the other hand, when the base sheet 210 or the culture layer 230 is provided with a ruled line that forms a lattice of a predetermined size, a threshold value is required to distinguish the pixel representing the ruled line from the pixel representing the colony 250 or the like. Become. This grid is typically square. The size of the lattice indicates a scale used when determining the density of the colony 250.

なお、本実施形態では、フィルムないしシート状の乾燥培地である培養層230を採用する例について説明するが、シャーレに充填された寒天培地を採用してもよい。フィルムないしシート状の乾燥培地である培養層230を採用する場合、撮像装置108として、スキャナなどを採用することが好適である。一方、シャーレに充填された寒天培地を採用する場合、撮像装置108として、ディジタルカメラなどを採用することが好適である。   In addition, although this embodiment demonstrates the example which employ | adopts the culture layer 230 which is a film thru | or sheet-like dry culture medium, you may employ | adopt the agar medium with which the petri dish was filled. When the culture layer 230 that is a film or sheet-like dry medium is employed, it is preferable to employ a scanner or the like as the imaging device 108. On the other hand, when an agar medium filled in a petri dish is employed, a digital camera or the like is preferably employed as the imaging device 108.

画像記憶部109は、コロニー250の検出対象の培養層230を含む専用シート200を撮像して得られた撮像画像などを記憶する。画像記憶部109は、例えば、撮像装置108から取得された撮像画像、記憶装置104に記憶されている撮像画像、もしくは、通信装置106により外部の装置から取得された撮像画像などを記憶する。画像記憶部109は、撮像画像の代わりに、撮像画像から抽出されたカラー画像を記憶してもよい。画像記憶部109は、例えば、フラッシュメモリなどにより構成される。   The image storage unit 109 stores a captured image obtained by imaging the dedicated sheet 200 including the culture layer 230 to be detected by the colony 250. The image storage unit 109 stores, for example, a captured image acquired from the imaging device 108, a captured image stored in the storage device 104, a captured image acquired from an external device by the communication device 106, or the like. The image storage unit 109 may store a color image extracted from the captured image instead of the captured image. The image storage unit 109 is configured by, for example, a flash memory.

表示制御部110は、CPU101による制御のもと、表示装置111を制御する。例えば、表示制御部110は、表示装置111に表示させる画像を表す画像信号を生成し、生成した画像信号を表示装置111に供給する。   The display control unit 110 controls the display device 111 under the control of the CPU 101. For example, the display control unit 110 generates an image signal representing an image to be displayed on the display device 111 and supplies the generated image signal to the display device 111.

表示装置111は、表示制御部110から供給された画像信号に基づく画像を表示する。表示装置111は、例えば、LCD(Liquid Crystal Display)や有機EL(Electro Luminescence)などの表示装置により構成される。表示装置111は、タッチスクリーンであってもよい。この場合、タッチスクリーンは、表示装置として機能するほか、入力装置105としても機能する。   The display device 111 displays an image based on the image signal supplied from the display control unit 110. The display device 111 is configured by a display device such as an LCD (Liquid Crystal Display) or an organic EL (Electro Luminescence). The display device 111 may be a touch screen. In this case, the touch screen functions not only as a display device but also as an input device 105.

音声処理部112は、CPU101から供給されたディジタルオーディオ信号をD/A(Digital/Analog)コンバータ(図示せず)でアナログオーディオ信号に変換して、音声出力部113に供給する。音声処理部112は、CPU101から供給されたディジタルオーディオ信号に各種処理を加えるDSP(Digital Signal Processor)を含んでもよい。   The audio processing unit 112 converts the digital audio signal supplied from the CPU 101 into an analog audio signal by a D / A (Digital / Analog) converter (not shown) and supplies the analog audio signal to the audio output unit 113. The audio processing unit 112 may include a DSP (Digital Signal Processor) that performs various processes on the digital audio signal supplied from the CPU 101.

音声出力装置113は、音声処理部112から供給されたアナログオーディオ信号を音声に変換して、出力する。音声出力装置113は、例えば、スピーカにより構成される。音声出力装置113は、ディジタルオーディオ信号またはアナログオーディオ信号を増幅する増幅装置を含んでもよい。   The audio output device 113 converts the analog audio signal supplied from the audio processing unit 112 into audio and outputs the audio. The audio output device 113 is configured by a speaker, for example. The audio output device 113 may include an amplifying device that amplifies a digital audio signal or an analog audio signal.

次に、図4〜図6を参照して、本実施形態に係るコロニー計数装置100が実行する連結成分カウント処理において実行されるラベリング処理について説明する。なお、以下に説明するラベリング処理の他、種々のラベリング処理を、本発明に採用することができる。なお、理解を容易にするため、グレースケール画像は、縦方向の16行×横方向の16行=256画素により構成されるものとして説明する。   Next, with reference to FIGS. 4-6, the labeling process performed in the connected component count process which the colony counting device 100 which concerns on this embodiment performs is demonstrated. In addition to the labeling process described below, various labeling processes can be employed in the present invention. In order to facilitate understanding, the grayscale image will be described as being composed of 16 rows in the vertical direction × 16 rows in the horizontal direction = 256 pixels.

まず、CPU101は、撮像画像から抽出されたカラー画像をグレースケール画像に変換する。例えば、CPU101は、NTSC(National Television System Committee)係数による加重平均法を採用して、カラー画像をグレースケール画像に変換することができる。例えば、カラー画像における各色の輝度値をR、G、Bとし、グレースケール画像における輝度値をYとすると、Y=(0.298912*R+0.586611*G+0.114478*B)である。   First, the CPU 101 converts a color image extracted from the captured image into a grayscale image. For example, the CPU 101 can convert a color image into a grayscale image by employing a weighted average method using NTSC (National Television System Committee) coefficients. For example, if the luminance values of each color in the color image are R, G, and B, and the luminance value in the grayscale image is Y, Y = (0.298912 * R + 0.586611 * G + 0.114478 * B).

そして、CPU101は、グレースケール画像を二値化する。具体的には、CPU101は、グレースケール画像を構成する各画素の輝度値が閾値以上であるか否かを判別し、判別結果に従って各画素を二値化し、二値化画像を生成する。例えば、グレースケール画像を構成する各画素が0〜255までの256階調で表現されている場合、二値化画像を構成する各画素は0もしくは1の2階調で表現される。ここで、コロニー250のように暗い部分を示す画素の輝度値は0(黒)になり、培養層230のように明るい部分を示す画素の輝度値は1(白)にされる。   Then, the CPU 101 binarizes the gray scale image. Specifically, the CPU 101 determines whether the luminance value of each pixel constituting the grayscale image is equal to or higher than a threshold value, and binarizes each pixel according to the determination result to generate a binarized image. For example, when each pixel constituting the grayscale image is expressed by 256 gradations from 0 to 255, each pixel constituting the binarized image is expressed by two gradations of 0 or 1. Here, the luminance value of a pixel indicating a dark portion such as the colony 250 is 0 (black), and the luminance value of a pixel indicating a bright portion such as the culture layer 230 is 1 (white).

なお、閾値は、例えば、コロニー250を示す画素の輝度値よりも十分に高く、培養層230を示す画素の輝度値よりも十分に低い輝度値に設定される。本実施形態では、グレースケール画像に基づいて決定された閾値範囲から閾値を選択する処理と、選択された閾値による二値化により生成された二値化画像から連結成分を抽出する処理とを、閾値が閾値範囲の最低値(下限値)から最高値(上限値)に至るまで繰り返される。ここでは、特定の閾値による二値化により生成された二値化画像から連結成分を抽出する処理について説明する。なお、閾値範囲は、撮像環境、コロニー250を構成する微生物の種類、培地の素材などにより、あらかじめ決定されていてもよい。   For example, the threshold value is set to a luminance value sufficiently higher than the luminance value of the pixel indicating the colony 250 and sufficiently lower than the luminance value of the pixel indicating the culture layer 230. In the present embodiment, processing for selecting a threshold from a threshold range determined based on a grayscale image, and processing for extracting a connected component from a binarized image generated by binarization using the selected threshold, The threshold is repeated from the lowest value (lower limit value) to the highest value (upper limit value) of the threshold range. Here, a process of extracting a connected component from a binarized image generated by binarization using a specific threshold will be described. Note that the threshold range may be determined in advance according to the imaging environment, the type of microorganisms constituting the colony 250, the material of the culture medium, and the like.

図4に、二値化画像を示す。図4において、ハッチングで示している画素は、輝度値が0(黒)の画素であり、白抜きで示している画素は、輝度値が1(白)の画素である。ここで、輝度値が0(黒)の画素は、コロニー250を示す画素である。従って、輝度値が0(黒)の画素は、二値化画像上において数個のまとまりを構成する。このまとまりのそれぞれは、1つのコロニー250を示し、以下適宜、連結成分という。図4に示す例では、C01、C02、Co3で示される3つの連結成分(3つのコロニー250)が検出された例を示す。   FIG. 4 shows a binarized image. In FIG. 4, pixels indicated by hatching are pixels having a luminance value of 0 (black), and pixels indicated by white portions are pixels having a luminance value of 1 (white). Here, a pixel having a luminance value of 0 (black) is a pixel indicating the colony 250. Accordingly, the pixels having a luminance value of 0 (black) constitute several groups on the binarized image. Each of these groups represents one colony 250 and is hereinafter referred to as a connected component as appropriate. In the example shown in FIG. 4, an example is shown in which three connected components (three colonies 250) indicated by C01, C02, and Co3 are detected.

ここで、各連結成分は、ラベル付けして管理することが望まれる。つまり、このラベルにより、連結成分を特定できることが望ましい。以下、図5を参照して、ラベリング処理について説明する。本実施形態では、縦、横、斜め方向に連続している部分を同じラベルにする8連結を採用する例について説明するが、縦、横方向に連続している部分を同じラベルにする4連結を採用することもできる。   Here, it is desirable to manage each connected component by labeling. That is, it is desirable that the connected component can be specified by this label. Hereinafter, the labeling process will be described with reference to FIG. In the present embodiment, an example is described in which 8 connections are used in which the portions that are continuous in the vertical, horizontal, and diagonal directions are the same label. Can also be adopted.

まず、CPU101は、ラベリングのために、各々がいずれかの画素に対応する画素数分のラベル番号を格納するための変数をRAM103などに用意する。そして、CPU101は、全てのラベル番号を0に初期化する。ここで、ある画素のラベル番号が0であることは、このある画素がラベル付けされていないことを示し、ある画素のラベル番号が0以外の整数nであることは、このある画素が整数nにラベル付けされていることを示す。また、本実施形態では、画素の輝度値が0(黒)の場合、この画素がラベル付けされ、画素の輝度値が1(白)の場合、この画素がラベル付けされないものとする。   First, for labeling, the CPU 101 prepares variables in the RAM 103 or the like for storing label numbers corresponding to the number of pixels each corresponding to one of the pixels. Then, the CPU 101 initializes all label numbers to 0. Here, a label number of a certain pixel being 0 indicates that the certain pixel is not labeled, and a label number of a certain pixel being an integer n other than 0 indicates that this certain pixel is an integer n Indicates that it is labeled. In this embodiment, when the luminance value of a pixel is 0 (black), this pixel is labeled. When the luminance value of a pixel is 1 (white), this pixel is not labeled.

CPU101は、注目画素のラベル番号の更新処理を、注目画素を走査しながら実行することにより、全ての画素のラベル番号の更新処理を実行する。なお、注目画素は、最初は、図5における左上の画素(1行目1列目の画素)であり、右方向(列方向、横軸方向)に向かって1つずつシフトし、右端に至ると1つ下の行の左端の画素にシフトし、以下同様に図5における右下の画素(16行目16列目の画素)までシフトする。   The CPU 101 executes the update process of the label numbers of all the pixels by executing the update process of the label numbers of the target pixels while scanning the target pixels. Note that the target pixel is initially the upper left pixel (the pixel in the first row and the first column) in FIG. 5, and is shifted one by one in the right direction (column direction, horizontal axis direction) to reach the right end. Shift to the pixel at the left end of the next lower row, and similarly shift to the lower right pixel (pixel at the 16th row and the 16th column) in FIG.

ここで、ラベル番号の更新処理について説明する。まず、注目画素の輝度値が1(白)である場合、注目画素のラベル番号は更新されない。一方、注目画素の輝度値が0(黒)である場合、注目画素のラベル番号が更新される。注目画素のラベル番号が何に更新されるかは、注目画素を基準として、左上の画素、上の画素、右上の画素、左の画素の4つの画素のラベル番号が何であるかに依存する。例えば、図5におけるP34で示される3行目4列目の画素(以下「P34」とする。)が注目画素である場合、P23、P24、P25、P33のラベル番号に応じて、P34のラベル番号が決定する。   Here, the label number update process will be described. First, when the luminance value of the target pixel is 1 (white), the label number of the target pixel is not updated. On the other hand, when the luminance value of the target pixel is 0 (black), the label number of the target pixel is updated. What the label number of the target pixel is updated depends on what the label numbers of the four pixels of the upper left pixel, the upper pixel, the upper right pixel, and the left pixel are based on the target pixel. For example, when the pixel in the third row and the fourth column (hereinafter referred to as “P34”) indicated by P34 in FIG. 5 is the target pixel, the label of P34 is set according to the label numbers of P23, P24, P25, and P33. The number is determined.

具体的には、4つの画素のラベル番号が全て0である場合、注目画素に新たなラベル番号が割り振られる。つまり、過去に付されたラベル番号のうち最も大きいラベル番号よりも1大きいラベル番号が注目画素のラベル番号に設定される。一方、4つの画素のラベル番号のいずれかが0でない場合、4つのラベル番号のうちで最も小さいラベル番号(ただし、0以外のラベル番号)が注目画素のラベル番号に設定される。また、4つのラベル番号のうちに、この最も小さいラベル番号以外のラベル番号(ただし、0以外のラベル番号)がある場合、この最も小さいラベル番号以外のラベル番号が付されている全ての画素のラベル番号を、この最も小さいラベル番号に書き換える。   Specifically, when the label numbers of all four pixels are 0, a new label number is assigned to the target pixel. That is, a label number that is one larger than the largest label number among the label numbers assigned in the past is set as the label number of the target pixel. On the other hand, if any of the label numbers of the four pixels is not 0, the smallest label number among the four label numbers (however, a label number other than 0) is set as the label number of the target pixel. In addition, when there is a label number other than the smallest label number among the four label numbers (however, a label number other than 0), all of the pixels to which a label number other than the smallest label number is assigned. Rewrite the label number to this smallest label number.

以上説明したラベル番号の更新処理を全ての画素に対して実行すると、ラベリング処理が完了する。図5は、ラベリング処理により、C01、C02、C03の3つの連結成分が検出された例を示している。なお、他のラベル番号により書き換えられたラベル番号は使用されないので、使用されるラベル番号が連番になるようにラベル番号の振り直しをすることが望ましい。   When the label number updating process described above is executed for all pixels, the labeling process is completed. FIG. 5 shows an example in which three connected components C01, C02, and C03 are detected by the labeling process. Since label numbers rewritten with other label numbers are not used, it is desirable to reassign the label numbers so that the label numbers used are serial numbers.

図5に示すように、連結成分は不定形である。従って、本実施形態では、少なくとも後述する連結成分カウント処理が完了するまでは、連結成分を不定型なものとして扱う。しかしながら、連結成分を矩形で近似すると、連結成分の大きさなどを判別する処理などが容易になる。このため、例えば、連結成分カウント処理が完了したのちに、図6に示すように、連結成分をこの連結成分に外接する矩形で近似することができる。図6では、C01で示された連結成分をC11で近似し、C02で示された連結成分をC12で近似し、C03で示された連結成分をC13で近似する例を示している。なお、矩形は、撮像画像における縦軸方向(行方向)に平行な2本の線分と、撮像画像における横軸方向(列方向)に平行な2本の線分と、により囲まれる。なお、Lyは、C11により示される矩形の縦軸方向の長さを示し、Lxは、C11により示される矩形の横軸方向の長さを示している。この例では、C11により示される矩形の短辺の長さはLxであり、C11により示される矩形の長辺の長さはLyである。   As shown in FIG. 5, the connected component is indefinite. Therefore, in this embodiment, the connected component is treated as an indefinite type until at least the connected component counting process described later is completed. However, when the connected component is approximated by a rectangle, the process of determining the size of the connected component and the like are facilitated. Therefore, for example, after the connected component counting process is completed, the connected component can be approximated by a rectangle circumscribing the connected component as shown in FIG. FIG. 6 shows an example in which the connected component indicated by C01 is approximated by C11, the connected component indicated by C02 is approximated by C12, and the connected component indicated by C03 is approximated by C13. Note that the rectangle is surrounded by two line segments parallel to the vertical axis direction (row direction) in the captured image and two line segments parallel to the horizontal axis direction (column direction) in the captured image. Note that Ly indicates the length of the rectangle indicated by C11 in the vertical axis direction, and Lx indicates the length of the rectangle indicated by C11 in the horizontal axis direction. In this example, the length of the short side of the rectangle indicated by C11 is Lx, and the length of the long side of the rectangle indicated by C11 is Ly.

次に、図7を参照して、本実施形態に係るコロニー計数装置100の機能的な構成について説明する。図7に示すように、コロニー計数装置100は、グレースケール画像取得部11、二値化画像生成部12、連結成分抽出部13、連結成分情報追加部14、閾値供給部15、コロニー計数部16、閾値範囲決定部17、カラー画像取得部18、色相範囲特定部19、グレースケール画像生成部20、を備える。   Next, a functional configuration of the colony counting apparatus 100 according to the present embodiment will be described with reference to FIG. As shown in FIG. 7, the colony counting apparatus 100 includes a grayscale image acquisition unit 11, a binarized image generation unit 12, a connected component extraction unit 13, a connected component information addition unit 14, a threshold supply unit 15, and a colony counting unit 16. , A threshold range determination unit 17, a color image acquisition unit 18, a hue range specification unit 19, and a gray scale image generation unit 20.

グレースケール画像取得部11は、検体に含まれる微生物の培養後の培地の様子を示すグレースケール画像を取得する。グレースケール画像取得部11は、例えば、CPU101を含む。   The gray scale image acquisition unit 11 acquires a gray scale image showing the state of the culture medium after culturing the microorganisms contained in the specimen. The gray scale image acquisition unit 11 includes, for example, a CPU 101.

二値化画像生成部12は、閾値が供給される毎に、グレースケール画像取得部11により取得されたグレースケール画像を閾値により二値化することにより二値化画像を生成する。二値化画像生成部12は、例えば、CPU101を含む。   The binarized image generating unit 12 generates a binarized image by binarizing the grayscale image acquired by the grayscale image acquiring unit 11 with the threshold every time the threshold is supplied. The binarized image generation unit 12 includes, for example, a CPU 101.

連結成分抽出部13は、二値化画像生成部12により二値化画像が生成される毎に、二値化画像にラベリング処理を実行することにより二値化画像から連結成分を抽出する。連結成分抽出部13は、例えば、CPU101を含む。   The connected component extraction unit 13 extracts a connected component from the binarized image by performing a labeling process on the binarized image every time the binarized image generating unit 12 generates the binarized image. The connected component extraction unit 13 includes, for example, a CPU 101.

連結成分情報追加部14は、連結成分抽出部13により連結成分が抽出される毎に、連結成分のうち記憶部30に記憶済みの連結成分情報により示される連結成分を包含しない連結成分を示す連結成分情報を、記憶部30にさらに記憶させる。連結成分情報追加部14は、例えば、CPU101を含む。   The connected component information adding unit 14 represents a connected component that does not include the connected component indicated by the connected component information stored in the storage unit 30 among the connected components every time the connected component is extracted by the connected component extracting unit 13. The component information is further stored in the storage unit 30. The connected component information adding unit 14 includes, for example, a CPU 101.

閾値供給部15は、閾値が下限値から上限値に至るまでの間、連結成分情報追加部14の処理が完了する毎に、閾値を所定値ずつ増加させて二値化画像生成部12に供給する。閾値供給部15は、例えば、CPU101を含む。   The threshold supply unit 15 increases the threshold value by a predetermined value and supplies it to the binarized image generation unit 12 every time the processing of the connected component information adding unit 14 is completed until the threshold value reaches the upper limit value. To do. The threshold supply unit 15 includes, for example, a CPU 101.

コロニー計数部16は、記憶部30に記憶されている連結成分情報に基づいて、微生物のコロニーの個数を計数する。コロニー計数部16は、例えば、CPU101を含む。   The colony counting unit 16 counts the number of colonies of microorganisms based on the connected component information stored in the storage unit 30. The colony counting unit 16 includes, for example, a CPU 101.

閾値範囲決定部17は、グレースケール画像を構成する画素の輝度値の分布に基づいて、下限値と上限値とを決定する。   The threshold range determination unit 17 determines the lower limit value and the upper limit value based on the distribution of the luminance values of the pixels constituting the grayscale image.

例えば、閾値範囲決定部17は、グレースケール画像を構成する画素の輝度値毎の度数を表す輝度ヒストグラムに含まれる最大の山状の度数分布の輝度範囲の中で度数が最多である輝度値を特定する。そして、閾値範囲決定部17は、特定した輝度値よりも低く、かつ、特定した輝度値の度数に対して所定の割合以下の度数である輝度値のうち、最高の輝度値を上限値に決定する。   For example, the threshold range determination unit 17 determines the luminance value having the highest frequency in the luminance range of the maximum mountain-shaped frequency distribution included in the luminance histogram representing the frequency for each luminance value of the pixels constituting the grayscale image. Identify. Then, the threshold range determination unit 17 determines the highest luminance value as the upper limit value among the luminance values that are lower than the specified luminance value and are equal to or less than a predetermined ratio with respect to the frequency of the specified luminance value. To do.

また、例えば、閾値範囲決定部17は、グレースケール画像を構成する画素の輝度値の最小の輝度値を特定し、特定した輝度値を下限値に決定する。コロニー計数部16は、例えば、CPU101を含む。   For example, the threshold range determination unit 17 specifies the minimum luminance value of the luminance values of the pixels constituting the grayscale image, and determines the specified luminance value as the lower limit value. The colony counting unit 16 includes, for example, a CPU 101.

カラー画像取得部18は、培地を撮像して得られたカラー画像を取得する。例えば、カラー画像は、撮像画像から抽出される。また、撮像画像は、静止画像でもよいし、動画像でもよい。カラー画像取得部18は、例えば、CPU101を含む。   The color image acquisition unit 18 acquires a color image obtained by imaging the culture medium. For example, the color image is extracted from the captured image. The captured image may be a still image or a moving image. The color image acquisition unit 18 includes, for example, a CPU 101.

色相範囲特定部19は、カラー画像取得部18により取得されたカラー画像を構成する画素の色相の分布に基づいて、コロニーの色相範囲を特定する。
例えば、色相範囲特定部19は、カラー画像を構成する画素の色相毎の度数を表す色相ヒストグラムから最大の山状の度数分布の色相範囲を除外したのちに存在する山状の度数分布の色相範囲をコロニーの色相範囲として特定する。色相範囲特定部19は、例えば、CPU101を含む。
The hue range specifying unit 19 specifies the hue range of the colony based on the hue distribution of the pixels constituting the color image acquired by the color image acquiring unit 18.
For example, the hue range specifying unit 19 removes the hue range of the maximum mountain-shaped frequency distribution from the hue histogram representing the frequency for each hue of the pixels constituting the color image, and thus the hue range of the mountain-shaped frequency distribution exists. As the colony hue range. The hue range specifying unit 19 includes, for example, a CPU 101.

グレースケール画像生成部20は、グレースケール画像取得部11に取得させるグレースケール画像を生成する。このグレースケール画像は、例えば、カラー画像取得部18により取得されたカラー画像をグレースケール化した画像を構成する画素のうち、色相範囲特定部19により特定された色相範囲に含まれない画素の輝度値を、上限値よりも高い輝度値に設定することにより取得される。   The gray scale image generation unit 20 generates a gray scale image to be acquired by the gray scale image acquisition unit 11. This grayscale image is, for example, the luminance of pixels that are not included in the hue range specified by the hue range specifying unit 19 among the pixels constituting the image obtained by converting the color image acquired by the color image acquiring unit 18 to grayscale. It is obtained by setting the value to a luminance value higher than the upper limit value.

また、グレースケール画像生成部20は、カラー画像取得部18により取得されたカラー画像をグレースケール化した画像にガウシアンフィルタをかけることに得られるグレースケール画像を、グレースケール画像取得部11に取得させるグレースケール画像として生成してもよい。グレースケール画像生成部20は、例えば、CPU101を含む。   Further, the gray scale image generation unit 20 causes the gray scale image acquisition unit 11 to acquire a gray scale image obtained by applying a Gaussian filter to an image obtained by converting the color image acquired by the color image acquisition unit 18 into a gray scale. It may be generated as a gray scale image. The gray scale image generation unit 20 includes a CPU 101, for example.

記憶部30は、連結成分抽出部13により抽出された連結成分を示す連結成分情報を記憶する。記憶部30に記憶される連結成分情報は、CPU101などにより、連結成分抽出部13により連結成分が抽出される毎に、抽出された連結成分がさらに含まれるように更新される。連結成分情報は、例えば、連結成分を構成する各画素の位置(座標)や連結成分のラベル番号を示す情報であり、配列変数などにより管理される情報である。記憶部30は、例えば、RAM103や記憶装置104により構成される。   The storage unit 30 stores connected component information indicating the connected component extracted by the connected component extracting unit 13. The connected component information stored in the storage unit 30 is updated by the CPU 101 or the like so that each time the connected component is extracted by the connected component extracting unit 13, the extracted connected component is further included. The connected component information is, for example, information indicating the position (coordinates) of each pixel constituting the connected component and the label number of the connected component, and is information managed by an array variable or the like. The storage unit 30 includes, for example, a RAM 103 and a storage device 104.

次に、本実施形態に係るコロニー計数装置100が実行するコロニー計数処理について説明する。図8は、コロニー計数装置100が実行するコロニー計数処理を示すフローチャートである。コロニー計数装置100は、例えば、作業者によるコロニー計数処理の開始指示が入力装置105に受け付けられたことを検知すると、図8に示すコロニー計数処理を開始する。   Next, a colony counting process executed by the colony counting apparatus 100 according to the present embodiment will be described. FIG. 8 is a flowchart showing a colony counting process executed by the colony counting apparatus 100. The colony counting device 100 starts the colony counting process shown in FIG. 8 when detecting that the input device 105 has received an instruction to start the colony counting process by the operator, for example.

まず、CPU101は、撮像画像を取得する(ステップS101)。撮像画像の取得元は、典型的には、撮像装置108であるが、記憶装置104、画像記憶部109、通信装置106が通信可能な外部の装置などであってもよい。撮像画像は、典型的には、専用シート200を撮像して得られるカラーの画像である。撮像画像は、モノクロの画像でもよい。なお、CPU101は、取得した撮像画像に対して、種々のトリミング処理やフィルタリング処理を実行してもよい。CPU101は、例えば、取得した撮像画像をRAM103に記憶する。   First, the CPU 101 acquires a captured image (step S101). The acquisition source of the captured image is typically the imaging device 108, but may be an external device or the like with which the storage device 104, the image storage unit 109, and the communication device 106 can communicate. The captured image is typically a color image obtained by capturing the dedicated sheet 200. The captured image may be a monochrome image. Note that the CPU 101 may execute various trimming processes and filtering processes on the acquired captured image. For example, the CPU 101 stores the acquired captured image in the RAM 103.

CPU101は、ステップS101の処理を完了すると、カラー画像を取得する(ステップS102)。例えば、CPU101は、撮像画像から矩形の領域を抽出して、カラー画像とする。CPU101は、取得したカラー画像をRAM103に記憶する。   When completing the process in step S101, the CPU 101 acquires a color image (step S102). For example, the CPU 101 extracts a rectangular area from the captured image and generates a color image. The CPU 101 stores the acquired color image in the RAM 103.

CPU101は、ステップS102の処理を完了すると、取得したカラー画像をグレースケール化することによりグレースケール画像を生成する(ステップS103)。グレースケール化は、例えば、NTSC計数による加重平均法を採用することができる。生成されたグレースケール画像は、例えば、RAM103に記憶される。   When completing the process in step S102, the CPU 101 generates a grayscale image by converting the acquired color image into a grayscale (step S103). For the gray scale conversion, for example, a weighted average method using NTSC counting can be adopted. The generated grayscale image is stored in the RAM 103, for example.

CPU101は、ステップS103の処理を完了すると、ガウシアンフィルタリング処理を実行する(ステップS104)。なお、ガウシアンフィルタは、注目画素に近い画素ほど平均値を計算するときの重みを大きくし、注目画素に遠い画素ほど平均値を計算するときの重みが小さいフィルタである。なお、この重みは、ガウス分布の関数を用いて計算することができる。   When completing the process of step S103, the CPU 101 executes a Gaussian filtering process (step S104). Note that the Gaussian filter is a filter that increases the weight when calculating the average value for pixels closer to the target pixel and decreases the weight for calculating the average value for pixels farther from the target pixel. This weight can be calculated using a Gaussian distribution function.

図9に、ガウシアンフィルタに用いる5×5のオペレータ(カーネル)を示す。グレースケール画像は、ガウシアンフィルタリング処理により、輝度値の分布が滑らかになる。図10(A)は、ガウシアンフィルタリング処理の未実行時のグレースケール画像を示す。図10(A)は、コロニー250を表す画素の輝度値の分布が一様でないために、1つのコロニー250が、C21、C22、C23により示されている3つの連結成分として検出された例を示している。   FIG. 9 shows a 5 × 5 operator (kernel) used for the Gaussian filter. The grayscale image has a smooth luminance value distribution by Gaussian filtering. FIG. 10A shows a grayscale image when the Gaussian filtering process is not executed. FIG. 10A shows an example in which one colony 250 is detected as three connected components indicated by C21, C22, and C23 because the luminance value distribution of pixels representing the colony 250 is not uniform. Show.

図10(B)は、ガウシアンフィルタリング処理の実行時のグレースケール画像を示す。図10(B)は、ガウシアンフィルタリング処理により、コロニー250を表す画素の輝度値のばらつきが小さくなったため、1つのコロニー250が、C20により示されている1つの連結成分として検出された例を示している。CPU101は、ステップS104のガウシアンフィルタリング処理を完了すると、閾値範囲決定処理を実行する(ステップS105)。閾値範囲決定処理については、図11を参照して詳細に説明する。図11は、コロニー計数装置100が実行する閾値範囲決定処理を示すフローチャートである。なお、閾値範囲は、閾値範囲の下限値と閾値範囲の上限値とにより決定される。   FIG. 10B shows a grayscale image when the Gaussian filtering process is executed. FIG. 10B shows an example in which one colony 250 is detected as one connected component indicated by C20 because the variation in the luminance value of the pixel representing the colony 250 is reduced by the Gaussian filtering process. ing. When the CPU 101 completes the Gaussian filtering process in step S104, the CPU 101 executes a threshold range determination process (step S105). The threshold range determination process will be described in detail with reference to FIG. FIG. 11 is a flowchart showing a threshold range determination process executed by the colony counting device 100. The threshold range is determined by the lower limit value of the threshold range and the upper limit value of the threshold range.

まず、CPU101は、グレースケール画像の輝度値のヒストグラムを生成する(ステップS201)。例えば、グレースケール画像を構成する画素の階調が、0〜255の256階調であるものとすると、CPU101は、0〜255の輝度値のそれぞれについて、グレースケール画像を構成する画素のうち、この輝度値である画素の数(度数)を求める。   First, the CPU 101 generates a histogram of luminance values of a grayscale image (step S201). For example, assuming that the gradation of the pixels constituting the grayscale image is 256 gradations of 0 to 255, the CPU 101, for each of the luminance values of 0 to 255, among the pixels constituting the grayscale image, The number of pixels (frequency) that is the luminance value is obtained.

CPU101は、ステップS201の処理を完了すると、生成したヒストグラムに移動平均をかける(ステップS202)。かかる移動平均処理により、ヒストグラム上のノイズ成分が除去され、なめらかなヒストグラムが生成される。生成したヒストグラムを表す情報は、適宜、RAM103に記憶される。   When the CPU 101 completes the process of step S201, the CPU 101 applies a moving average to the generated histogram (step S202). By such moving average processing, noise components on the histogram are removed, and a smooth histogram is generated. Information representing the generated histogram is stored in the RAM 103 as appropriate.

図12に、グレースケール画像の輝度値のヒストグラムを示す。グレースケール画像は、コロニー250が発生した培養層230(培地)と基材シート210(台紙)とを表す画像である。従って、図12に示すように、培養層230を表す輝度値の画素の度数と、基材シート210を表す輝度値の画素の度数とが大きくなる。つまり、グレースケール画像の輝度値のヒストグラムは、培地を表す画素の輝度値と、台紙を表す画素の輝度値とに、大きなピークを有する。なお、カラー画像に台紙が含まれていない場合、台紙を表す画素の輝度値にピークが生じない。一方、カラー画像に罫線が含まれている場合、罫線を表す画素の輝度値にピークが発生する。   FIG. 12 shows a histogram of luminance values of a grayscale image. The gray scale image is an image representing the culture layer 230 (medium) in which the colony 250 is generated and the base sheet 210 (mounting paper). Therefore, as shown in FIG. 12, the frequency of the pixel of the luminance value representing the culture layer 230 and the frequency of the pixel of the luminance value representing the base sheet 210 are increased. That is, the luminance value histogram of the gray scale image has a large peak in the luminance value of the pixel representing the culture medium and the luminance value of the pixel representing the mount. Note that when the mount is not included in the color image, no peak occurs in the luminance value of the pixel representing the mount. On the other hand, when a ruled line is included in the color image, a peak occurs in the luminance value of the pixel representing the ruled line.

ここで、コロニー250は、培養層230や基材シート210に比べ、暗い色である。従って、コロニー250を表す画素の輝度値は、培養層230を表す画素の輝度値や基材シート210を表す画素の輝度値よりも低くなる。なお、コロニー250の色は均一ではないため、コロニー250を表す画素の輝度値にはある程度の幅が存在する。同様に、培養層230を表す画素の輝度値や、培養層230を表す画素の輝度値にもある程度の幅が存在する。   Here, the colony 250 has a darker color than the culture layer 230 and the substrate sheet 210. Therefore, the luminance value of the pixel representing the colony 250 is lower than the luminance value of the pixel representing the culture layer 230 and the luminance value of the pixel representing the base sheet 210. In addition, since the color of the colony 250 is not uniform, the luminance value of the pixel representing the colony 250 has a certain width. Similarly, the luminance value of the pixel representing the culture layer 230 and the luminance value of the pixel representing the culture layer 230 also have a certain range.

本実施形態では、二値化のための閾値範囲の最小値を示す下限値を、コロニー250を表す画素の輝度値の最小値とする。つまり、輝度値の0から昇べきの順に度数をチェックし、度数が初めて0でなくなる輝度値を、下限値に設定する。   In the present embodiment, the lower limit value indicating the minimum value of the threshold range for binarization is set as the minimum value of the luminance value of the pixel representing the colony 250. That is, the frequencies are checked in order of increasing brightness value from 0, and the brightness value at which the frequency is not 0 for the first time is set as the lower limit value.

まず、CPU101は、ステップS202の処理が完了すると、注目輝度値を0に設定する(ステップS203)。具体的には、CPU101は、注目輝度値を表す変数をRAM103に設け、この注目輝度値を表す変数の値を0に初期化する。   First, when the process of step S202 is completed, the CPU 101 sets the target luminance value to 0 (step S203). Specifically, the CPU 101 provides a variable representing the noticed luminance value in the RAM 103 and initializes the value of the variable representing the noticed luminance value to 0.

CPU101は、ステップS203の処理が完了すると、注目輝度値の度数が0か否かを判別する(ステップS204)。なお、CPU101は、注目輝度値の度数は、上述したヒストグラムを表すデータを参照することにより確認することができる。   When the process of step S203 is completed, the CPU 101 determines whether or not the frequency of the target luminance value is 0 (step S204). Note that the CPU 101 can confirm the frequency of the target luminance value by referring to the data representing the histogram described above.

CPU101は、注目輝度値の度数が0であると判別すると(ステップS204:YES)、注目輝度値をインクリメントする(ステップS205)。例えば、CPU101は、RAM103に記憶されている注目輝度値を表す変数に、現在の値よりも1つ大きな値を書き込む。このように、インクリメント量は、典型的には1であるが、1に限定されない。CPU101は、ステップS205の処理を完了すると、ステップS204に処理を戻す。   When the CPU 101 determines that the frequency of the target luminance value is 0 (step S204: YES), the CPU 101 increments the target luminance value (step S205). For example, the CPU 101 writes a value that is one greater than the current value in a variable representing the target luminance value stored in the RAM 103. Thus, the increment amount is typically 1, but is not limited to 1. When the CPU 101 completes the process of step S205, the process returns to step S204.

一方、CPU101は、注目輝度値の度数が0でないと判別すると(ステップS204:NO)、注目輝度値を下限値に設定する(ステップS206)。具体的には、CPU101は、下限値を表す変数をRAM103上に設け、この変数に注目輝度値を示す変数の値を代入する。   On the other hand, if the CPU 101 determines that the frequency of the target luminance value is not 0 (step S204: NO), the CPU 101 sets the target luminance value to the lower limit value (step S206). Specifically, the CPU 101 provides a variable indicating the lower limit value on the RAM 103, and substitutes the variable value indicating the luminance value of interest into this variable.

また、本実施形態では、二値化のための閾値範囲の最大値を示す上限値を、培地を表す画素の輝度値のうち度数が最多の輝度値(以下「ピーク輝度値」という。)よりも低い輝度値であって、ピーク輝度値の度数の所定割合以下の最大の輝度値とする。つまり、ピーク輝度値から降べきの順に度数をチェックし、度数が初めてピーク輝度値の度数の処理割合以下になる輝度値を、上限値に設定する。   In the present embodiment, the upper limit value indicating the maximum value of the threshold range for binarization is determined from the luminance value having the highest frequency among the luminance values of the pixels representing the culture medium (hereinafter referred to as “peak luminance value”). Is the lowest luminance value, and the maximum luminance value is equal to or less than a predetermined ratio of the frequency of the peak luminance value. That is, the frequencies are checked in order of descending power from the peak luminance value, and the luminance value that becomes the first processing frequency or less of the frequency of the peak luminance value is set as the upper limit value.

まず、CPU101は、ステップS206の処理を完了すると、ヒストグラムにおける最大の山状領域を特定する(ステップS207)。この最大の山状領域は、培地を表す画素の輝度値により構成される。この理由は、グレースケール画像上において、培地を表す輝度範囲の画素が最も多いためである。なお、グレースケール画像上において、培地を表す画素の数(培地の面積)が台紙を表す画素の数(台紙の面積)よりも多い場合、台紙を表す画素の輝度値により構成される山状領域よりも、培地を表す画素の輝度値により構成される山状領域の方が大きくなる。最大の山状領域を検出する方法は任意である。   First, when the CPU 101 completes the process of step S206, the CPU 101 specifies the maximum mountain area in the histogram (step S207). This maximum mountain region is configured by the luminance value of the pixel representing the culture medium. This is because the number of pixels in the luminance range representing the culture medium is the largest on the grayscale image. If the number of pixels representing the medium (medium area) is larger than the number of pixels representing the mount (mounting area) on the grayscale image, a mountain region constituted by the luminance values of the pixels representing the mount Rather, the mountain-shaped region constituted by the luminance values of the pixels representing the culture medium becomes larger. A method for detecting the maximum mountain region is arbitrary.

例えば、注目輝度値を0から昇べきの順に走査しながら、注目輝度値の度数および注目輝度値の近傍の所定個数の輝度値の合計度数を比較し、合計度数が最大となる注目輝度値を、暫定的に、最大の山状領域の中心の輝度値に決定することができる。なお、中心の輝度値における合計度数に対する割合が、所定割合以上の輝度値の範囲を、山状領域に決定することができる。   For example, while scanning the target luminance value in order of increasing from 0, the frequency of the target luminance value and the total frequency of a predetermined number of luminance values in the vicinity of the target luminance value are compared, and the target luminance value having the maximum total frequency is compared. Temporarily, the luminance value at the center of the maximum mountain region can be determined. It should be noted that a range of luminance values in which the ratio of the central luminance value with respect to the total frequency is a predetermined ratio or more can be determined as a mountain region.

なお、ヒストグラム上において、培地を表す画素の度数のピークよりも、台紙を表す画素の度数のピークの方が高くなることがある。しかしながら、グレースケール画像上において、培地を表す輝度範囲の画素が最も多い場合、ヒストグラムに移動平均を強くかけることにより、培地を表す画素の度数のピークよりも、台紙を表す画素の度数のピークを低くすることができる。従って、ヒストグラムに適切に移動平均をかけることにより、培地を表す画素の度数のピーク、もしくは、培地を表す画素の輝度値により構成される山状領域を容易に発見することができる。   On the histogram, the frequency peak of the pixel representing the mount may be higher than the frequency peak of the pixel representing the culture medium. However, on the grayscale image, when the number of pixels in the luminance range representing the culture medium is the largest, by applying a strong moving average to the histogram, the frequency peak of the pixel representing the mount is made higher than the frequency peak of the pixel representing the culture medium. Can be lowered. Therefore, by appropriately applying a moving average to the histogram, it is possible to easily find a mountain-shaped region constituted by the peak of the frequency of the pixel representing the culture medium or the luminance value of the pixel representing the culture medium.

CPU101は、ステップS207の処理を完了すると、最大の山状領域における最大度数の輝度値を特定する(ステップS208)。つまり、CPU101は、最大の山状領域を構成する輝度範囲の中から最大度数の輝度値を特定する。この最大度数の輝度値を示す変数は、RAM103などに記憶される。なお、図12において最大の山状領域における最大度数をNmaxで示している。また、上限値における度数は、Nmax×20%の度数である。   When the CPU 101 completes the process of step S207, it specifies the luminance value of the maximum frequency in the maximum mountain area (step S208). That is, the CPU 101 specifies the luminance value of the maximum frequency from the luminance range that forms the maximum mountain area. A variable indicating the luminance value of the maximum frequency is stored in the RAM 103 or the like. In FIG. 12, the maximum frequency in the maximum mountain region is indicated by Nmax. The frequency at the upper limit is a frequency of Nmax × 20%.

CPU101は、ステップS208の処理を完了すると、注目輝度値を最大度数の輝度値に設定する(ステップS209)。つまり、CPU101は、RAM103に記憶されている注目輝度値を示す変数の値を、最大度数の輝度値に初期化する。   When completing the process of step S208, the CPU 101 sets the luminance value of interest to the luminance value of the maximum frequency (step S209). That is, the CPU 101 initializes the value of the variable indicating the target luminance value stored in the RAM 103 to the luminance value of the maximum frequency.

CPU101は、ステップS209の処理を完了すると、注目輝度値の度数が最大度数の所定割合以下であるか否かを判別する(ステップS210)。所定割合は、例えば、20%とすることができるが、20%に限定されない。   When completing the process in step S209, the CPU 101 determines whether or not the frequency of the target luminance value is equal to or less than a predetermined ratio of the maximum frequency (step S210). The predetermined ratio can be, for example, 20%, but is not limited to 20%.

CPU101は、注目輝度値の度数が最大度数の所定割合以下でないと判別すると(ステップS210:NO)、注目輝度値をデクリメントする(ステップS211)。つまり、CPU101は、RAM103に記憶されている注目輝度値を示す変数に、現在の値よりも1小さい値を代入する。なお、デクリメントする値は、典型的には1であるが、1に限定されない。CPU101は、ステップS211の処理を完了すると、ステップS210に処理を戻す。   If the CPU 101 determines that the frequency of the target luminance value is not equal to or less than the predetermined ratio of the maximum frequency (step S210: NO), the CPU 101 decrements the target luminance value (step S211). That is, the CPU 101 substitutes a value smaller than the current value by one for the variable indicating the target luminance value stored in the RAM 103. The value to be decremented is typically 1, but is not limited to 1. When completing the process in step S211, the CPU 101 returns the process to step S210.

一方、CPU101は、注目輝度値の度数が最大度数の所定割合以下であると判別すると(ステップS210:YES)、注目輝度値を上限値に設定する(ステップS212)。具体的には、CPU101は、上限値を表す変数をRAM103上に設け、この変数に注目輝度値を示す変数の値を代入する。CPU101は、ステップS212の処理を完了すると、閾値範囲決定処理を完了する。   On the other hand, when the CPU 101 determines that the frequency of the target luminance value is equal to or less than the predetermined ratio of the maximum frequency (step S210: YES), the CPU 101 sets the target luminance value to the upper limit value (step S212). Specifically, the CPU 101 provides a variable indicating the upper limit value on the RAM 103, and substitutes the variable value indicating the target luminance value into this variable. When completing the process in step S212, the CPU 101 completes the threshold range determination process.

CPU101は、ステップS105の閾値範囲決定処理を完了すると、色相バンドパスフィルタリング処理を実行する(ステップS106)。色相バンドパスフィルタリング処理については、図13を参照して詳細に説明する。図13は、コロニー計数装置100が実行する色相バンドパスフィルタリング処理を示すフローチャートである。   CPU101 will perform a hue band pass filtering process, if the threshold range determination process of step S105 is completed (step S106). The hue bandpass filtering process will be described in detail with reference to FIG. FIG. 13 is a flowchart showing the hue bandpass filtering process executed by the colony counting apparatus 100.

まず、CPU101は、カラー画像の色相のヒストグラムを生成する(ステップS301)。具体的には、CPU101は、カラー画像を構成する各画素について、R(赤)の輝度値とG(緑)の輝度値とB(青)の輝度値との割合により、この画素の色相を決定する。色相は、赤→橙→黄→緑→青→藍→紫→赤により表され、0〜360度により表される。図14に、カラー画像の色相のヒストグラムを示す。   First, the CPU 101 generates a hue histogram of a color image (step S301). Specifically, the CPU 101 determines the hue of each pixel constituting the color image based on the ratio of the R (red) luminance value, the G (green) luminance value, and the B (blue) luminance value. decide. The hue is represented by red → orange → yellow → green → blue → indigo → purple → red, and 0 to 360 degrees. FIG. 14 shows a hue histogram of a color image.

図14に示すように、ヒストグラム上には、培地を表す画素の色相により構成される山状領域と、コロニー250を表す画素の色相により構成される山状領域と、がみられる。本実施形態では、ヒストグラム上から培地を表す画素の色相により構成される山状領域を除外し、除外後のヒストグラム上にみられる、コロニー250を表す画素の色相により構成される山状領域を、有効な色相範囲に設定する。つまり、有効な色相範囲以外の色相範囲の画素は無効にされる。   As shown in FIG. 14, on the histogram, a mountain-shaped area constituted by the hue of the pixel representing the culture medium and a mountain-shaped area constituted by the hue of the pixel representing the colony 250 are seen. In the present embodiment, the mountain-shaped region constituted by the hue of the pixel representing the culture medium is excluded from the histogram, and the mountain-shaped region constituted by the hue of the pixel representing the colony 250, which is seen on the histogram after the exclusion, Set to a valid hue range. That is, pixels in a hue range other than the effective hue range are invalidated.

このような色相バンドパスフィルタリング処理により、培地の持つざらつきや罫線がコロニー250として誤認識されにくくなる。   Such hue bandpass filtering processing makes it difficult for the texture and ruled lines of the culture medium to be erroneously recognized as colonies 250.

まず、CPU101は、カラー画像の色相のヒストグラムを生成する(ステップS301)。具体的には、CPU101は、カラー画像を構成する各画素について、3原色の輝度値の割合に基づいて、色相を決定する。そして、CPU101は、色相毎に、この色相の画素の数を集計し、この色相の度数を求める。   First, the CPU 101 generates a hue histogram of a color image (step S301). Specifically, the CPU 101 determines the hue for each pixel constituting the color image based on the ratio of the luminance values of the three primary colors. Then, the CPU 101 totals the number of pixels of this hue for each hue and obtains the frequency of this hue.

CPU101は、ステップS301の処理を完了すると、ヒストグラムにおける最大の山状領域を特定する(ステップS302)。CPU101は、ステップS207と同様に、ヒストグラムにおける最大の山状領域を求めることができる。   When the CPU 101 completes the process of step S301, the CPU 101 identifies the maximum mountain area in the histogram (step S302). As in step S207, the CPU 101 can obtain the maximum mountain area in the histogram.

CPU101は、ステップS302の処理を完了すると、最大の山状領域の除外後の山状領域を、コロニー250の色相範囲として特定する(ステップS303)。CPU101は、ステップS302と同様の処理により、最大の山状領域の除外後のヒストグラムにおける山状領域を求めることができる。CPU101は、特定した色相範囲を示す情報を、RAM103に記憶する。   When the CPU 101 completes the process of step S302, the CPU 101 identifies the mountain area after the removal of the largest mountain area as the hue range of the colony 250 (step S303). The CPU 101 can obtain a mountain region in the histogram after the removal of the largest mountain region by the same process as in step S302. The CPU 101 stores information indicating the specified hue range in the RAM 103.

CPU101は、ステップS303の処理を完了すると、グレースケール画像を構成する画素のうち、コロニー250の色相範囲外の色相を表す画素に、輝度値の最大値を設定する(ステップS304)。ここで、輝度値の最大値は、例えば、グレースケール画像が256階調である場合、輝度値の最大値は255(白)である。かかる処理によれば、グレースケール画像を二値化する際の閾値がどのような値に設定されても、輝度値の最大値が設定された画素は、二値化画像において1(白)に設定される。CPU101は、ステップS304の処理を完了すると、色相バンドパスフィルタリング処理を完了する。   When the CPU 101 completes the process of step S303, the CPU 101 sets the maximum luminance value to the pixels representing the hue outside the hue range of the colony 250 among the pixels constituting the grayscale image (step S304). Here, the maximum value of the luminance value is, for example, 255 (white) when the grayscale image has 256 gradations. According to such processing, regardless of the threshold value for binarizing the grayscale image, the pixel for which the maximum luminance value has been set is set to 1 (white) in the binarized image. Is set. When completing the process in step S304, the CPU 101 completes the hue bandpass filtering process.

CPU101は、ステップS106の色相バンドパスフィルタリング処理を完了すると、連結成分カウント処理を実行する(ステップS107)。連結成分カウント処理については、図15を参照して詳細に説明する。図15は、コロニー計数装置100が実行する連結成分カウント処理を示すフローチャートである。   When the CPU 101 completes the hue bandpass filtering process in step S106, the CPU 101 executes a connected component count process (step S107). The connected component counting process will be described in detail with reference to FIG. FIG. 15 is a flowchart showing a connected component counting process executed by the colony counting apparatus 100.

まず、CPU101は、連結成分情報を初期化する(ステップS401)。連結成分情報は、記憶装置104などに記憶され、配列変数として管理される。連結成分情報は、例えば、検出された連結成分毎に、連結成分の位置および大きさ、連結成分に割り当てられたラベル番号などにより示される。記憶装置104内に連結成分情報が存在しない場合、CPU101は、連結成分情報を初期化しなくてもよい。   First, the CPU 101 initializes connected component information (step S401). The connected component information is stored in the storage device 104 and managed as an array variable. The connected component information is indicated by, for example, the position and size of the connected component, the label number assigned to the connected component, and the like for each detected connected component. When the connected component information does not exist in the storage device 104, the CPU 101 does not have to initialize the connected component information.

本実施形態では、連結成分は、図5にC01、C02、C03として示すように、不定形であるものとして扱われる。例えば、1つの連結成分は、この連結成分を構成する各画素の座標の配列と、ラベル番号と、を含む構造体型の変数(以下「構造体変数」という。)により表すことができる。そして、連結成分情報は、例えば、検出された連結成分の個数分の構造体変数の配列により管理される。   In the present embodiment, the connected component is treated as being indefinite as shown as C01, C02, and C03 in FIG. For example, one connected component can be represented by a structure type variable (hereinafter referred to as “structure variable”) including an array of coordinates of each pixel constituting the connected component and a label number. The connected component information is managed by, for example, an array of structure variables corresponding to the number of detected connected components.

CPU101は、ステップS401の処理を完了すると、閾値に下限値を設定する(ステップS402)。この閾値は、グレースケール画像を二値化画像に変換する際に用いられる閾値である。下限値は、この閾値の下限値であり、ステップS206において設定される。例えば、CPU101は、RAM103に設けられた閾値を示す変数に、RAM103に設けられた下限値を示す変数の値を代入する。   CPU101 will set a lower limit to a threshold value, if the process of step S401 is completed (step S402). This threshold is a threshold used when converting a grayscale image into a binarized image. The lower limit value is a lower limit value of the threshold value, and is set in step S206. For example, the CPU 101 substitutes the value of the variable indicating the lower limit value provided in the RAM 103 into the variable indicating the threshold value provided in the RAM 103.

CPU101は、ステップS402の処理を完了すると、グレースケール画像を設定した閾値で二値化する(ステップS403)。CPU101は、生成した二値化画像を表す情報を、RAM103に記憶する。   When completing the process in step S402, the CPU 101 binarizes the grayscale image with the set threshold (step S403). The CPU 101 stores information representing the generated binarized image in the RAM 103.

CPU101は、ステップS403の処理を完了すると、二値化画像に対してラベリング処理を実行する(ステップS404)。ラベリング処理は、図4〜図6を用いて説明した処理である。なお、ラベリング処理により、0個以上の連結成分が検出される。検出された連結成分には、ユニークなラベル番号が付けられる。また、連結成分は、上述した構造体変数により管理される。連結成分を示す情報は、適宜、RAM103などに記憶される。   When completing the process in step S403, the CPU 101 executes a labeling process on the binarized image (step S404). The labeling process is the process described with reference to FIGS. Note that zero or more connected components are detected by the labeling process. The detected connected component is given a unique label number. The connected component is managed by the structure variable described above. Information indicating the connected component is appropriately stored in the RAM 103 or the like.

CPU101は、ステップS404の処理を完了すると、未選択の連結成分があるか否かを判別する(ステップS405)。具体的には、CPU101は、ステップS404のラベリング処理により検出された連結成分のうち、ステップS406において選択されていない連結成分があるか否かを、連結成分に対応付けられるフラグなどを参照して判別することができる。なお、ステップS406においてラベル番号が小さいものから順に連結成分が選択される場合、ラベル番号が最大の連結成分がステップS406において選択されたか否かにより、未選択の連結成分があるか否かを判別することができる。   When completing the process in step S404, the CPU 101 determines whether there is an unselected connected component (step S405). Specifically, the CPU 101 determines whether there is a connected component that has not been selected in step S406 among the connected components detected by the labeling process in step S404, with reference to a flag associated with the connected component, or the like. Can be determined. When connected components are selected in order from the smallest label number in step S406, it is determined whether there is an unselected connected component depending on whether the connected component with the largest label number is selected in step S406. can do.

CPU101は、未選択の連結成分があると判別すると(ステップS405:YES)、連結成分を1つ選択する(ステップS406)。なお、CPU101は、ラベル番号の昇べきの順、もしくは、ラベル番号の降べきの順に、連結成分を選択することができる。この場合、CPU101は、例えば、最後に選択した連結成分のラベル番号を示す変数をRAM103に記憶する。   When determining that there is an unselected connected component (step S405: YES), the CPU 101 selects one connected component (step S406). Note that the CPU 101 can select the connected components in the order of increasing label numbers or in descending order of label numbers. In this case, for example, the CPU 101 stores a variable indicating the label number of the last selected connected component in the RAM 103.

CPU101は、ステップS406の処理を完了すると、選択した連結成分が既検出の連結成分を包含しているか否かを判別する(ステップS407)。具体的には、CPU101は、現在よりも低い閾値による二値化により生成された二値化画像のラベリング処理により検出された連結成分のうち、連結成分を構成する全画素のそれぞれが、選択した連結成分を構成する全画素のうちのいずれかと一致する連結成分があるか否かを判別する。なお、過去に検出された連結成分を示す連結成分情報は、例えば、記憶装置104に記憶される。   When completing the process in step S406, the CPU 101 determines whether or not the selected connected component includes the detected connected component (step S407). Specifically, the CPU 101 selects each of all the pixels constituting the connected component from among the connected components detected by the labeling process of the binarized image generated by the binarization using the threshold value lower than the current value. It is determined whether or not there is a connected component that matches any of all the pixels constituting the connected component. In addition, the connected component information which shows the connected component detected in the past is memorize | stored in the memory | storage device 104, for example.

CPU101は、既検出の連結成分を包含していると判別すると(ステップS407:YES)、ステップS405に処理を戻す。一方、CPU101は、既検出の連結成分を包含していないと判別すると(ステップS407:NO)、連結成分をラベリング結果に追加する(ステップS408)。具体的には、CPU101は、記憶装置104に記憶されている連結成分情報の配列の末尾に、選択された連結成分を示す情報を追加する。あるいは、CPU101は、連結成分情報が、選択された連結成分を示す情報をさらに含むように、連結成分情報を更新する。   If the CPU 101 determines that the detected connected component is included (step S407: YES), the CPU 101 returns the process to step S405. On the other hand, when the CPU 101 determines that the detected connected component is not included (step S407: NO), the CPU 101 adds the connected component to the labeling result (step S408). Specifically, the CPU 101 adds information indicating the selected connected component to the end of the array of connected component information stored in the storage device 104. Alternatively, the CPU 101 updates the connected component information so that the connected component information further includes information indicating the selected connected component.

CPU101は、ステップS408の処理を完了すると、ラベル番号を振り直す(ステップS409)。つまり、CPU101は、既に検出済みの全ての連結成分と、今回新たに追加される1つの連結成分と、にユニークなラベル番号を与える。ラベル番号の付与の方法は、適宜、調整することができる。例えば、CPU101は、連結成分の配置順、もしくは、検出された順に、昇べきの順(降べきの順)にラベル番号を付与することができる。CPU101は、ステップS409の処理を完了すると、ステップS405に処理を戻す。   When the CPU 101 completes the process of step S408, it reassigns the label number (step S409). That is, the CPU 101 gives unique label numbers to all the connected components that have already been detected and one connected component that is newly added this time. The method for assigning the label number can be adjusted as appropriate. For example, the CPU 101 can assign label numbers in the ascending order (descending order) in the order in which the connected components are arranged or detected. When the CPU 101 completes the process of step S409, the process returns to step S405.

一方、CPU101は、未選択の連結成分がないと判別すると(ステップS405:NO)、閾値をインクリメントする(ステップS410)。なお、未選択の連結成分がないと判別されることは、現在の閾値によって二値化された二値化画像から検出された連結成分のうち、追加すべき全ての連結成分が追加されたことを意味する。   On the other hand, when determining that there is no unselected connected component (step S405: NO), the CPU 101 increments the threshold (step S410). Note that it is determined that there is no unselected connected component that all the connected components to be added among the connected components detected from the binarized image binarized by the current threshold are added. Means.

閾値のインクリメント量は、適宜、調整することができる。例えば、インクリメント量は、1にすることもできるし、その他のあらかじめ定められた整数値にすることもできる。もしくは、例えば、インクリメント量は、閾値の下限値と閾値の上限値との差を所定の整数で除算したときの商にしてもよい。CPU101は、RAM103に記憶されている閾値を示す変数に、インクリメント後の閾値を示す値を代入する。   The increment amount of the threshold can be adjusted as appropriate. For example, the increment amount can be 1 or other predetermined integer value. Alternatively, for example, the increment amount may be a quotient obtained by dividing the difference between the lower limit value of the threshold and the upper limit value of the threshold by a predetermined integer. The CPU 101 substitutes a value indicating the incremented threshold value into a variable indicating the threshold value stored in the RAM 103.

CPU101は、ステップS410の処理を完了すると、閾値が上限値を超えているか否かを判別する(ステップS411)。つまり、CPU101は、ステップS410におけるインクリメント後の閾値が、ステップS212において設定された上限値を超えているか否かを、RAM103に記憶されている閾値を示す変数と上限値を示す変数とを比較することにより判別する。   When completing the process in step S410, the CPU 101 determines whether or not the threshold value exceeds the upper limit value (step S411). That is, the CPU 101 compares the threshold value stored in the RAM 103 with the variable indicating the upper limit value to determine whether or not the incremented threshold value in step S410 exceeds the upper limit value set in step S212. To determine.

CPU101は、閾値が上限値を超えていないと判別すると(ステップS411:NO)、ステップS403に処理を戻す。一方、CPU101は、閾値が上限値を超えていると判別すると(ステップS411:YES)、ラベリング結果を保存する(ステップS412)。なお、CPU101は、記憶装置104に記憶されている連結成分情報に基づいて、ラベリング結果を求め、ラベリング結果を示す情報を記憶装置104などに記憶することができる。CPU101は、ステップS412の処理を完了すると、連結成分カウント処理を完了する。   If the CPU 101 determines that the threshold value does not exceed the upper limit value (step S411: NO), it returns the process to step S403. On the other hand, if the CPU 101 determines that the threshold value exceeds the upper limit value (step S411: YES), it saves the labeling result (step S412). The CPU 101 can obtain a labeling result based on the connected component information stored in the storage device 104, and can store information indicating the labeling result in the storage device 104 or the like. When completing the process in step S412, the CPU 101 completes the connected component count process.

ここで、図16〜図18を参照して、連結成分カウント処理により、連結成分が追加されていく様子について説明する。   Here, with reference to FIGS. 16 to 18, a state in which connected components are added by the connected component counting process will be described.

図16(A)は、グレースケール画像を示す図である。このグレースケール画像は、C31で示す不定形で囲まれたコロニー250と、C32で示す矩形で囲まれたコロニー250と、C33で示す矩形で囲まれたコロニー250と、の3つのコロニー250が撮像されたことを示している。ここで、C31で示す不定形で囲まれたコロニー250が濃い色を有し、C32で示す矩形で囲まれたコロニー250が普通の濃さの色を有し、C33で示す矩形で囲まれたコロニー250が薄い色を有しているものとする。   FIG. 16A shows a grayscale image. This grayscale image is captured by three colonies 250, a colony 250 surrounded by an indefinite shape indicated by C31, a colony 250 surrounded by a rectangle indicated by C32, and a colony 250 surrounded by a rectangle indicated by C33. It has been shown. Here, the colony 250 surrounded by the irregular shape indicated by C31 has a dark color, and the colony 250 surrounded by the rectangle indicated by C32 has a normal dark color, and is surrounded by the rectangle indicated by C33. Assume that the colony 250 has a light color.

図16(B)は、閾値を最低値に設定してグレースケール画像を二値化することにより得られる二値化画像をラベリングしたときに検出される連結成分を示す図である。ここで、閾値を最低値に設定したときの二値化では、濃い色を示す輝度値の画素のみが0(黒)とされ、他の濃さの色を示す輝度値の画素は1(白)とされるものとする。この場合、図16(B)に示すように、C41の矩形により囲まれた濃い色を有するコロニー250のみが連結成分として検出される。   FIG. 16B is a diagram illustrating connected components detected when a binarized image obtained by binarizing a grayscale image with the threshold set to the lowest value is labeled. Here, in the binarization when the threshold value is set to the lowest value, only pixels having luminance values indicating dark colors are set to 0 (black), and pixels having luminance values indicating other dark colors are set to 1 (white). ). In this case, as shown in FIG. 16B, only the colony 250 having a dark color surrounded by the rectangle of C41 is detected as a connected component.

図17(A)は、閾値を最低値から1単位増加させた閾値に設定してグレースケール画像を二値化することにより得られる二値化画像をラベリングしたときに検出される連結成分を示す図である。ここで、閾値を最低値から1単位増加させた閾値に設定したときの二値化では、濃い色を示す輝度値の画素と普通の濃さの色を示す輝度値の画素とが0(黒)とされ、薄い色を示す輝度値の画素は1(白)とされるものとする。この場合、図17(A)に示すように、C42の不定形により囲まれた濃い色を有するコロニー250と、C43の矩形により囲まれた普通の濃さの色を有するコロニー250と、が連結成分として検出される。ただし、C42の不定形により示される連結成分は、既に検出されたC41の矩形により示される連結成分を包含しているため、新たに検出された連結成分として連結成分情報に追加されない。これに対し、C43の矩形により示される連結成分は、既に検出された連結成分を1つも包含していないため、新たに検出された連結成分として連結成分情報に追加される。   FIG. 17A shows connected components detected when a binarized image obtained by binarizing a grayscale image by setting the threshold to a threshold increased by one unit from the lowest value is labeled. FIG. Here, in the binarization when the threshold value is set to a threshold value that is increased by one unit from the lowest value, the pixel of the luminance value indicating the dark color and the pixel of the luminance value indicating the normal dark color are 0 (black). ) And a pixel having a luminance value indicating a light color is 1 (white). In this case, as shown in FIG. 17A, a colony 250 having a dark color surrounded by an indefinite shape of C42 and a colony 250 having a normal dark color surrounded by a rectangle of C43 are connected. Detected as a component. However, since the connected component indicated by the C42 indefinite shape includes the connected component indicated by the already detected C41 rectangle, it is not added to the connected component information as a newly detected connected component. On the other hand, since the connected component indicated by the rectangle of C43 does not include any already detected connected component, it is added to the connected component information as a newly detected connected component.

図17(B)は、1単位増加後の閾値を設定してグレースケール画像を二値化することにより得られる二値化画像をラベリングしたときに検出される連結成分を示す図である。ここで、1単位増加後の閾値を設定したときの二値化では、濃い色を示す輝度値の画素と普通の濃さの色を示す輝度値の画素とが0(黒)とされ、薄い色を示す輝度値の画素は1(白)とされる。この場合、図17(B)に示すように、C51の不定形により囲まれた濃い色を有するコロニー250と、C52の矩形により囲まれた普通の濃さの色を有するコロニー250と、が連結成分として検出される。   FIG. 17B is a diagram illustrating connected components detected when a binarized image obtained by binarizing a grayscale image by setting a threshold value after an increment of 1 unit is labeled. Here, in the binarization when the threshold value after incrementing by one unit is set, the luminance value pixel indicating the dark color and the luminance value pixel indicating the normal dark color are set to 0 (black) and light. A pixel having a luminance value indicating a color is 1 (white). In this case, as shown in FIG. 17B, a colony 250 having a dark color surrounded by an indefinite shape of C51 and a colony 250 having a normal dark color surrounded by a rectangle of C52 are connected. Detected as a component.

図18(A)は、閾値をさらに1単位増加させた閾値に設定してグレースケール画像を二値化することにより得られる二値化画像をラベリングしたときに検出される連結成分を示す図である。ここで、閾値をさらに1単位増加させた閾値に設定したときの二値化では、濃い色を示す輝度値の画素と普通の濃さの色を示す輝度値の画素と薄い色を示す輝度値の画素とが0(黒)とされるものとする。この場合、図18(A)に示すように、C44の不定形により囲まれた、濃い色を有するコロニー250と普通の濃さの色を有するコロニー250とが連結したものと、C45の矩形により囲まれた普通の濃さの色を有するコロニー250と、が連結成分として検出される。ただし、C44の不定形により示される連結成分は、既に検出されたC41の矩形により示される連結成分とC43の矩形により示される連結成分とを包含しているため、新たに検出された連結成分として連結成分情報に追加されない。これに対し、C45の矩形により示される連結成分は、既に検出された連結成分を1つも包含していないため、新たに検出された連結成分として連結成分情報に追加される。   FIG. 18A is a diagram showing connected components detected when a binarized image obtained by binarizing a grayscale image by setting the threshold to a threshold value further increased by 1 unit is labeled. is there. Here, in the binarization when the threshold value is set to a threshold value further increased by one unit, a luminance value pixel indicating a dark color, a luminance value pixel indicating a normal color, and a light value indicating a light color. It is assumed that these pixels are 0 (black). In this case, as shown in FIG. 18A, a combination of a colony 250 having a dark color and a colony 250 having a normal dark color surrounded by an indefinite shape of C44 and a rectangle of C45 The enclosed colony 250 having a normal dark color is detected as a connected component. However, the connected component indicated by the indefinite shape of C44 includes the connected component indicated by the rectangle of C41 that has already been detected and the connected component indicated by the rectangle of C43. Not added to connected component information. On the other hand, since the connected component indicated by the rectangle of C45 does not include any already detected connected component, it is added to the connected component information as a newly detected connected component.

図18(B)は、2単位増加後の閾値を設定してグレースケール画像を二値化することにより得られる二値化画像をラベリングしたときに検出される連結成分を示す図である。ここで、2単位増加後の閾値を設定したときの二値化では、濃い色を示す輝度値の画素と普通の濃さの色を示す輝度値の画素と薄い色を示す輝度値の画素とが0(黒)とされる。この場合、図18(B)に示すように、C61の不定形により囲まれた、濃い色を有するコロニー250と普通の濃さの色を有するコロニー250とが連結したものと、C62の矩形により囲まれた薄い色を有するコロニー250と、が連結成分として検出される。   FIG. 18B is a diagram illustrating connected components detected when a binarized image obtained by binarizing a grayscale image by setting a threshold after an increase of 2 units is labeled. Here, in the binarization when the threshold value after an increase of 2 units is set, a pixel with a luminance value indicating a dark color, a pixel with a luminance value indicating a normal color, and a pixel with a luminance value indicating a light color, Is set to 0 (black). In this case, as shown in FIG. 18B, a combination of a colony 250 having a dark color and a colony 250 having a normal dark color surrounded by an indefinite shape of C61 and a rectangle of C62 A surrounded colony 250 having a light color is detected as a connected component.

図16(B)、図17(A)、図18(A)に示したように、本実施形態における連結成分カウント処理により、閾値を1単位ずつ増加させながら連結成分を蓄積する場合、C41の矩形により示される連結成分と、C43の矩形により示される連結成分と、C45の矩形により示される連結成分と、の3つの連結成分が適切に検出される。つまり、この場合、色の濃さの異なる3つのコロニー250を適切に検出することができる。   As shown in FIG. 16B, FIG. 17A, and FIG. 18A, when the connected component is accumulated while increasing the threshold value by one unit by the connected component counting process in this embodiment, Three connected components, a connected component indicated by a rectangle, a connected component indicated by a rectangle C43, and a connected component indicated by a rectangle C45, are appropriately detected. That is, in this case, the three colonies 250 having different color densities can be detected appropriately.

一方、図16(B)、図17(B)、図18(B)に示したように、閾値を1回だけ設定して連結成分を抽出しようとすると、閾値をどのように設定したとしても、色の濃さの異なる3つのコロニー250を適切に検出することができない。   On the other hand, as shown in FIGS. 16 (B), 17 (B), and 18 (B), if a threshold is set only once and a connected component is extracted, no matter how the threshold is set. The three colonies 250 having different color densities cannot be detected properly.

CPU101は、ステップS107の連結成分カウント処理を完了すると、カウント結果表示処理を実行する(ステップS108)。具体的には、CPU101は、記憶装置104に記憶されている連結成分情報などに基づいて、各連結成分の位置、大きさ、形状、ならびに、連結成分の個数を、カラー画像とともに画面内に表示する。   When the CPU 101 completes the connected component counting process in step S107, the CPU 101 executes a count result display process (step S108). Specifically, based on the connected component information stored in the storage device 104, the CPU 101 displays the position, size, shape, and number of connected components on the screen together with the color image. To do.

図19は、カウント結果表示処理により提示される画面を示す図である。画面300には、カラー画像の一部を示す背景画像310に重ねて、検出された連結成分の個数を示す個数画像320と、検出された連結成分の位置、大きさ、形状などを示す検出位置マーク330が表示される。なお、図19は、検出された不定形の連結成分が、矩形の連結成分に近似されて検出位置マーク330として表示されている例を示す。また、図19では、カラー画像の一部が拡大されて背景画像310として画面300に表示されている例を示しているが、カラー画像の全体が背景画像310として画面300に表示されてもよい。このように、画面300は、検出された連結成分に対応するコロニー250のカラー画像上における位置や形状をわかりやすく作業者に提示することができる。なお、作業者は、適宜、入力装置105などを操作して、カラー画像を拡大、縮小、スクロールすることにより、提示された連結成分を自由に観察することができる。   FIG. 19 is a diagram showing a screen presented by the count result display process. On the screen 300, a number image 320 indicating the number of detected connected components is superimposed on a background image 310 indicating a part of the color image, and a detected position indicating the position, size, shape, etc. of the detected connected components. A mark 330 is displayed. FIG. 19 shows an example in which the detected irregular connected component is approximated to a rectangular connected component and displayed as a detection position mark 330. FIG. 19 shows an example in which a part of the color image is enlarged and displayed as the background image 310 on the screen 300, but the entire color image may be displayed as the background image 310 on the screen 300. . As described above, the screen 300 can easily present the position and shape of the colony 250 on the color image corresponding to the detected connected component to the operator. The operator can appropriately observe the presented connected component by appropriately operating the input device 105 or the like to enlarge, reduce, or scroll the color image.

なお、コロニー計数装置100は、検出された連結成分に関する情報を、画面300に表示するのみならず、記憶装置104などに記憶してもよいし、通信装置106を介して、ネットワークに接続された装置などに送信してもよい。   Note that the colony counting apparatus 100 may not only display information on the detected connected components on the screen 300 but also store the information in the storage device 104 or the like, or may be connected to the network via the communication device 106. You may transmit to an apparatus etc.

CPU101は、ステップS108の処理を完了すると、コロニー計数処理を完了する。   When completing the process of step S108, the CPU 101 completes the colony counting process.

本実施形態によれば、色の濃さにばらつきがあるコロニー250の個数を適切にカウントすることができる。なお、グレースケール画像上において、色が濃いコロニー250の周りは、コロニー250から離れるほど色が薄くなることが予想される。従って、二値化の輝度値を徐々に高くしていくと、低い閾値による検出処理により既に検出された連結成分は、高い閾値による検出処理で再度検出されることになる。しかしながら、本実施形態によれば、高い閾値による検出処理で新たに検出された連結成分が、低い閾値による検出処理で既に検出された連結成分を包含する場合、新たに検出された連結成分は、新たに検出されたものとみなされない。このため、ラベリング処理を複数の閾値で実行しても、連結成分が重複してカウントされにくくすることができる。従って、連結成分により示されるコロニー250の個数を正確にカウントすることが可能となる。   According to the present embodiment, it is possible to appropriately count the number of colonies 250 having variations in color density. In addition, on the gray scale image, it is expected that the color around the dark colony 250 becomes lighter as the distance from the colony 250 increases. Therefore, when the binarized luminance value is gradually increased, the connected component already detected by the detection process using the low threshold is detected again by the detection process using the high threshold. However, according to the present embodiment, when the connected component newly detected by the detection process with the high threshold includes the connected component already detected by the detection process with the low threshold, the newly detected connected component is It is not considered newly detected. For this reason, even if the labeling process is executed with a plurality of threshold values, the connected components can be made difficult to be counted repeatedly. Therefore, the number of colonies 250 indicated by the connected component can be accurately counted.

(変形例)
本発明は、上記実施形態に開示したものに限られない。
(Modification)
The present invention is not limited to the one disclosed in the above embodiment.

例えば、閾値の下限値と閾値の上限値とを決定する手法は、上記実施形態において開示した手法に限られない。例えば、グレースケール画像に基づく種々の手法により、閾値の下限値と閾値の上限値とを適宜決定することができる。また、例えば、コロニー250を表す画素の輝度値の範囲があらかじめ予測可能な場合、閾値の範囲があらかじめ定められていてもよい。   For example, the method for determining the lower limit value of the threshold and the upper limit value of the threshold is not limited to the method disclosed in the above embodiment. For example, the lower limit value of the threshold value and the upper limit value of the threshold value can be appropriately determined by various methods based on the gray scale image. For example, when the range of the luminance value of the pixel representing the colony 250 can be predicted in advance, the threshold range may be determined in advance.

また、色相バンドパスフィルタリング処理の手法も、上記実施形態において開示した手法に限られない。例えば、カラー画像に基づく種々の手法により、グレースケール画像に色相バンドパスフィルタリング処理を施すことができる。また、色相バンドパスフィルタリング処理はなくてもよい。   Further, the method of the hue bandpass filtering process is not limited to the method disclosed in the above embodiment. For example, the hue band pass filtering process can be performed on the grayscale image by various methods based on the color image. Further, the hue band pass filtering process may not be performed.

また、ガウシアンフィルタリング処理の手法も、上記実施形態において開示した手法に限られない。種々の手法により、グレースケール画像にガウシアンフィルタリング処理を施すことができる。また、ガウシアンフィルタリング処理はなくてもよい。さらに、ガウシアンフィルタリング処理の代わりに、移動平均フィルタ処理などが実行されてもよい。また、ガウシアンフィルタリング処理が実行されるタイミングは、上記実施形態の例に限定されない。例えば、ガウシアンフィルタリング処理が色相バンドパスフィルタリング処理の後に実行されてもよい。   Further, the Gaussian filtering processing technique is not limited to the technique disclosed in the above embodiment. A Gaussian filtering process can be applied to the grayscale image by various methods. Further, there is no need for Gaussian filtering processing. Further, a moving average filter process or the like may be executed instead of the Gaussian filtering process. Further, the timing at which the Gaussian filtering process is executed is not limited to the example of the above embodiment. For example, the Gaussian filtering process may be executed after the hue bandpass filtering process.

また、本発明に適用される培地は、上記実施形態において開示したものに限定されない。例えば、台紙がないタイプのフィルム培地を採用することができる。図20は、基材シート211の全面が培地(培養層)となっており、基材シート211の全面に、微生物のコロニー250が発生している様子を示している。また、基材シート211には、培地に関する識別情報220が記載されている。さらに、基材シート211(培地)には、縦方向および横方向に、一定の間隔で罫線260が引かれている。   Moreover, the culture medium applied to this invention is not limited to what was disclosed in the said embodiment. For example, a film medium of a type without a mount can be employed. FIG. 20 shows a state in which the entire surface of the base sheet 211 is a culture medium (culture layer), and microbial colonies 250 are generated on the entire surface of the base sheet 211. In addition, the base sheet 211 has identification information 220 regarding the culture medium. Furthermore, ruled lines 260 are drawn at regular intervals in the vertical direction and the horizontal direction on the base material sheet 211 (medium).

この場合、例えば、基材シート211の一部の領域である領域240を撮像することにより、カラー画像が取得される。カラー画像には、基材シート211(培地)、コロニー250、罫線260などが表現される。この場合、基材シート211(培地)の色と、コロニー250の色と、罫線260の色とは、RGBの各色の輝度値は互いに異なる。従って、色相フィルタリング処理や二値化処理により、コロニー250を基材シート211(培地)や罫線260と区別することができる。   In this case, for example, a color image is acquired by imaging a region 240 that is a partial region of the base sheet 211. In the color image, a base sheet 211 (medium), a colony 250, a ruled line 260, and the like are expressed. In this case, the luminance value of each color of RGB is different from the color of the base sheet 211 (medium), the color of the colony 250, and the color of the ruled line 260. Therefore, the colony 250 can be distinguished from the base material sheet 211 (medium) and the ruled line 260 by hue filtering processing and binarization processing.

第1の実施形態では、コロニー計数装置100がCPU101とROM102とRAM103とを備え、CPU101が、ROM102に記憶されているプログラムに従って、ソフトウェアによりコロニー計数処理が実現される例を示した。しかし、コロニー計数装置100が実行するコロニー計数処理は、ソフトウェアにより実現されるものに限定されない。例えば、コロニー計数装置100は、マイクロコンピュータ、FPGA(Field Programmable Gate Array)、PLD(Programmable Logic Device)、DSP(Digital Signal Processor)などにより構成されてもよい。   In the first embodiment, the colony counting device 100 includes the CPU 101, the ROM 102, and the RAM 103, and the CPU 101 shows an example in which the colony counting process is realized by software in accordance with the program stored in the ROM 102. However, the colony counting process executed by the colony counting apparatus 100 is not limited to that realized by software. For example, the colony counting apparatus 100 may be configured by a microcomputer, an FPGA (Field Programmable Gate Array), a PLD (Programmable Logic Device), a DSP (Digital Signal Processor), or the like.

なお、本発明に係るコロニー計数装置は、専用のシステムによらず、通常のコンピュータシステムを用いても実現可能である。例えば、コンピュータに、上記動作を実行するためのプログラムを、フレキシブルディスク、CD−ROM(Compact Disk-Read Only Memory)、DVD(Digital Versatile Disk)、MO(Magnet Optical Disk)などのコンピュータ読み取り可能な記録媒体に記憶して配布し、これをコンピュータシステムにインストールすることにより、上述の処理を実行するコロニー計数装置を構成しても良い。さらに、インターネット上のサーバ装置が有するディスク装置等にプログラムを記憶しておき、例えば、搬送波に重畳させて、コンピュータにダウンロード等するものとしてもよい。   Note that the colony counting apparatus according to the present invention can be realized by using a normal computer system without using a dedicated system. For example, a computer readable recording such as a flexible disk, a CD-ROM (Compact Disk-Read Only Memory), a DVD (Digital Versatile Disk), or a MO (Magnet Optical Disk) is stored in a computer. You may comprise the colony counting device which performs the above-mentioned process by memorize | storing and distributing to a medium and installing this in a computer system. Furthermore, the program may be stored in a disk device or the like included in a server device on the Internet, and may be downloaded onto a computer by being superimposed on a carrier wave, for example.

11 グレースケール画像取得部
12 二値化画像生成部
13 連結成分抽出部
14 連結成分情報追加部
15 閾値供給部
16 コロニー計数部
17 閾値範囲部
18 カラー画像取得部
19 色相範囲特定部
20 グレースケール画像生成部
30 記憶部
100 コロニー計数装置
101 CPU
102 ROM
103 RAM
104 記憶装置
105 入力装置
106 通信装置
107 撮像制御部
108 撮像装置
109 画像記憶部
110 表示制御部
111 表示装置
112 音声処理部
113 音声出力装置
120 バス
200 専用シート
210、211 基材シート
220 識別情報
230 培養層
240 領域
250 コロニー
260 罫線
300 画面
310 背景画像
320 個数画像
330 検出位置マーク
DESCRIPTION OF SYMBOLS 11 Gray scale image acquisition part 12 Binary image generation part 13 Connected component extraction part 14 Connected component information addition part 15 Threshold supply part 16 Colony counting part 17 Threshold range part 18 Color image acquisition part 19 Hue range identification part 20 Gray scale image Generation unit 30 Storage unit 100 Colony counting device 101 CPU
102 ROM
103 RAM
104 Storage device 105 Input device 106 Communication device 107 Imaging control unit 108 Imaging device 109 Image storage unit 110 Display control unit 111 Display device 112 Audio processing unit 113 Audio output device 120 Bus 200 Dedicated sheet 210, 211 Base sheet 220 Identification information 230 Culture layer 240 Region 250 Colony 260 Ruled line 300 Screen 310 Background image 320 Number image 330 Detection position mark

Claims (9)

検体に含まれる微生物の培養後の培地の様子を示すグレースケール画像を取得するグレースケール画像取得手段と、
閾値が供給される毎に、前記グレースケール画像取得手段により取得されたグレースケール画像を前記閾値により二値化することにより二値化画像を生成する二値化画像生成手段と、
前記二値化画像生成手段により前記二値化画像が生成される毎に、前記二値化画像にラベリング処理を実行することにより前記二値化画像から1つのコロニーを示す画素のまとまりである連結成分を抽出する連結成分抽出手段と、
前記連結成分抽出手段により前記連結成分が抽出される毎に、前記連結成分のうち記憶装置に記憶済みの連結成分情報により示される連結成分を包含しない連結成分を示す連結成分情報を、前記記憶装置にさらに記憶させる連結成分情報追加手段と、
前記閾値が下限値から上限値に至るまでの間、前記連結成分情報追加手段の処理が完了する毎に、前記閾値を所定値ずつ増加させて前記二値化画像生成手段に供給する閾値供給手段と、
前記記憶装置に記憶されている連結成分情報に基づいて、前記微生物のコロニーの個数を計数するコロニー計数手段と、を備える、
ことを特徴とするコロニー計数装置。
A grayscale image acquisition means for acquiring a grayscale image showing the state of the culture medium after culturing the microorganisms contained in the specimen;
Binarized image generating means for generating a binarized image by binarizing the grayscale image acquired by the grayscale image acquiring means by the threshold value every time a threshold is supplied;
Each time the binarized image is generated by the binarized image generating means, a labeling process is performed on the binarized image, thereby connecting a group of pixels indicating one colony from the binarized image. Connected component extraction means for extracting the components;
Each time the connected component is extracted by the connected component extraction means, the storage device stores connected component information indicating a connected component that does not include the connected component indicated by the connected component information stored in the storage device. Connected component information adding means for further storing
Threshold supply means for increasing the threshold value by a predetermined value and supplying it to the binarized image generating means each time processing of the connected component information adding means is completed until the threshold value reaches the upper limit value. When,
Colony counting means for counting the number of colonies of the microorganism based on the connected component information stored in the storage device,
A colony counting device characterized by that.
前記グレースケール画像を構成する画素の輝度値の分布に基づいて、前記下限値と前記上限値とを決定する閾値範囲決定手段、をさらに備える、
ことを特徴とする請求項1に記載のコロニー計数装置。
Threshold range determining means for determining the lower limit value and the upper limit value based on a distribution of luminance values of pixels constituting the gray scale image,
The colony counting device according to claim 1, wherein:
前記閾値範囲決定手段は、前記グレースケール画像を構成する画素の輝度値毎の度数を表す輝度ヒストグラムに含まれる最大の山状の度数分布の輝度範囲の中で度数が最多である輝度値を特定し、特定した輝度値よりも低く、かつ、前記特定した輝度値の度数に対して所定の割合以下の度数である輝度値のうち、最高の輝度値を前記上限値に決定する、
ことを特徴とする請求項2に記載のコロニー計数装置。
The threshold range determination means identifies a luminance value having the highest frequency in the luminance range of the maximum mountain-shaped frequency distribution included in the luminance histogram representing the frequency for each luminance value of the pixels constituting the grayscale image. The highest luminance value is determined as the upper limit value among luminance values that are lower than the specified luminance value and that are less than a predetermined ratio with respect to the frequency of the specified luminance value.
The colony counting device according to claim 2, wherein
前記閾値範囲決定手段は、前記グレースケール画像を構成する画素の輝度値の最小の輝度値を特定し、特定した輝度値を前記下限値に決定する、
ことを特徴とする請求項2または3に記載のコロニー計数装置。
The threshold range determining means specifies the minimum luminance value of the luminance values of the pixels constituting the grayscale image, and determines the specified luminance value as the lower limit value;
The colony counting device according to claim 2 or 3, wherein
前記培地を撮像して得られたカラー画像を取得するカラー画像取得手段と、
前記カラー画像取得手段により取得されたカラー画像を構成する画素の色相の分布に基づいて、前記コロニーの色相範囲を特定する色相範囲特定手段と、
前記カラー画像取得手段により取得されたカラー画像をグレースケール化した画像を構成する画素のうち、前記色相範囲特定手段により特定された前記色相範囲に含まれない画素の輝度値を、前記上限値よりも高い輝度値に設定することにより取得されるグレースケール画像を、前記グレースケール画像取得手段に取得させるグレースケール画像として生成するグレースケール画像生成手段と、をさらに備える、
ことを特徴とする請求項1乃至4のいずれか1項に記載のコロニー計数装置。
Color image acquisition means for acquiring a color image obtained by imaging the culture medium;
A hue range specifying means for specifying a hue range of the colony based on a hue distribution of pixels constituting the color image acquired by the color image acquiring means;
Among the pixels constituting the image obtained by converting the color image acquired by the color image acquisition unit into a gray scale, the luminance value of the pixel not included in the hue range specified by the hue range specifying unit is determined from the upper limit value. Grayscale image generation means for generating a grayscale image acquired by setting a higher brightness value as a grayscale image to be acquired by the grayscale image acquisition means,
The colony counting apparatus according to any one of claims 1 to 4, wherein the colony counting apparatus is characterized in that
前記色相範囲特定手段は、前記カラー画像を構成する画素の色相毎の度数を表す色相ヒストグラムから最大の山状の度数分布の色相範囲を除外したのちに存在する山状の度数分布の色相範囲を前記コロニーの色相範囲として特定する、
ことを特徴とする請求項5に記載のコロニー計数装置。
The hue range specifying means obtains a hue range of a mountain-shaped frequency distribution that exists after excluding the hue range of the maximum mountain-shaped frequency distribution from a hue histogram representing the frequency for each hue of pixels constituting the color image. Specify as the hue range of the colony,
The colony counting device according to claim 5, wherein
前記培地を撮像して得られたカラー画像を取得するカラー画像取得手段と、
前記カラー画像取得手段により取得されたカラー画像をグレースケール化した画像にガウシアンフィルタをかけることに得られるグレースケール画像を、前記グレースケール画像取得手段に取得させるグレースケール画像として生成するグレースケール画像生成手段、をさらに備える、
ことを特徴とする請求項1乃至6のいずれか1項に記載のコロニー計数装置。
Color image acquisition means for acquiring a color image obtained by imaging the culture medium;
Grayscale image generation for generating a grayscale image obtained by applying a Gaussian filter to a grayscale image obtained by converting the color image acquired by the color image acquisition unit to the grayscale image acquisition unit Means further comprising:
The colony counting device according to any one of claims 1 to 6, wherein
検体に含まれる微生物の培養後の培地の様子を示すグレースケール画像を取得するグレースケール画像取得ステップと、
閾値が供給される毎に、前記グレースケール画像取得ステップにより取得されたグレースケール画像を前記閾値により二値化することにより二値化画像を生成する二値化画像生成ステップと、
前記二値化画像生成ステップにより前記二値化画像が生成される毎に、前記二値化画像にラベリング処理を実行することにより前記二値化画像から1つのコロニーを示す画素のまとまりである連結成分を抽出する連結成分抽出ステップと、
前記連結成分抽出ステップにより前記連結成分が抽出される毎に、前記連結成分のうち記憶装置に記憶済みの連結成分情報により示される連結成分を包含しない連結成分を示す連結成分情報を、前記記憶装置にさらに記憶させる連結成分情報追加ステップと、
前記閾値が下限値から上限値に至るまでの間、前記連結成分情報追加ステップの処理が完了する毎に、前記閾値を所定値ずつ増加させて前記二値化画像生成ステップを実行させる閾値供給ステップと、
前記記憶装置に記憶されている連結成分情報に基づいて、前記微生物のコロニーの個数を計数するコロニー計数ステップと、を備える、
ことを特徴とするコロニー計数方法。
A grayscale image acquisition step of acquiring a grayscale image showing the state of the culture medium after culturing the microorganisms contained in the specimen;
A binarized image generating step of generating a binarized image by binarizing the grayscale image acquired by the grayscale image acquiring step by the threshold value every time a threshold is supplied;
Each time the binarized image is generated by the binarized image generating step, a labeling process is performed on the binarized image, thereby connecting a group of pixels indicating one colony from the binarized image. A connected component extraction step for extracting components;
Each time the connected component is extracted by the connected component extracting step, connected storage information indicating connected components that do not include the connected components indicated by the connected component information stored in the storage device among the connected components is stored in the storage device. Connected component information adding step to be further stored in
A threshold supply step of increasing the threshold value by a predetermined value and executing the binarized image generation step each time the processing of the connected component information adding step is completed until the threshold value reaches the upper limit value. When,
A colony counting step for counting the number of colonies of the microorganism based on the connected component information stored in the storage device,
The colony counting method characterized by this.
コンピュータを、
検体に含まれる微生物の培養後の培地の様子を示すグレースケール画像を取得するグレースケール画像取得手段、
閾値が供給される毎に、前記グレースケール画像取得手段により取得されたグレースケール画像を前記閾値により二値化することにより二値化画像を生成する二値化画像生成手段、
前記二値化画像生成手段により前記二値化画像が生成される毎に、前記二値化画像にラベリング処理を実行することにより前記二値化画像から1つのコロニーを示す画素のまとまりである連結成分を抽出する連結成分抽出手段、
前記連結成分抽出手段により前記連結成分が抽出される毎に、前記連結成分のうち記憶装置に記憶済みの連結成分情報により示される連結成分を包含しない連結成分を示す連結成分情報を、前記記憶装置にさらに記憶させる連結成分情報追加手段、
前記閾値が下限値から上限値に至るまでの間、前記連結成分情報追加手段の処理が完了する毎に、前記閾値を所定値ずつ増加させて前記二値化画像生成手段に供給する閾値供給手段、
前記記憶装置に記憶されている連結成分情報に基づいて、前記微生物のコロニーの個数を計数するコロニー計数手段、として機能させる、
ことを特徴とするプログラム。
Computer
A grayscale image acquisition means for acquiring a grayscale image showing the state of the culture medium after culturing the microorganisms contained in the specimen;
A binarized image generating unit that generates a binarized image by binarizing the grayscale image acquired by the grayscale image acquiring unit by the threshold every time a threshold is supplied;
Each time the binarized image is generated by the binarized image generating means, a labeling process is performed on the binarized image, thereby connecting a group of pixels indicating one colony from the binarized image. Connected component extraction means for extracting components;
Each time the connected component is extracted by the connected component extraction means, the storage device stores connected component information indicating a connected component that does not include the connected component indicated by the connected component information stored in the storage device. Connected component information adding means for further storing
Threshold supply means for increasing the threshold value by a predetermined value and supplying it to the binarized image generating means each time processing of the connected component information adding means is completed until the threshold value reaches the upper limit value. ,
Based on the connected component information stored in the storage device, function as colony counting means for counting the number of colonies of the microorganism,
A program characterized by that.
JP2012097782A 2012-04-23 2012-04-23 Colony counting device, colony counting method, and program Expired - Fee Related JP5449444B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012097782A JP5449444B2 (en) 2012-04-23 2012-04-23 Colony counting device, colony counting method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012097782A JP5449444B2 (en) 2012-04-23 2012-04-23 Colony counting device, colony counting method, and program

Publications (2)

Publication Number Publication Date
JP2013223463A JP2013223463A (en) 2013-10-31
JP5449444B2 true JP5449444B2 (en) 2014-03-19

Family

ID=49594039

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012097782A Expired - Fee Related JP5449444B2 (en) 2012-04-23 2012-04-23 Colony counting device, colony counting method, and program

Country Status (1)

Country Link
JP (1) JP5449444B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6355476B2 (en) * 2014-08-18 2018-07-11 株式会社Screenホールディングス Threshold determination method, image processing method, and image processing apparatus
JP6198918B1 (en) * 2016-09-29 2017-09-20 株式会社イノテック Particle number measuring apparatus, particle number measuring method, program, and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006325549A (en) * 2005-05-30 2006-12-07 Thk Co Ltd Method for bacteriological examination
JP5181385B2 (en) * 2007-08-16 2013-04-10 国立大学法人名古屋大学 Prediction model construction method for predicting cell quality, prediction model construction program, recording medium recording the program, and prediction model construction apparatus
CN102471744B (en) * 2009-07-21 2015-06-10 国立大学法人京都大学 Image processing device, culture observation apparatus, and image processing method
WO2011115218A1 (en) * 2010-03-17 2011-09-22 株式会社エルメックス Bacteriological testing method by means of film-type culture medium, and image capturing tool used for said bacteriological testing method
WO2012043498A1 (en) * 2010-09-30 2012-04-05 日本電気株式会社 Information processing device, information processing system, information processing method, program, and recording medium

Also Published As

Publication number Publication date
JP2013223463A (en) 2013-10-31

Similar Documents

Publication Publication Date Title
US11037292B2 (en) Cell image evaluation device and cell image evaluation control program
JP5043755B2 (en) Resin material inspection device and program
US20070195165A1 (en) Image display apparatus
CN105719274B (en) Edge inspection system and method
JP2007336563A (en) Method and system for specifying region of uniform color in digital image
US10139335B2 (en) Observation image determination device, method, and program
US20160161464A1 (en) Stem cell differentiation determination device, method, and program
EP2458555A2 (en) Image processing device, image processing method, and image processing program
US20170178322A1 (en) System and method for detecting anomalies in an image captured in-vivo
CN107103865B (en) Method and device for detecting display area in display screen
JP2019208377A (en) Colony detection device, colony detection method, and colony detection program
JP5449444B2 (en) Colony counting device, colony counting method, and program
JP4143660B2 (en) Image analysis method, image analysis apparatus, inspection apparatus, image analysis program, and computer-readable recording medium
JP2006024116A (en) Area division for color image
WO2019181072A1 (en) Image processing method, computer program, and recording medium
CN111317426A (en) Endoscope parameter self-adaptive adjusting method and device
JP6355476B2 (en) Threshold determination method, image processing method, and image processing apparatus
JP2004194610A (en) Method and apparatus for inspecting microbial colony
KR20180068150A (en) Classification system of dried sea cucumber using image analysis
JP6931418B2 (en) Image processing methods, image processing devices, user interface devices, image processing systems, servers, and image processing programs
JP2015231343A (en) Colony classification amending method, classification amending program, and classification amending apparatus
JP5917260B2 (en) Colony counting support method and program
JP2017220020A (en) Moving body detection system and moving body detection method
JP4544578B2 (en) Defect inspection method and defect inspection apparatus using computer
JP2018063588A (en) Color determination device, control method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130805

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20130805

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20130827

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130903

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20131028

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20131126

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131224

R150 Certificate of patent or registration of utility model

Ref document number: 5449444

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees