JP3653063B2 - Agricultural product quality judgment device and agricultural product quality judgment method - Google Patents

Agricultural product quality judgment device and agricultural product quality judgment method Download PDF

Info

Publication number
JP3653063B2
JP3653063B2 JP2002167243A JP2002167243A JP3653063B2 JP 3653063 B2 JP3653063 B2 JP 3653063B2 JP 2002167243 A JP2002167243 A JP 2002167243A JP 2002167243 A JP2002167243 A JP 2002167243A JP 3653063 B2 JP3653063 B2 JP 3653063B2
Authority
JP
Japan
Prior art keywords
image
points
skirt
mask image
quality
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
JP2002167243A
Other languages
Japanese (ja)
Other versions
JP2004008961A (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.)
Mitsubishi Heavy Industries Ltd
Original Assignee
Mitsubishi Heavy Industries 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 Mitsubishi Heavy Industries Ltd filed Critical Mitsubishi Heavy Industries Ltd
Priority to JP2002167243A priority Critical patent/JP3653063B2/en
Publication of JP2004008961A publication Critical patent/JP2004008961A/en
Application granted granted Critical
Publication of JP3653063B2 publication Critical patent/JP3653063B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Sorting Of Articles (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、取得した農作物の画像から農作物のマスク画像を作成し、このマスク画像に基づいて農産物の品質を判定する、農産物の品質判定装置及び農産物の品質判定方法に関する。
【0002】
【従来の技術】
自動で農産物の品質を判定し等級分けする自動品質判定装置が種々開発されている。自動品質判定装置では、先ず農産物が撮像され、取得された画像に基づき、この農産物の形状などから農産物の品質が判定される。
一般的に、品質判定装置では、農作物は、それぞれトレーに載せられた状態でコンベアなどにより搬送され、CCDカメラなどにより撮像される。このように農作物をトレーに載せるのは、農作物に傷が付いてしまうのを防止するためや、その後行なわれる作業(例えば箱詰め作業)において農作物のハンドリングを効率的に行なうためである。
【0003】
以下、農作物として茄子を取り上げ、従来の品質判定装置について説明する。
図14(a),(b)は、茄子の品質判定装置に使用される一般的なトレー2の構成を示す模式図である。このトレー2は、図14(a)に示すように、二つのフレーム2aと、これらのフレーム2a,2aに掛け渡されるようにして取り付けられた複数のピン2bとをそなえて構成されている。茄子1は、品質判定装置により品質を判定されるにあたりCCDカメラなどにより撮像されるが、この際に、様々な方向から茄子1を撮像できるように(特に下方からも撮像できるように)、トレー2は、間隔をあけて並べられたピン2b上に茄子1が載置される構成となっている。
【0004】
また、農産物の品質としては、例えばその形状に関するものがあるが、このような形状について判定するためには、撮像した画像から茄子だけを抽出することが重要となる。このような抽出方法としては、撮像した画像の各画素を特定の階調を境に二値化する画像処理を、CCDカメラにより取得した画像(以下、カメラ画像という)に施すことにより行なう方法がある。
【0005】
この方法では、一般的にピン2bの色には茄子1に近い色を使用する。これは、例えばピン2bを茄子1とは大きく異なる色にすると、下方から(ピン2bのある側から)の撮像により取得されたカメラ画像に対して二値化処理した場合には、この処理により得られた画像は、ピン2bにより茄子が分断されたような画像となってしまうためである。
【0006】
図6のカメラ画像20のようにピン2bの色に茄子に近い色を使用すると、このカメラ画像20に対して二値化処理して得られた画像21は、図7に示すような茄子とピンとが融合したような画像となる。そこで、今度は、このような画像21に対して収縮処理を所定回数施した後、膨張処理を所定回数施して、図8に示すようなピン2bの除去された画像22を得るようにしている。
【0007】
収縮処理及び膨張処理について図15(a)〜(c)を参照して説明する。なお、図15(a)〜(c)において、各升目はそれぞれ画素を表している。
収縮処理とは、『1』の画素(オンされた画素で図中に白で表示される画素)からなる像を一画素分だけ細くする処理である。例えば図15(a)に示すような画像に対し収縮処理を施せば図15(b)に示すような画像が得られる。膨張処理とは、収縮処理とは逆に、『1』の画素からなる像を一画素分だけ太くする処理である。例えば図15(b)に示すような画像に対し膨張処理を施せば図15(c)に示すような画像が得られる。このように収縮処理と膨張処理とを組み合わせれば、図15(a)の像41と図15(c)の像42とを見比べれば分かるように像41から細かなドット41aだけを除去することが可能となる。
【0008】
したがって、このような収縮処理と膨張処理とを組み合わせることにより上述したように図8に示す画像100からピンを示す細い線を除去できるのである。
【0009】
【発明が解決しようとする課題】
しかしながら、上述した従来技術のように収縮処理と膨張処理とを組み合わせても、図8に示すように、茄子とピンとが重なるような個所についてはピンを完全に除去できない(この個所は、実際にはマスク画像の一部として白で表示されるが、図8では便宜的に斜線を引いて示している)。このため、図8の画像に基づき計測された茄子の太さ(計測値)は、茄子の真の太さに対し、この分、誤差が生じてしまう。茄子の太さを正確に検出できなければ、例えば、その後に行なわれる箱詰めにおいて適切な数の茄子を箱詰めできなくなってしまう。
【0010】
また、図6に示すカメラ画像20を画素の階調に応じて二値化すると、茄子に色の薄い部分がある場合(ここでは、ヘタに色の薄い部分がある)には、この部分は、図8に示すように茄子ではない(茄子に欠けがある)と誤判定されてしまう(画素が『0』に設定され(オフされ)図8においては黒く表示されてしまう)。
本発明は、このような課題に鑑み創案されたもので、農作物の形状を精度良く検出し、この検出された農作物の形状に基づき農作物の品質を精度良く判定できるようにした、農産物の品質判定装置及び品質判定方法を提供することを目的とする。
【0011】
【課題を解決するための手段】
このため、本発明の農産物の品質判定装置(請求項1)は、農産物の画像を取得する画像取得手段と、該画像取得手段により取得した画像から該農作物のマスク画像を作成するマスク画像作成手段と、該マスク画像作成手段により作成されたマスク画像を補正するマスク画像補正手段と、該マスク画像補正手段により補正されたマスク画像に基づいて該農産物の品質を判定する品質判定手段とをそなえて構成され、該マスク画像補正手段が、該マスク画像作成手段により作成された該マスク画像から、該農作物を表す像の輪郭線を抽出する輪郭線抽出手段と、該輪郭線において、該輪郭線の所定の方向に向かって所定の角度よりも大きな角度で曲がる特徴点を検出する特徴点検出手段と、該輪郭線において、該特徴点の前後で角度が反転する点を二つ一組で該特徴点の裾点として検出する裾点検出手段と、相互に隣り合う特徴点に関する裾点の内で、外側に位置する二つの裾点を補間するようにして該輪郭線を補正する輪郭線補正手段とをそなえて構成されていることを特徴としている。
【0012】
この場合、該輪郭線補正手段が、上記の補間する二つの裾点の直線距離が、所定距離よりも短い場合には、上記の二つの裾点を直線で結んで補間する一方、上記の補間する二つの裾点の直線距離が、所定距離以上の場合には、該輪郭線の上記の二つの裾点における接線が相互に平行であれば上記の二つの裾点を直線で結んで補間し、該接線が相互に平行でなければ、上記の二つの裾点を多項式からなるスプライン関数で補間するよう構成されていることが好ましい。
【0013】
該農作物が、一対のフレーム部材及び上記の一対のフレーム部材に掛け渡されたピン状部材からなるトレーに載置された状態で農作物搬送手段により搬送される場合には、該マスク画像作成手段が、該画像取得手段により取得された画像を画素値に応じて二値化処理する二値化処理手段と、該二値化処理手段により二値化処理された画像に対し、収縮処理を施した後、膨張処理を施す、収縮膨張処理手段とをそなえて構成されていることが好ましい。
【0014】
また、本発明の農産物の品質判定方法(請求項4)は、農産物の画像を取得し、取得した画像から該農作物のマスク画像を作成し、該マスク画像に基づいて該農産物の品質を判定する、農産物の品質判定方法において、該マスク画像から、該農作物を表す像の輪郭線を抽出する第1ステップと、該輪郭線において、所定の方向に向かって所定の角度よりも大きな角度で曲がる特徴点を検出する第2ステップと、該輪郭線において、該特徴点の前後で角度が反転する点を二つ一組で該特徴点の裾点として検出する第3ステップと、相互に隣り合う特徴点に関する裾点の内で、外側に位置する二つの裾点を補間するようにして該輪郭線を補正する第4ステップとをそなえて構成されていることを特徴としている。
【0015】
この場合、第4ステップでは、上記の補間する二つの裾点の直線距離が、所定距離よりも短い場合には、上記の二つの裾点を直線で結んで補間する一方、上記の補間する二つの裾点の直線距離が、所定距離以上の場合には、該輪郭線の上記の二つの裾点における接線が相互に平行であれば上記の二つの裾点を直線で結んで補間し、該接線が相互に平行でなければ、上記の二つの裾点を多項式からなるスプライン関数で補間することが好ましい。
【0016】
該農作物を、一対のフレーム部材及び上記の一対のフレーム部材に掛け渡されたピン状部材からなるトレーに載置した状態で搬送するとともに、該搬送中の農作物の画像を取得する場合には、該第1ステップが、上記の農作物の画像を画素値に応じて二値化するステップと、該二値化画像に対し、収縮処理を施した後、膨張処理を施す、ステップとをそなえて構成されていることが好ましい。
【0017】
【発明の実施の形態】
以下、図面を参照して本発明の実施の形態について説明する。
図1〜図13は本発明の一実施形態としての農産物の品質判定装置及び農産物の品質判定方法について示す図であり、図1は品質判定装置の構成を示す模式図、図2(a),(b)はチェーンコードによる輪郭線の抽出を説明するための模式図、図3及び図4(a)〜(c)は品質判定方法を説明するための模式図、図5は品質判定方法を説明するための模式的なフローチャート、図6〜図13は品質判定方法にかかる画像処理を説明するための図である(図6〜図8は従来の品質判定方法を説明するのに用いた図と兼用である)。なお、従来技術として説明した部分については同一の符号を付し、その説明を省略する。
【0018】
本実施形態の農産物の品質判定装置10は、農産物として茄子の品質を判定するものであり、図1に示すように構成され、トレー2に載置されコンベア(農作物搬送手段)3により搬送される茄子1を、画像取得手段としてのCCDカメラ(又はTVカメラ)11により撮像し、このCCDカメラ11により取得された茄子1の画像(カメラ画像)に基づいて、この茄子1の品質を判定するものである。品質を判定された茄子1は、図示しない下流側において、その品質に応じて仕分けされることとなる。
【0019】
CCDカメラ11は、図1では簡略化してコンベア3よりも上方に1台示しているが、複数台設けられており、様々な角度からコンベア3上の茄子1が撮像されるようになっている。また、CCDカメラ11により撮像される範囲では、コンベア3上の茄子1に図示しない光源から光が照射されている。
品質判定装置10は、上記CCDカメラ11,マスク画像作成部(マスク画像作成手段)12,マスク画像補正部(マスク画像補正手段)13及び品質判定部(品質判定手段)14をそなえて構成されている。CCDカメラ11により取得されたカメラ画像に基づき、農作物(ここでは、茄子)1の形状を抽出したマスク画像がマスク画像作成部12により作成され、このマスク画像はマスク画像補正部13により補正されるようになっている。そして、この補正されたマスク画像に基づき、品質判定部14により茄子1の品質が判定されるようになっている。ここでいう茄子1の品質とは、その等級分けに使用されるもの全般であり、反りの度合いのような形状に関するものの他、太さ等の寸法をも含む。
【0020】
マスク画像作成部12は、二値化処理部(二値化処理手段)12aと収縮膨張処理部(収縮膨張処理手段)12bとをそなえて構成されている。二値化処理部12aは、カメラ画像の各画素について、その画素値(濃さ)が所定のしきい値よりも大きければ『1』(輝度を所定値)とする一方、その画素値が所定のしきい値以下であれば『0』(輝度をゼロ)とするような二値化処理を行なうもので、図6に示すようなカメラ画像20に対し二値化処理を行なうと、図7に示すような二値化画像21が得られることとなる。トレー2のピン2bの色は茄子1に近い色(ここでは黒)に設定されているため、この二値化画像21では、茄子1だけでなくピン2bも、『1』の画素からなる像(白色で示す像)として表示されることとなる。
【0021】
また、上記収縮膨張処理部12bは、二値化画像21に対し、収縮処理を所定回数行なった後、膨張処理を所定回数行なうようになっており、この結果、ピン2bを示す像(図7において水平方向に走る白い線)が除去され、茄子を形成する画素を『1』とするとともに背景(茄子以外の領域)を形成する画素を『0』とした図8に示すようなマスク画像22が得られることとなる。
【0022】
しかし、二値化処理では、本例のように茄子1に色の淡い部分(或いは機械によって付けられた白い傷や大きな虫食い穴)があると、この部分は、二値化画像21ひいてはマスク画像22において『0』とされてしまう。また、収縮膨張処理で除去されるのは、『1』の画素からなる塊の内、その塊を形成する画素の数や、塊が線状であればその幅寸法をなす画素の数が、収縮処理の回数により決まる所定の数以下のものである(例えば、幅が4画素以下の直線状の像は2回の収縮処理により除去できる)。このため、マスク画像22においては、茄子1とピン2bとが重なり始める部分(図8中に斜線を引いて示す部分)についてはピン2bが完全には除去されていない。
そこで、このマスク画像22は、上記マスク画像補正部13により補正されるようになっている。
【0023】
マスク画像補正部13は、図1に示すように、輪郭線抽出部(輪郭線抽出手段)13a,特徴点検出部(特徴点検出手段)13b,裾点検出部(裾点検出手段)13c及び輪郭線補正部(輪郭線補正手段)13dをそなえて構成されている。
【0024】
輪郭線抽出部13aは、マスク画像作成部11により作成されたマスク画像22からチェーンコードを生成し、このチェーンコードに基づいて、マスク画像22のマスク像(『1』の画素が集合してなる像)の輪郭線(=境界画素:『0』の画素と隣り合う画素)を抽出した図9に示すような境界画素画像23を作成するものである。
【0025】
チェーンコードとは二値化画像において曲線を表現するために使用されるものである。チェーンコードについて図2(a),(b)を参照して簡単に説明する。図2(a),図2(b)の升目は画素を示している。また、図2(b)では、便宜的に、『1』の画素を『○』で示し、『0』の画素をブランクで示している。
【0026】
チェーンコードでは、図2(a)中に8つの矢印で示すように、所定の画素30に対し、隣接する画素31〜38のそれぞれに0〜7のコードナンバが付され、例えば、画素30に対して画素32は、チェーンコードでは1と表現される。図2(b)に示す閉曲線(輪郭線)50を、画素51を始点として反時計回りでチェーンコードで表現すれば、『1,0,1,2,2,2,2,3,4,4,4,5,6,6,5,6,7,0,7』となる。
【0027】
特徴点検出部13bは、境界画素画像23の輪郭線において特徴点を抽出するものである。特徴点とは、所定の方向に(ここでは閉ループである輪郭線の内側に向かって)所定の角度よりも大きな角度で曲がる画素のことである。
図3を参照して特徴点検出部13bについて説明する。図3では便宜的に『1』の画素(輪郭線50をなす画素)を『☆』,『○』,『●』,『★』で示し、『0』の画素をブランクで示している。特徴点検出部13bは、特徴点であるか否かを、所定の画素を始点に(ここでは反時計回りに)一回りするようにして、輪郭線50を形成する画素について順次判定することにより、輪郭線50から特徴点を検出するようになっている。以下、特徴点を検出する方向を検出方向Aという。
【0028】
例えば『●』で示す画素53について特徴点であるか否かを判定する場合には、この判定は、この画素53の前後に腕L1,L2を伸ばし、これらの腕L1,L2の方向の変化量θに基づいて行なわれる。腕L1,L2は、判定対象の画素53と、輪郭線50をなす画素であってこの画素53から前後に所定の個数(ここでは3個、この所定の個数を腕の長さともいう)離れた画素52,54とをそれぞれ結んだ線分である。
【0029】
輪郭線50において、輪郭線50の内側に向く角度(ここでは検出方向Aが反時計回りなので検出方向Aに対し左側に傾く角度)を負、輪郭線50の外側に向く角度(ここでは検出方向Aが反時計回りなので検出方向Aに対し右側に傾く角度)を正とすると、特徴点検出部13bは、上記角度θが、負であり、且つ所定の角度θよりも大きな角度であれば、画素53を特徴点と判定するようになっている。
【0030】
上記の腕L1,L2の長さ及び所定の角度θは、輪郭線の検出対象(農作物)の種類などに応じて適宜設定されるものであるが、例えば農作物が茄子の場合には、腕の長さL1,L2を3、所定の角度θを50度(degree)にそれぞれ設定すると、輪郭線を精度良く抽出できることが判っている。
図9に示す画像23に対し特徴点検出部13bにより特徴点を検出すると、図10に示すような画像24が得られる。画像24においては特徴点は『○』で示されている。
【0031】
裾点検出部13cは、特徴点検出部13bにより検出された特徴点の前後に位置する裾点を検出するものであり、裾点とは、輪郭線の角度が正から負、又は負から正に反転する点(画素)である。そして、輪郭線補正部13cは、さらに、相互に隣接する特徴点の裾点の内、外方にある裾点を補間して輪郭線を補正するものである。
【0032】
このような輪郭線補正部13cの機能を、図4(a),(b),(c)によりさらに説明する。図4(a)〜(c)においては、便宜的に『1』の画素(輪郭線60をなす画素)を黒で示し、『0』の画素を白で示している。
図4(a)は、輪郭線24Aの一部が内側に大きく凹んでいる場合であり、この場合、図示するように、検出方向Aに対して左側に大きく曲がる画素a,bが特徴点として検出され、さらに、特徴点aの裾点として画素a,aが検出され、特徴点bの裾点として画素b,bが検出される。そして、これらの特徴点a,b及び裾点a,a,b,bが統合され、補完すべき画素を示すデータが生成される。つまり、4つの裾点a,a,b,bの内で外側の裾点a,bが、特徴点a,bに対し補間すべき画素として設定されるようになっている。4つの裾点の内の外側の裾点とは、輪郭線に沿った距離Yにおいて最も離隔した組み合わせとなる裾点をいう。
【0033】
そして、これらの裾点a,b輪郭線補正部13cにより補間され、この補間により形成された図4(a)中に二点差線で示す線分61が輪郭線60の一部を成すように輪郭線60が補正されることとなる。
図4(b)は、輪郭線62の一部に凸部が形成されている場合であり、この場合、図示するように、画素c,cが、特徴点a,bの共通の裾点となり、これらの裾点c,cが輪郭線補正部13cにより二点差線で示すような線分で補間され、輪郭線62が補正される。
【0034】
図4(c)は、図4(b)に対し、輪郭線の凸部が中央で僅かに凹んだ場合であり、図示するように特徴点a,b及びその裾点a,a,b,bが検出され、裾点a,bが輪郭線補正部13cにより二点差線で示すように補完され、輪郭線63が補正される。
輪郭線補正部13cによる2つの裾点の補間は、補完される裾点の直線距離Dが所定値Dよりも小さい場合には(D<D)、直線補間により行なわれるようになっている。一方、上記距離Dが上記所定値D以上である場合には(D≧D)、補完される裾点における輪郭線60,62,63の接線M,Mが平行であれば直線で補完され、上記接線M,Mが平行でなければ、3次スプライン式のような多項式からなるスプライン関数により補間されるようになっている。ここでいう、接線とは、補間される裾点の外側での輪郭線の接線をいう。
【0035】
図10に示す画像24に対し輪郭線補正部13cにより輪郭線の補正を行なうと、先ず、図11に示すような画像25が得られる。画像25においては裾点『△』で示されている。次いで、裾点を補間することにより、図12に示すような輪郭線が補正された画像26が得られる。
そして、マスク画像補正部13は、最終処理として、この画像26に穴埋め処理(『1』の画素に囲まれた閉領域にある画素を全て『1』にする処理)を施して、図13に示すようなマスク画像27を作成するようになっている。
【0036】
本発明の一実施形態としての農産物の品質判定装置は上述したように構成されており、図5のフローチャートに示すような手法(本発明の一実施形態としての農産物の品質判定方法)により品質判定が行なわれる
つまり、先ず、ステップA10で、CCDカメラ1の撮像により、トレー2に載置された状態でコンベア3により搬送される茄子1の画像20(図6参照)が取得される。そして、ステップA20で、このカメラ画像20は、マスク画像作成部12により、二値化処理及び収縮膨張処理され、この結果、図8に示すようなマスク画像22が得られる。カメラ画像20に示されるように茄子のヘタに色の薄い部分(画素値がしきい値以下の部分)があるため、マスク画像22では、この部分の画素が『0』とされ(茄子ではないとされ)、また、トレー2のピン2bの一部が、マスク画像22の外縁において略直角に折れ曲がった屈折部として取り残されている。
【0037】
そして、ステップA30で、輪郭線抽出部13aにより、このマスク画像23からチェーンコードが生成され、マスク画像23のマスク像の輪郭線を抽出した図9に示すような画像23が得られる。そして、この輪郭線に対し、ステップA40で特徴点検出部13bにより特徴点が検出され、特徴点を『○』で表示した図10に示すような画像24が得られる。さらに、ステップA50で裾点検出部13cにより特徴点に対応する裾点が検出され、裾点を『△』で表示した図10に示すような画像25が得られる。
【0038】
そして、輪郭線補正手段13dにより、ステップA60で、ステップA40で検出された特徴点及びステップA50で検出された裾点の統合が行なわれる。つまり、相互に隣接する特徴点に対応する4つ裾点の内、外側にある2つの裾点の組み合わせが、特徴点の各相互間において一組のデータセットとして生成されるのである。そして、ステップA70で、さらに輪郭線補正手段13dにより、上記データセットをなす2つの裾点が補間されて輪郭線が修正され、図12に示すような画像26が得られる。
【0039】
このように相互に隣接する特徴点の裾部を補間することにより、茄子の輪郭としては存在しないような大きな曲がり部(輪郭の接線方向に対して所定の角度よりも大きな角度で曲がる部分)を有する凸部や凹部が、凸部について除去されるようにして、凹部について塞がれるようにして修正される。この結果、上記マスク画像23において、色が薄いため凹みと誤判定された個所や、残存したピン2bの一部に対し補正が行なわれ、図12に示すように、精度良く茄子1の輪郭を再現した画像を得ることができる。
【0040】
この画像は最終的に穴埋め処理(『1』の画素に囲まれた閉領域にある画素を全て『1』にする処理)され、この結果、図13に示すように修正されたマスク画像27が得られ、ステップA80で、品質判定部14によりこのマスク画像に基づき茄子1の品質が判定される。品質の判定に使用されるマスク画像27は、上記補正により実際の茄子1の輪郭を精度良く再現したものなので、茄子1の品質を精度良く判定できる。
【0041】
なお、本発明の農産物の品質判定装置及び品質判定方法は、上述した実施形態に限定されず、本発明の趣旨を逸脱しない範囲で種々変形することが可能である。
例えば、上記実施形態では、農作物の画像を取得する画像取得手段を、CCDカメラ(撮像手段)により構成した例を説明したが、外部装置により撮像した画像をフロッピー(登録商標)ディスク等の記録媒体に一旦記録させた後、フロッピー(登録商標)ディスクドライブのような記録読み取り装置により、この記録媒体から画像を読み取るようにしても良い。この場合、上記記録読み取り装置をそなえて画像取得手段が構成されることとなる。
また、上記実施形態では、輪郭線において負の角度で(つまり輪郭線の内側に向かって)所定の角度以上で曲がる点を特徴点としたが、輪郭線において正の角度で(つまり輪郭線の外側に向かって)所定の角度以上で曲がる点を特徴点としても良い。
【0042】
また、上記実施形態では、農作物として茄子を扱った例を説明したが、本発明は、他の農産物に対しても適用しうるものである。
【0043】
【発明の効果】
以上詳述したように、本発明によれば、相互に隣り合う特徴点の裾点の内、外側の裾点の相互間を、例えば直線又はスプライン関数で補間することにより、上記の隣り合う特徴点を含んでなる輪郭線の大きな曲がり部が補正され、この結果、誤認識によりマスク画像に生じた実際の農作物には存在しないような極端に大きな曲がり部について補正が行なわれるようになり、農作物の形状を精度良く検出し、この検出された農作物の形状に基づき農作物の品質を精度良く判定できるようになる利点がある。
【0044】
特に、農作物をトレーに載置して搬送するとともに、この搬送中の農作物の画像を画素値に応じて二値化して二値化画像を作成し、さらに、この二値化画像に対し、収縮処理した後、膨張処理して、マスク画像を作成する場合には、農作物に色の薄い部分があるとこの部分が農作物でないと誤認識されたり、トレーのピン状部材を正確にマスク画像から除去できなかったりして、マスク画像の外縁に実際にはない凹凸部が生じる虞があるが、このような凹凸部を補正して正確に農作物の形状を検出できる。
【図面の簡単な説明】
【図1】本発明の一実施形態としての農産物の品質判定装置の構成を示す模式図である。
【図2】(a),(b)はチェーンコードによる輪郭線の抽出を説明するための模式図である。
【図3】本発明の一実施形態としての農産物の品質判定方法を説明するための模式図である。
【図4】(a)〜(c)は本発明の一実施形態としての農産物の品質判定方法を説明するための模式図である。
【図5】本発明の一実施形態としての農産物の品質判定方法について説明するための模式的なフローチャートである。
【図6】本発明の一実施形態の農産物の品質判定方法及び従来の農産物の品質判定方法にかかる画像処理を説明するための模式図である。
【図7】本発明の一実施形態の農産物の品質判定方法及び従来の農産物の品質判定方法にかかる画像処理を説明するための模式図である。
【図8】本発明の一実施形態の農産物の品質判定方法及び従来の農産物の品質判定方法にかかる画像処理を説明するための模式図である。
【図9】本発明の一実施形態の農産物の品質判定方法にかかる画像処理を説明するための模式図である。
【図10】本発明の一実施形態の農産物の品質判定方法にかかる画像処理を説明するための模式図である。
【図11】本発明の一実施形態の農産物の品質判定方法にかかる画像処理を説明するための模式図である。
【図12】本発明の一実施形態の農産物の品質判定方法にかかる画像処理を説明するための模式図である。
【図13】本発明の一実施形態の農産物の品質判定方法にかかる画像処理を説明するための模式図である。
【図14】農産物の搬送に使用される一般的なトレーの構成を示す図であり、(a)は模式的な平面図、(b)は(a)のx−x断面図である。
【図15】(a)〜(c)は従来の農産物の品質判定方法にかかる画像処理を説明するための模式図である。
【符号の説明】
1 茄子(農作物)
2 トレー
2a フレーム
2b ピン
3 コンベア(農作物搬送手段)
10 品質判定装置
11 CCDカメラ(画像取得手段)
12 マスク画像作成部(マスク画像作成手段)
12a 二値化処理部(二値化処理手段)
12b 収縮膨張処理部(収縮膨張処理手段)
13 マスク画像補正部(マスク画像補正手段)
13a 輪郭線抽出部(輪郭線抽出手段)
13b 特徴点検出部(特徴点検出手段)
13c 裾点検出部(裾点検出手段)
13d 輪郭線補正部(輪郭線補正手段)
14 品質判定部(品質判定手段)
20 カメラ画像
21 二値化画像
22,27 マスク画像
23〜26 境界画素画像
50,60 輪郭線
30〜37,51〜54 画素
,M 接線
θ 輪郭線の所定個所における角度
,b 特徴点
,b,c1,裾点
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an agricultural product quality determination apparatus and an agricultural product quality determination method, in which an agricultural product mask image is created from an acquired agricultural product image, and the quality of the agricultural product is determined based on the mask image.
[0002]
[Prior art]
Various automatic quality judgment devices that automatically judge and grade the quality of agricultural products have been developed. In the automatic quality determination device, first, an agricultural product is imaged, and the quality of the agricultural product is determined from the shape of the agricultural product based on the acquired image.
In general, in the quality determination apparatus, each crop is conveyed by a conveyor or the like while being placed on a tray, and is imaged by a CCD camera or the like. The reason why the crops are placed on the tray in this way is to prevent the crops from being damaged or to efficiently handle the crops in the subsequent work (for example, boxing work).
[0003]
In the following, a conventional quality judgment device will be described by taking coconut as an agricultural product.
FIGS. 14A and 14B are schematic views showing the configuration of a general tray 2 used in the insulator quality judgment apparatus. As shown in FIG. 14A, the tray 2 includes two frames 2a and a plurality of pins 2b attached so as to be spanned between the frames 2a and 2a. The insulator 1 is imaged by a CCD camera or the like when the quality is judged by the quality judging device. At this time, the insulator 1 can be imaged from various directions (particularly from below) so that the tray 1 can be imaged. 2 is configured such that the insulator 1 is placed on the pins 2b arranged at intervals.
[0004]
In addition, as the quality of agricultural products, for example, there is a thing related to the shape, but in order to determine such a shape, it is important to extract only the insulator from the captured image. As such an extraction method, there is a method in which image processing for binarizing each pixel of a captured image with a specific gradation as a boundary is performed on an image acquired by a CCD camera (hereinafter referred to as a camera image). is there.
[0005]
In this method, a color close to the insulator 1 is generally used as the color of the pin 2b. This is because, for example, if the pin 2b has a color significantly different from that of the insulator 1, the binarization process is performed on the camera image acquired from the lower side (from the side with the pin 2b). This is because the obtained image is an image in which the insulator is divided by the pin 2b.
[0006]
When a color close to the insulator is used for the color of the pin 2b as in the camera image 20 of FIG. 6, an image 21 obtained by binarizing the camera image 20 has an insulator as shown in FIG. The image looks like a fusion of pins. Therefore, this time, the image 21 is subjected to the contraction process a predetermined number of times and then subjected to the expansion process a predetermined number of times to obtain an image 22 from which the pins 2b are removed as shown in FIG. .
[0007]
The contraction process and the expansion process will be described with reference to FIGS. In FIGS. 15A to 15C, each cell represents a pixel.
The contraction process is a process for thinning an image composed of “1” pixels (pixels that are turned on and displayed in white in the drawing) by one pixel. For example, if a contraction process is performed on an image as shown in FIG. 15A, an image as shown in FIG. 15B is obtained. In contrast to the contraction process, the expansion process is a process that thickens an image composed of “1” pixels by one pixel. For example, if an expansion process is performed on an image as shown in FIG. 15B, an image as shown in FIG. 15C is obtained. If the shrinkage process and the expansion process are combined in this way, only the fine dots 41a are removed from the image 41 as can be seen by comparing the image 41 in FIG. 15A and the image 42 in FIG. 15C. It becomes possible.
[0008]
Therefore, by combining such a contraction process and an expansion process, the thin line indicating the pin can be removed from the image 100 shown in FIG. 8 as described above.
[0009]
[Problems to be solved by the invention]
However, even if the shrinkage process and the expansion process are combined as in the prior art described above, the pin cannot be completely removed at the place where the insulator and the pin overlap as shown in FIG. 8 (this place is actually Is displayed in white as a part of the mask image, but is hatched for convenience in FIG. 8). For this reason, the thickness (measurement value) of the insulator measured based on the image of FIG. 8 causes an error corresponding to the true thickness of the insulator. If the thickness of the insulator cannot be detected accurately, for example, an appropriate number of insulators cannot be boxed in the subsequent boxing.
[0010]
Further, when the camera image 20 shown in FIG. 6 is binarized according to the gradation of the pixel, if there is a light-colored portion in the insulator (here, there is a light-colored portion), this portion is As shown in FIG. 8, it is erroneously determined that it is not an insulator (the insulator is missing) (the pixel is set to “0” (turned off) and displayed black in FIG. 8).
The present invention was devised in view of such a problem, and is capable of accurately detecting the shape of a crop and determining the quality of the crop based on the detected shape of the crop with high accuracy. An object is to provide an apparatus and a quality determination method.
[0011]
[Means for Solving the Problems]
For this reason, the agricultural product quality determination apparatus according to the present invention (claim 1) includes an image acquisition unit that acquires an image of an agricultural product, and a mask image generation unit that generates a mask image of the crop from the image acquired by the image acquisition unit. And a mask image correcting means for correcting the mask image created by the mask image creating means, and a quality judging means for judging the quality of the produce based on the mask image corrected by the mask image correcting means. A contour line extracting unit configured to extract a contour line of an image representing the crop from the mask image created by the mask image creating unit; and A feature point detecting means for detecting a feature point that is bent at a larger angle than a predetermined angle toward a predetermined direction; and the angle is inverted before and after the feature point in the contour line Skirt point detecting means for detecting the skirt points of the feature points in pairs, and the contour by interpolating the two skirt points located outside the skirt points related to the feature points adjacent to each other. It is characterized by comprising contour line correcting means for correcting the line.
[0012]
In this case, when the straight line distance between the two skirt points to be interpolated is shorter than a predetermined distance, the contour correcting means performs interpolation by connecting the two skirt points with a straight line. If the tangent line at the two skirt points of the contour line is parallel to each other, the two skirt points are interpolated by connecting them with a straight line. If the tangents are not parallel to each other, it is preferable that the two skirt points are interpolated by a spline function made of a polynomial.
[0013]
When the crop is transported by the crop transport means in a state of being placed on a tray comprising a pair of frame members and a pin-shaped member spanned between the pair of frame members, the mask image creating means The binarization processing unit that binarizes the image acquired by the image acquisition unit according to the pixel value, and the contraction process is performed on the image binarized by the binarization processing unit After that, it is preferable to have a contraction / expansion processing means for performing expansion processing.
[0014]
The agricultural product quality determination method of the present invention (claim 4) acquires an image of an agricultural product, creates a mask image of the crop from the acquired image, and determines the quality of the agricultural product based on the mask image. In the quality determination method for agricultural products, a first step of extracting an outline of an image representing the agricultural product from the mask image, and a feature in which the outline is bent at a larger angle than a predetermined angle toward a predetermined direction. A second step of detecting a point, a third step of detecting two pairs of points whose angles are inverted before and after the feature point on the contour line as a skirt point of the feature point, and features adjacent to each other It is characterized by comprising a fourth step of correcting the contour line by interpolating two skirt points located outside of the skirt points related to the points.
[0015]
In this case, in the fourth step, when the linear distance between the two skirt points to be interpolated is shorter than a predetermined distance, the two skirt points are connected by a straight line, and the interpolation is performed. When the straight line distance between the two skirt points is equal to or greater than a predetermined distance, if the tangent lines at the two skirt points of the contour line are parallel to each other, the two skirt points are connected by a straight line and interpolated. If the tangents are not parallel to each other, it is preferable to interpolate the above two skirt points with a spline function consisting of a polynomial.
[0016]
When the crop is transported in a state of being placed on a tray composed of a pair of frame members and a pin-shaped member spanned between the pair of frame members, and acquiring an image of the crop being transported, The first step includes a step of binarizing the image of the crop according to a pixel value, and a step of performing an expansion process after performing a contraction process on the binarized image. It is preferable that
[0017]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings.
FIGS. 1-13 is a figure shown about the quality determination apparatus and the quality determination method of agricultural products as one Embodiment of this invention, FIG. 1 is a schematic diagram which shows the structure of a quality determination apparatus, FIG. FIG. 3B and FIG. 4A to FIG. 4C are schematic diagrams for explaining the quality judgment method, and FIG. 5 shows the quality judgment method. FIG. 6 to FIG. 13 are diagrams for explaining image processing according to the quality judgment method (FIGS. 6 to 8 are diagrams used for explaining the conventional quality judgment method. And combined use). In addition, about the part demonstrated as a prior art, the same code | symbol is attached | subjected and the description is abbreviate | omitted.
[0018]
An agricultural product quality determination apparatus 10 according to the present embodiment determines the quality of an eggplant as an agricultural product, and is configured as shown in FIG. 1, placed on a tray 2 and transported by a conveyor (a crop transport means) 3. The insulator 1 is imaged by a CCD camera (or TV camera) 11 as an image acquisition means, and the quality of the insulator 1 is determined based on the image (camera image) of the insulator 1 acquired by the CCD camera 11. It is. The insulators 1 whose quality has been determined are sorted according to their quality on the downstream side (not shown).
[0019]
In FIG. 1, one CCD camera 11 is simplified and shown above the conveyor 3, but a plurality of CCD cameras 11 are provided so that the insulator 1 on the conveyor 3 can be imaged from various angles. . Moreover, in the range imaged by the CCD camera 11, the insulator 1 on the conveyor 3 is irradiated with light from a light source (not shown).
The quality judgment device 10 includes the CCD camera 11, a mask image creation unit (mask image creation unit) 12, a mask image correction unit (mask image correction unit) 13, and a quality judgment unit (quality judgment unit) 14. Yes. Based on the camera image acquired by the CCD camera 11, a mask image obtained by extracting the shape of the crop (here, coconut) 1 is created by the mask image creating unit 12, and this mask image is corrected by the mask image correcting unit 13. It is like that. Based on the corrected mask image, the quality determining unit 14 determines the quality of the insulator 1. The quality of the insulator 1 as used herein refers generally to those used for grading, and includes dimensions such as thickness as well as those relating to the shape such as the degree of warpage.
[0020]
The mask image creation unit 12 includes a binarization processing unit (binarization processing unit) 12a and a contraction / expansion processing unit (contraction / expansion processing unit) 12b. For each pixel of the camera image, the binarization processing unit 12a sets “1” (luminance to a predetermined value) if the pixel value (darkness) is larger than a predetermined threshold, while the pixel value is predetermined. If the threshold value is equal to or less than the threshold value, binarization processing is performed to set “0” (luminance is zero). When the binarization processing is performed on the camera image 20 as shown in FIG. A binarized image 21 as shown in FIG. Since the color of the pin 2b of the tray 2 is set to a color close to the insulator 1 (here, black), in this binarized image 21, not only the insulator 1 but also the pin 2b is an image made up of “1” pixels. It will be displayed as (white image).
[0021]
The contraction / expansion processing unit 12b performs the contraction process on the binarized image 21 a predetermined number of times, and then performs the expansion process a predetermined number of times. As a result, an image showing the pin 2b (FIG. 7). A white line running in the horizontal direction in FIG. 8 is removed, and a mask image 22 as shown in FIG. 8 is used, in which a pixel forming an insulator is set to “1” and a pixel forming a background (an area other than the insulator) is set to “0”. Will be obtained.
[0022]
However, in the binarization process, if there is a light-colored portion (or white scratches or large wormholes made by a machine) in the insulator 1 as in this example, this portion is converted into the binarized image 21 and the mask image. 22 is set to “0”. In addition, the number of pixels forming the lump among the lump consisting of “1” pixels or the number of pixels having the width dimension if the lump is linear are removed by the contraction / expansion processing. The number is less than a predetermined number determined by the number of times of contraction processing (for example, a linear image having a width of 4 pixels or less can be removed by two contraction processings). For this reason, in the mask image 22, the pin 2 b is not completely removed at the portion where the insulator 1 and the pin 2 b begin to overlap (the portion shown by hatching in FIG. 8).
Therefore, the mask image 22 is corrected by the mask image correcting unit 13.
[0023]
As shown in FIG. 1, the mask image correction unit 13 includes a contour line extraction unit (contour line extraction unit) 13a, a feature point detection unit (feature point detection unit) 13b, a skirt point detection unit (base point detection unit) 13c, and An outline correction unit (outline correction means) 13d is provided.
[0024]
The contour line extraction unit 13a generates a chain code from the mask image 22 created by the mask image creation unit 11, and based on the chain code, the mask image ("1" pixels of the mask image 22 are assembled. The boundary pixel image 23 shown in FIG. 9 is created by extracting the outline of the image) (= boundary pixel: pixel adjacent to the pixel “0”).
[0025]
A chain code is used to represent a curve in a binarized image. The chain cord will be briefly described with reference to FIGS. 2 (a) and 2 (b). The squares in FIGS. 2A and 2B indicate pixels. In FIG. 2B, for convenience, the pixel “1” is indicated by “◯” and the pixel “0” is indicated by a blank.
[0026]
In the chain code, as indicated by eight arrows in FIG. 2A, code numbers 0 to 7 are assigned to each of the adjacent pixels 31 to 38 with respect to a predetermined pixel 30. On the other hand, the pixel 32 is expressed as 1 in the chain code. If the closed curve (contour line) 50 shown in FIG. 2B is expressed by a chain code counterclockwise starting from the pixel 51, “1,0, 1, 2, 2, 2, 2, 3, 4, 4, 4, 5, 6, 6, 5, 6, 7, 0, 7 ".
[0027]
The feature point detection unit 13 b extracts feature points in the outline of the boundary pixel image 23. A feature point is a pixel that bends at a larger angle than a predetermined angle in a predetermined direction (here, toward the inside of a contour line that is a closed loop).
The feature point detection unit 13b will be described with reference to FIG. In FIG. 3, for convenience, “1” pixels (pixels forming the contour line 50) are indicated by “☆”, “◯”, “●”, “★”, and “0” pixels are indicated by blanks. The feature point detection unit 13b sequentially determines the pixels forming the contour line 50, starting from a predetermined pixel as a starting point (in this case, counterclockwise). The feature points are detected from the contour line 50. Hereinafter, the direction in which feature points are detected is referred to as detection direction A.
[0028]
For example, when determining whether or not the pixel 53 indicated by “●” is a feature point, this determination is made by extending the arms L1 and L2 before and after the pixel 53 and changing the directions of the arms L1 and L2. This is done based on the quantity θ. The arms L1 and L2 are pixels that form the outline 50 from the pixel 53 to be determined, and are separated from the pixel 53 by a predetermined number (here, three, the predetermined number is also referred to as the arm length). The line segments connecting the pixels 52 and 54 respectively.
[0029]
In the contour line 50, the angle toward the inside of the contour line 50 (here, the angle tilted to the left with respect to the detection direction A because the detection direction A is counterclockwise) is negative, and the angle toward the outside of the contour line 50 (here, the detection direction) Assuming that A is counterclockwise and the angle tilted to the right with respect to the detection direction A) is positive, the feature point detection unit 13b has the angle θ negative and a predetermined angle θ. 0 If the angle is larger than that, the pixel 53 is determined as a feature point.
[0030]
The length of the arms L1 and L2 and a predetermined angle θ 0 Is appropriately set according to the type of contour detection target (agricultural crops). For example, when the crop is an insulator, the arm lengths L1 and L2 are set to 3, and a predetermined angle θ. 0 It is known that the contour line can be extracted with high accuracy if each is set to 50 degrees.
When a feature point is detected by the feature point detector 13b in the image 23 shown in FIG. 9, an image 24 as shown in FIG. 10 is obtained. In the image 24, the feature points are indicated by “◯”.
[0031]
The skirt point detection unit 13c detects skirt points located before and after the feature point detected by the feature point detection unit 13b, and the skirt point is an angle of the contour line from positive to negative, or from negative to positive. This is a point (pixel) that is inverted to. Then, the contour line correction unit 13c further corrects the contour line by interpolating outer skirt points among the skirt points of the adjacent feature points.
[0032]
The function of the contour correction unit 13c will be further described with reference to FIGS. 4 (a), 4 (b), and 4 (c). 4 (a) to 4 (c), for convenience, the “1” pixel (the pixel forming the outline 60) is shown in black, and the “0” pixel is shown in white.
FIG. 4A shows a case where a part of the outline 24A is greatly recessed inward. In this case, as shown in the figure, the pixel a that bends greatly to the left with respect to the detection direction A. 0 , B 0 Are detected as feature points, and a feature point a 0 Pixel a as the foot of 1 , A 2 Is detected and the feature point b 0 Pixel b as the base of 1 , B 2 Is detected. These feature points a 0 , B 0 And skirt point a 1 , A 2 , B 1 , B 2 Are integrated to generate data indicating pixels to be complemented. That is, four skirt points a 1 , A 2 , B 1 , B 2 Outer hem point a 1 , B 2 Is the feature point a 0 , B 0 Are set as pixels to be interpolated. The outer skirt point among the four skirt points refers to the skirt point that is the most separated combination at the distance Y along the contour line.
[0033]
And these skirt points a 1 , B 2 Is , The contour 60 is interpolated by the contour correcting unit 13c, and the contour 60 is corrected so that the line segment 61 indicated by the two-dot chain line in FIG. 4A formed by this interpolation forms part of the contour 60. Become.
FIG. 4B shows a case where a convex portion is formed on a part of the contour line 62. In this case, as shown in FIG. 1 , C 2 Is the feature point a 0 , B 0 , And these hem points c 1 , C 2 Is interpolated by a line segment as indicated by a two-point difference line by the outline correcting unit 13c, and the outline 62 is corrected.
[0034]
FIG. 4C shows a case where the convex portion of the contour line is slightly recessed at the center with respect to FIG. 0 , B 0 And its skirt point a 1 , A 2 , B 1 , B 2 Is detected and the foot point a 1 , B 2 Is complemented by the contour correcting unit 13c as indicated by a two-point difference line, and the contour 63 is corrected.
The interpolation of the two skirt points by the contour correcting unit 13c is such that the linear distance D between the skirt points to be complemented is a predetermined value D. 0 Less than (D <D 0 ), Linear interpolation is performed. On the other hand, the distance D is the predetermined value D. 0 If this is the case (D ≧ D 0 ), Tangent line M of contour lines 60, 62, 63 at the skirt points to be complemented 1 , M 2 Are parallel, they are complemented by straight lines, and the tangent line M 1 , M 2 If they are not parallel, they are interpolated by a spline function consisting of a polynomial such as a cubic spline equation. Here, the tangent refers to the tangent of the contour line outside the base point to be interpolated.
[0035]
When the outline correction unit 13c corrects the outline of the image 24 shown in FIG. 10, first, an image 25 as shown in FIG. 11 is obtained. In the image 25, the skirt point “Δ” is shown. Next, by interpolating the skirt points, an image 26 in which the contour line is corrected as shown in FIG. 12 is obtained.
Then, as a final process, the mask image correcting unit 13 performs a hole filling process (a process of setting all pixels in the closed region surrounded by “1” pixels to “1”) to the image 26, and then performs FIG. A mask image 27 as shown is created.
[0036]
The agricultural product quality determination apparatus according to the embodiment of the present invention is configured as described above, and the quality determination is performed by the method shown in the flowchart of FIG. 5 (the agricultural product quality determination method according to the embodiment of the present invention). Is done
That is, first, in step A10, an image 20 (see FIG. 6) of the insulator 1 conveyed by the conveyor 3 while being placed on the tray 2 is acquired by imaging with the CCD camera 1. In step A20, the camera image 20 is binarized and contracted / expanded by the mask image creation unit 12, and as a result, a mask image 22 as shown in FIG. 8 is obtained. As shown in the camera image 20, since there is a lightly colored portion (portion where the pixel value is equal to or less than the threshold value), the mask image 22 has a pixel of “0” (not a lever). In addition, a part of the pin 2b of the tray 2 is left as a refracted portion bent at a substantially right angle at the outer edge of the mask image 22.
[0037]
In step A30, a chain code is generated from the mask image 23 by the contour extraction unit 13a, and an image 23 as shown in FIG. 9 obtained by extracting the contour of the mask image of the mask image 23 is obtained. Then, a feature point is detected by the feature point detection unit 13b in step A40 with respect to the contour line, and an image 24 as shown in FIG. Further, in step A50, the skirt point corresponding to the feature point is detected by the skirt point detection unit 13c, and an image 25 as shown in FIG. 10 in which the skirt point is indicated by “Δ” is obtained.
[0038]
Then, in step A60, the feature point detected in step A40 and the skirt point detected in step A50 are integrated by the contour correcting means 13d. That is, the combination of the two skirt points outside the four skirt points corresponding to the feature points adjacent to each other is generated as a set of data between the feature points. In step A70, the contour correcting means 13d further interpolates the two skirt points forming the data set to correct the contour, and an image 26 as shown in FIG. 12 is obtained.
[0039]
By interpolating the skirts of feature points adjacent to each other in this way, a large bent portion (a portion bent at an angle larger than a predetermined angle with respect to the tangential direction of the contour) that does not exist as the contour of the insulator is obtained. The convex portions and concave portions that are included are corrected so that the concave portions are removed and the concave portions are blocked. As a result, in the mask image 23, correction is performed on a portion that is erroneously determined to be a dent because of its light color, and a part of the remaining pin 2b, and the contour of the insulator 1 is accurately defined as shown in FIG. A reproduced image can be obtained.
[0040]
This image is finally subjected to hole filling processing (processing to set all the pixels in the closed region surrounded by “1” pixels to “1”), and as a result, a mask image 27 corrected as shown in FIG. In step A80, the quality determining unit 14 determines the quality of the insulator 1 based on the mask image. Since the mask image 27 used for quality determination accurately reproduces the actual contour of the insulator 1 by the above correction, the quality of the insulator 1 can be determined with high accuracy.
[0041]
In addition, the quality determination apparatus and quality determination method of the agricultural product of this invention are not limited to embodiment mentioned above, It can change variously in the range which does not deviate from the meaning of this invention.
For example, in the above-described embodiment, an example in which the image acquisition unit that acquires an image of a crop is configured by a CCD camera (imaging unit) has been described. However, an image captured by an external device is recorded on a recording medium such as a floppy (registered trademark) disk. After the image is once recorded, the image may be read from the recording medium by a recording / reading device such as a floppy (registered trademark) disk drive. In this case, an image acquisition unit is configured with the recording / reading apparatus.
In the above embodiment, the feature point is a point that bends at a predetermined angle or more at a negative angle (that is, toward the inside of the contour line). A point that turns at a predetermined angle or more (outward) may be a feature point.
[0042]
Moreover, although the said embodiment demonstrated the example which handled the eggplant as agricultural products, this invention is applicable also to another agricultural product.
[0043]
【The invention's effect】
As described above in detail, according to the present invention, the adjacent features described above are interpolated by using, for example, a straight line or a spline function, between the skirts of the feature points adjacent to each other. A large bent portion of the contour line including the point is corrected. As a result, an extremely large bent portion that does not exist in the actual crop produced in the mask image due to misrecognition is corrected. There is an advantage that the shape of the crop can be accurately detected, and the quality of the crop can be accurately determined based on the detected shape of the crop.
[0044]
In particular, the crops are placed on a tray and transported, and the images of the crops being transported are binarized according to pixel values to create a binarized image, and the binarized image is further shrunk. After processing, when expanding the mask image to create a mask image, if there is a light-colored part in the crop, this part will be misrecognized as not being a farm product, or the pin-shaped member of the tray will be accurately removed from the mask image. Although it may not be possible, there is a possibility that an uneven portion that does not actually exist on the outer edge of the mask image may be generated.
[Brief description of the drawings]
FIG. 1 is a schematic diagram showing the configuration of an agricultural product quality determination apparatus according to an embodiment of the present invention.
FIGS. 2A and 2B are schematic diagrams for explaining contour line extraction using a chain code. FIGS.
FIG. 3 is a schematic diagram for explaining a method for judging the quality of agricultural products as one embodiment of the present invention.
FIGS. 4A to 4C are schematic diagrams for explaining a method for determining the quality of agricultural products according to an embodiment of the present invention.
FIG. 5 is a schematic flowchart for explaining a method for judging the quality of agricultural products as one embodiment of the present invention.
FIG. 6 is a schematic diagram for explaining image processing according to an agricultural product quality determination method and a conventional agricultural product quality determination method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram for explaining image processing according to an agricultural product quality determination method and a conventional agricultural product quality determination method according to an embodiment of the present invention;
FIG. 8 is a schematic diagram for explaining image processing according to an agricultural product quality determination method and a conventional agricultural product quality determination method according to an embodiment of the present invention;
FIG. 9 is a schematic diagram for explaining image processing according to the agricultural product quality determination method of the embodiment of the present invention.
FIG. 10 is a schematic diagram for explaining image processing according to the agricultural product quality determination method of the embodiment of the present invention.
FIG. 11 is a schematic diagram for explaining image processing according to the agricultural product quality determination method of the embodiment of the present invention.
FIG. 12 is a schematic diagram for explaining image processing according to the agricultural product quality determination method of the embodiment of the present invention.
FIG. 13 is a schematic diagram for explaining image processing according to the agricultural product quality determination method of the embodiment of the present invention.
14A and 14B are diagrams showing a configuration of a general tray used for transporting agricultural products, in which FIG. 14A is a schematic plan view, and FIG. 14B is an xx cross-sectional view of FIG.
FIGS. 15A to 15C are schematic diagrams for explaining image processing according to a conventional method for judging quality of agricultural products. FIGS.
[Explanation of symbols]
1 Isogo (agricultural crops)
2 trays
2a frame
2b pin
3 conveyor (crop transportation means)
10 Quality judgment device
11 CCD camera (image acquisition means)
12 Mask image creation unit (mask image creation means)
12a Binarization processing unit (binarization processing means)
12b Shrinkage expansion processing unit (shrinkage expansion processing means)
13 Mask image correcting unit (mask image correcting means)
13a Contour line extraction unit (contour line extraction means)
13b Feature point detector (feature point detector)
13c Bottom point detection unit (base point detection means)
13d contour correction unit (contour correction means)
14 Quality judgment part (quality judgment means)
20 Camera images
21 Binarized image
22, 27 Mask image
23-26 border pixel image
50, 60 contour lines
30-37, 51-54 pixels
M 1 , M 2 Tangent
θ Angle at a predetermined position of the contour line
a 0 , B 0 Feature point
a 1 , B 1 , C 1, c 2 Hem point

Claims (6)

農産物の画像を取得する画像取得手段と、
該画像取得手段により取得した画像から該農作物のマスク画像を作成するマスク画像作成手段と、
該マスク画像作成手段により作成されたマスク画像を補正するマスク画像補正手段と、
該マスク画像補正手段により補正されたマスク画像に基づいて該農産物の品質を判定する品質判定手段とをそなえて構成され、
該マスク画像補正手段が、
該マスク画像作成手段により作成された該マスク画像から、該農作物を表す像の輪郭線を抽出する輪郭線抽出手段と、
該輪郭線において、所定の方向に向かって所定の角度よりも大きな角度で曲がる特徴点を検出する特徴点検出手段と、
該輪郭線において、該特徴点の前後で角度が反転する点を二つ一組で該特徴点の裾点として検出する裾点検出手段と、
相互に隣り合う特徴点に関する裾点の内で、外側に位置する二つの裾点を補間するようにして該輪郭線を補正する輪郭線補正手段とをそなえて構成されていることを特徴とする、農産物の品質判定装置。
Image acquisition means for acquiring images of agricultural products;
Mask image creating means for creating a mask image of the crop from the image obtained by the image obtaining means;
Mask image correcting means for correcting the mask image created by the mask image creating means;
Comprising quality judging means for judging the quality of the produce based on the mask image corrected by the mask image correcting means,
The mask image correcting means is
Contour extraction means for extracting an outline of an image representing the agricultural product from the mask image created by the mask image creation means;
A feature point detecting means for detecting a feature point that bends at a larger angle than a predetermined angle toward the predetermined direction in the contour line;
In the contour line, skirt point detection means for detecting two points in which the angle is inverted before and after the feature point as a skirt point of the feature point,
It is characterized by comprising contour correction means for correcting the contour line by interpolating two skirt points located outside among the skirt points related to feature points adjacent to each other. , Agricultural product quality judgment device.
該輪郭線補正手段が、
上記の補間する二つの裾点の直線距離が、所定距離よりも短い場合には、上記の二つの裾点を直線で結んで補間する一方、
上記の補間する二つの裾点の直線距離が、所定距離以上の場合には、該輪郭線の上記の二つの裾点における接線が相互に平行であれば上記の二つの裾点を直線で結んで補間し、該接線が相互に平行でなければ、上記の二つの裾点を多項式からなるスプライン関数で補間するよう構成されている
ことを特徴とする、請求項1記載の農産物の品質判定装置。
The contour line correcting means is
When the linear distance between the two skirt points to be interpolated is shorter than a predetermined distance, the two skirt points are connected by a straight line and interpolated,
If the straight line distance between the two skirt points to be interpolated is greater than or equal to a predetermined distance, the two skirt points are connected by a straight line if the tangent lines at the two skirt points of the outline are parallel to each other. 2. The agricultural product quality judging apparatus according to claim 1, wherein the two skirt points are interpolated by a spline function comprising a polynomial if the tangent lines are not parallel to each other. .
該農作物が、一対のフレーム部材及び上記の一対のフレーム部材に掛け渡されたピン状部材からなるトレーに載置された状態で農作物搬送手段により搬送され、
該マスク画像作成手段が、
該画像取得手段により取得された画像を画素値に応じて二値化処理する二値化処理手段と、
該二値化処理手段により二値化処理された画像に対し、収縮処理を施した後、膨張処理を施す、収縮膨張処理手段とをそなえて構成されている
ことを特徴とする、請求項1又は2記載の農産物の品質判定装置。
The crop is transported by the crop transport means in a state of being placed on a tray composed of a pair of frame members and a pin-shaped member spanned over the pair of frame members.
The mask image creating means
Binarization processing means for binarizing the image acquired by the image acquisition means according to pixel values;
2. The image processing apparatus according to claim 1, further comprising a contraction / expansion processing unit configured to perform an expansion process after the contraction process is performed on the image binarized by the binarization processing unit. Or the quality determination apparatus of agricultural products of 2.
農産物の画像を取得し、取得した画像から該農作物のマスク画像を作成し、該マスク画像に基づいて該農産物の品質を判定する、農産物の品質判定方法において、
該マスク画像から、該農作物を表す像の輪郭線を抽出する第1ステップと、
該輪郭線において、該輪郭線の所定の方向に向かって所定の角度よりも大きな角度で曲がる特徴点を検出する第2ステップと、
該輪郭線において、該特徴点の前後で角度が反転する点を二つ一組で該特徴点の裾点として検出する第3ステップと、
相互に隣り合う特徴点に関する裾点の内で、外側に位置する二つの裾点を補間するようにして該輪郭線を補正する第4ステップとをそなえて構成されている
ことを特徴とする、農産物の品質判定方法。
In the quality determination method for agricultural products, an image of an agricultural product is acquired, a mask image of the crop is created from the acquired image, and the quality of the agricultural product is determined based on the mask image.
A first step of extracting an outline of an image representing the crop from the mask image;
A second step of detecting a feature point that bends at a larger angle than a predetermined angle toward a predetermined direction of the contour line in the contour line;
A third step of detecting, as a set of foot points of the feature points in pairs, points whose angles are reversed before and after the feature points in the contour line;
A fourth step of correcting the contour line by interpolating two skirt points located outside among the skirt points related to feature points adjacent to each other, A method for judging the quality of agricultural products.
該第4ステップでは、
上記の補間する二つの裾点の直線距離が、所定距離よりも短い場合には、上記の二つの裾点を直線で結んで補間する一方、
上記の補間する二つの裾点の直線距離が、所定距離以上の場合には、該輪郭線の上記の二つの裾点における接線が相互に平行であれば上記の二つの裾点を直線で結んで補間し、該接線が相互に平行でなければ、上記の二つの裾点を多項式からなるスプライン関数で補間する
ことを特徴とする、請求項4記載の農産物の品質判定方法。
In the fourth step,
When the linear distance between the two skirt points to be interpolated is shorter than a predetermined distance, the two skirt points are connected by a straight line and interpolated,
If the straight line distance between the two skirt points to be interpolated is greater than or equal to a predetermined distance, the two skirt points are connected by a straight line if the tangent lines at the two skirt points of the outline are parallel to each other. 5. The method for judging the quality of agricultural products according to claim 4, wherein if the tangent lines are not parallel to each other, the two skirt points are interpolated by a spline function comprising a polynomial.
該農作物を、一対のフレーム部材及び上記の一対のフレーム部材に掛け渡されたピン状部材からなるトレーに載置した状態で搬送するとともに、該搬送中の農作物の画像を取得し、
該第1ステップが、
上記の農作物の画像を画素値に応じて二値化するステップと、
該二値化画像に対し、収縮処理を施した後、膨張処理を施す、ステップとをそなえて構成されていることを
特徴とする、請求項4又は5記載の農産物の品質判定方法。
The crop is transported in a state of being placed on a tray composed of a pair of frame members and a pin-shaped member spanned between the pair of frame members, and an image of the crop being transported is acquired.
The first step comprises
Binarizing the image of the crop according to the pixel value;
6. The method for judging the quality of agricultural products according to claim 4 or 5, further comprising a step of performing an expansion process after performing a contraction process on the binarized image.
JP2002167243A 2002-06-07 2002-06-07 Agricultural product quality judgment device and agricultural product quality judgment method Expired - Fee Related JP3653063B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002167243A JP3653063B2 (en) 2002-06-07 2002-06-07 Agricultural product quality judgment device and agricultural product quality judgment method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002167243A JP3653063B2 (en) 2002-06-07 2002-06-07 Agricultural product quality judgment device and agricultural product quality judgment method

Publications (2)

Publication Number Publication Date
JP2004008961A JP2004008961A (en) 2004-01-15
JP3653063B2 true JP3653063B2 (en) 2005-05-25

Family

ID=30434554

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002167243A Expired - Fee Related JP3653063B2 (en) 2002-06-07 2002-06-07 Agricultural product quality judgment device and agricultural product quality judgment method

Country Status (1)

Country Link
JP (1) JP3653063B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5567413B2 (en) * 2010-06-29 2014-08-06 国立大学法人電気通信大学 Outline extraction system, decoding apparatus and outline extraction program
JP5546021B2 (en) * 2011-05-31 2014-07-09 Ckd株式会社 Tablet inspection device and PTP packaging machine
JP6044396B2 (en) * 2013-03-05 2016-12-14 シンフォニアテクノロジー株式会社 Foreign object detection device and parts feeder
JP6334215B2 (en) * 2014-03-12 2018-05-30 地方独立行政法人青森県産業技術センター Image processing system, image processing method, and image processing program
CN109530270A (en) * 2018-11-10 2019-03-29 东莞理工学院 A kind of online vision detection system for facial mask production line
CN111696047B (en) * 2019-03-14 2023-08-22 四川中测辐射科技有限公司 Imaging quality determining method and system of medical imaging equipment

Also Published As

Publication number Publication date
JP2004008961A (en) 2004-01-15

Similar Documents

Publication Publication Date Title
US11455727B2 (en) Method and apparatus for excessive materials removal from intraoral scans
US11227405B2 (en) Determining positions and orientations of objects
CN109409374B (en) Joint-based same-batch test paper answer area cutting method
US10748297B2 (en) Dimension measurement device, parcel locker system, and dimension measurement method
JP5418378B2 (en) Surface defect inspection apparatus, surface defect inspection method, and program
JP4095947B2 (en) Method for determining skew angle and position of a document in an overscanned image
JP2005326247A (en) Calibrator, calibration method, and calibration program
CN112991193B (en) Depth image restoration method, device and computer-readable storage medium
JP2019192022A (en) Image processing apparatus, image processing method, and program
JP3653063B2 (en) Agricultural product quality judgment device and agricultural product quality judgment method
JP2019179342A (en) Image processing device and image processing method
JP4296617B2 (en) Image processing apparatus, image processing method, and recording medium
JP3659426B2 (en) Edge detection method and edge detection apparatus
JP3576654B2 (en) Exposure determination method, figure extraction method, and face area determination method
JP2000163579A (en) Appearance inspection method and device
US11957217B2 (en) Method of measuring the shape and dimensions of human body parts
CN112991334B (en) Global positioning method and device for industrial particle continuous product
JP4696239B2 (en) Method and apparatus for correcting inclination of character string
JPH1038543A (en) Shape inspection method
JP2001116534A (en) Circularity deciding method, circularity arithmetic unit, and recording medium
JP3577194B2 (en) Tablet appearance inspection method and tablet appearance inspection device
JP3823379B2 (en) Image processing method
JPH06281421A (en) Image processing method
JP2516844B2 (en) Parts detection method and device
JP2004318488A (en) Product inspection method and product inspection device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050117

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: 20050208

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050224

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080304

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090304

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees