First of all, my purpose is to implement "Sauvola's Algorithm".
In the algorithm, it needs image's mean and standard deviation("std dev") with ROI like convolution filter.
Already I get the mean value using function "blur" which is mean filter.
However, "std dev" needs a lot of functions which are Blur, Multiply, Minus and Square root.
This step consume is too heavy for my device, "Note3" which is Android device.
below code is the way how to calculate "std dev" now.
PARAM_WINDOW_SIZE = 15;
blur(grayF, mean, cv::Size(PARAM_WINDOW_SIZE, PARAM_WINDOW_SIZE),
cv::Point(-1, -1), BORDER_REPLICATE);
meanSQ = mean.mul(mean);
grayF_SQ = grayF.mul(grayF);
blur(grayF_SQ, grayF_SQ, cv::Size(PARAM_WINDOW_SIZE, PARAM_WINDOW_SIZE),
cv::Point(-1, -1), BORDER_REPLICATE);
sqrt(grayF_SQ - meanSQ, deviation);
In the other words, I want to know the function to get standard deviation each ROI from the whole image for speed up.
If you know, let me know... please...
Aucun commentaire:
Enregistrer un commentaire