コード例 #1
0
ファイル: lbpfeatures.cpp プロジェクト: 353/viewercv
CvLBPEvaluator::Feature::Feature(int offset, int x, int y, int _blockWidth, int _blockHeight) {
    Rect tr = rect = cvRect(x, y, _blockWidth, _blockHeight);
    CV_SUM_OFFSETS(p[0], p[1], p[4], p[5], tr, offset)
    tr.x += 2 * rect.width;
    CV_SUM_OFFSETS(p[2], p[3], p[6], p[7], tr, offset)
    tr.y += 2 * rect.height;
    CV_SUM_OFFSETS(p[10], p[11], p[14], p[15], tr, offset)
    tr.x -= 2 * rect.width;
    CV_SUM_OFFSETS(p[8], p[9], p[12], p[13], tr, offset)
}
コード例 #2
0
CvHOGEvaluator::Feature::Feature( int offset, int x, int y, int cellW, int cellH )
{
  rect[0] = Rect( x, y, cellW, cellH );  //cell0
  rect[1] = Rect( x + cellW, y, cellW, cellH );  //cell1
  rect[2] = Rect( x, y + cellH, cellW, cellH );  //cell2
  rect[3] = Rect( x + cellW, y + cellH, cellW, cellH );  //cell3

  for ( int i = 0; i < N_CELLS; i++ )
  {
    CV_SUM_OFFSETS( fastRect[i].p0, fastRect[i].p1, fastRect[i].p2, fastRect[i].p3, rect[i], offset );
  }
}