2013-05-11 5 views
1

Aforge.net을 배우려고합니다. 내가 코드를 작성하고 잘 작동하지만, ı는 내 이미지에서 단지 보라색을 감지하고 싶어하지만, ı은 그것이 어떤지 알 수 없었다. 그래서 아무도 그것에 대해 나를 도울 수 있습니까? 여기 내 코드C# aforge 색상 감지

Bitmap resim = new Bitmap(pictureBox1.Image); 

EuclideanColorFiltering filter = new EuclideanColorFiltering(); 
// set center color and radius 
filter.CenterColor = new RGB(80,90,120); 
filter.Radius = 40; 
// apply the filter 
filter.ApplyInPlace(resim); 

pictureBox1.Image = resim; 

하고 내 소스 이미지

는이

내 필터 후이

그러니 그냥 데리러합니까 수있는 보라색 숫자가 다른 것없이 그냥 보라색 것들이이 사진에?

답변

1

나는 당신이 블롭 필터링 단계에서 진행 컬러 필터링 단계 후 더 나은 컬러 필터

HSLFiltering filter = new HSLFiltering(); 
filter.Saturation = new Range(0.05f, 1f); 
filter.Luminance = new Range(0.05f, 0.70f); 
filter.Hue = new IntRange(280, 340); //these settings should works, if not 
Bitmap red = filter.Apply(image); //search "HSL color picker online" to tune it 

에 대한 HSLFilter를 사용하는 것이 좋습니다.

필터는 각 BLOB :

1. Have a Width more than 20%(example) of the Image.Width (for the height too) 
2. Have a too much/too poor fullness (blob.fullness) 
3. Have a not good ratio Width/Height 

마지막으로 당신은 단지 숫자 또는 적어도 1-2을해야 더

을 물방울