Wolfram
Mathematica
8의 신기능: 포괄적인 이미지 프로세싱 환경
◄
이전
|
다음
►
응용 분야
움직이는 물체의 추적
라이브 스트림 이미지에서 특정 색상과 형태의 물체를 찾아 추적합니다.
In[1]:=
X
trackObject := Module[{red, blue, c1, c2}, red = FillingTransform@ DeleteSmallComponents[ SelectComponents[Binarize[#, Norm[# - {1, 0, 0}] < .6 &], "Circularity", # > .5 &], 100]; blue = FillingTransform@ DeleteSmallComponents[ SelectComponents[Binarize[#, Norm[# - {0, 0, 1}] < .6 &], "Circularity", # > .5 &], 100]; {c1, c2} = Flatten[ComponentMeasurements[#, {"Centroid", "BoundingDiskRadius"}][[All, 2]], 1] & /@ {red, blue}; Show[#, Graphics[{Thickness[.01], Magenta, Circle @@ c1, Cyan, Circle @@ c2}]] ] & Dynamic[trackObject[CurrentImage[]]]
Play Animation
»
Stop Animation
»