Ask Your Question

Revision history [back]

Hi!

I thing the best way to do this is to compare the mean edge response of the original video with the blurred one., You can do it like this:

Mat imgSrc, imgTest;
Mat edgeSrc, edgeTest;
double totalSum = 0, nbFrame = 0;
while(!srcVideo.empty())
{
   imgSrc = srcVideo.getFrame();
   imgTest= testVideo.getFrame();
   Sobel(imgSrc, edgeSrc, -1, 1, 0);
   Sobel(imgTest, edgeTest, -1, 1, 0);
   totalSum += sum(edgeSrc)[0] - sum(edgeTest)[0];
   nbFrame += 1.;
}
totalSum /= nbFrame ;

Then using totalSum, you know if the second video is blurred or not (if totalSum < 0, the test video is blurred...)