This seems great 
I just switched over from cvSmooth to this and this is faster (from my tests so far).
I’d like to also try this on a highpass filter though to see if I can speed it up and could use some help…
The current openCV code to make the highpass is:
//Blur Original Image
if(blur1 > 0)
cvSmooth( cvImage, cvImageTemp, CV_BLUR , (blur1 * 2) + 1);
//Original Image - Blur Image = Highpass Image
cvSub( cvImage, cvImageTemp, cvImageTemp );
//Blur Highpass to remove noise
if(blur2 > 0)
cvSmooth( cvImageTemp, cvImageTemp, CV_BLUR , (blur2 * 2) + 1);
swapTemp();
flagImageChanged();
I’d like to change both cvSmooth calls to use the superFastBlur to test if it’s faster. I’m currently using this code (and it works), but it’s somewhat slow. I think having to setFromPixels between things causes the slow down. If anyone has a way to optimize this, i’d be great:
//store original
cvCopy(cvImage, cvImageTemp);
//blur original image
unsigned char * pix1 = getPixels();
superFastBlur(pix1, width, height, blur1);
setFromPixels(pix1, width, height);
//Original Image - Blur Image = Highpass Image
cvSub( cvImageTemp, cvImage, cvImage );
//Blur Highpass to remove noise
unsigned char * pix2 = getPixels();
superFastBlur(pix2, width, height, blur2);
setFromPixels(pix2, width, height);
flagImageChanged();
Is there a simple way to avoid doing setFromPixels until the end? Maybe can subtract the original image from the blurred without using cvSub so that the pixels can then be directly passed into the second blur?