I have this code (updated version of this ):
void HessianDetector::detectOctaveKeypoints(const Mat &firstLevel, ...) { vector<Mat> blurs (par.numberOfScales+3, Mat()); blurs[1] = firstLevel; for (int i = 1; i < par.numberOfScales+2; i++){ float sigma = par.sigmas[i]* sqrt(sigmaStep * sigmaStep - 1.0f); blurs[i+1] = gaussianBlur(blurs[i], sigma); } ...
Where:
Mat gaussianBlur(const Mat input, const float sigma) { Mat ret(input.rows, input.cols, input.type()); int size = (int)(2.0 * 3.0 * sigma + 1.0); if (size % 2 == 0) size++; GaussianBlur(input, ret, Size(size, size), sigma, sigma, BORDER_REPLICATE); return ret; }
So, as you can see, each blurs[i+1] depends on blurs[i] , so it cannot be parallelized. My question is: is there an equivalent way to get the same result, but using firstLevel instead of blurs[i] ? Therefore, it should look like this:
for (int i = 1; i < par.numberOfScales+2; i++){ float sigma =
Is it possible?
This answer allows me to think that this is possible , but I cannot understand how I can implement this
Convert filters If you apply multiple filters on the same image in sequence, like a Gaussian blur, then a Gabor filter, you can combine them together. Make all filters the same size and collapse them. Then apply the result in the image. Mathematics says that the effect will be identical to the previous combination
c ++ opencv blur
justHelloWorld
source share