#include "Filter.h" #include // memset #include // cout ClassImp(Filter); void Filter::DrawBox(const int x1, const int y1, const int x2, const int y2, byte *buffer, const int col) { for (int x=x1; xbuffer[3*(x+y*768)]; // sumx += m*dx; sumy += m*dy; sum += m; } const float px = (float)sumx/sum; const float py = (float)sumy/sum; return (int)py*768 + (int)px; } void Filter::Execute(byte *img) { const int offset = 10; const float mean = Mean(img, offset); const float sdev = SDev(img, offset, mean); const byte cut = mean+2.5*sdev>254 ? 254 : (byte)(mean + 2.5*sdev); // // clean image from noise // const byte *e = img+768*576; byte *i = img; while (i0xa0) { points++; int px = pos[i][0]%768; int py = pos[i][0]/768; MarkPoint(px, py, marker, pos[i][1]); } } // // Copy markers into image // for (int x=0; x<768*576; x++) { if (!marker[x]) continue; img[x]=marker[x]; } }