|
|
|
@ -594,39 +594,30 @@ namespace cv{ |
|
|
|
|
|
|
|
|
|
// circular shift n rows from up to down if n > 0, -n rows from down to up if n < 0
|
|
|
|
|
void TrackerKCFImpl::shiftRows(Mat& mat, int n) const { |
|
|
|
|
|
|
|
|
|
if( n < 0 ) { |
|
|
|
|
|
|
|
|
|
n = -n; |
|
|
|
|
flip(mat,mat,0); |
|
|
|
|
for(int _k=0; _k < n;_k++) { |
|
|
|
|
shiftRows(mat); |
|
|
|
|
} |
|
|
|
|
flip(mat,mat,0); |
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
for(int _k=0; _k < n;_k++) { |
|
|
|
|
shiftRows(mat); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//circular shift n columns from left to right if n > 0, -n columns from right to left if n < 0
|
|
|
|
|
void TrackerKCFImpl::shiftCols(Mat& mat, int n) const { |
|
|
|
|
|
|
|
|
|
if(n < 0){ |
|
|
|
|
|
|
|
|
|
n = -n; |
|
|
|
|
flip(mat,mat,1); |
|
|
|
|
transpose(mat,mat); |
|
|
|
|
shiftRows(mat,n); |
|
|
|
|
transpose(mat,mat); |
|
|
|
|
flip(mat,mat,1); |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
transpose(mat,mat); |
|
|
|
|
shiftRows(mat,n); |
|
|
|
|
transpose(mat,mat); |
|
|
|
|