I have written a small script in node to perform some tests over files based on the deviation method, you have provided earlier. Here test results for 3 images:
DegStep: 15 maxDeg: 180 cropPerc: 100
blurry.jpg 0x1: [ '0.47640', '0.09185' ]
blurry.jpg 0x3: [ '0.41651', '0.29287' ]
blurry.jpg 0x6: [ '0.31874', '0.52985' ]
blurry.jpg 0x10: [ '0.25817', '0.75947' ]
blurry.jpg 0x20: [ '0.23722', '1.43315' ]
sharp.jpg 0x1: [ '0.57534', '0.13403' ]
sharp.jpg 0x3: [ '0.54890', '0.44267' ]
sharp.jpg 0x6: [ '0.54524', '0.95326' ]
sharp.jpg 0x10: [ '0.53005', '1.51992' ]
sharp.jpg 0x20: [ '0.53336', '2.91220' ]
CRB_7983.TIF 0x1: [ '0.30716', '2.67845' ]
CRB_7983.TIF 0x3: [ '0.40087', '6.94035' ]
CRB_7983.TIF 0x6: [ '0.41218', '10.79834' ]
CRB_7983.TIF 0x10: [ '0.40965', '14.28854' ]
CRB_7983.TIF 0x20: [ '0.39220', '19.64742' ]
I will explain the numbers:
0x1, 0x3, ... are the blurriness applied on the same images. I was interested in how the deviation changes in relation to different blurriness strength. It might indicate how strong is a blur in an image, can it be tolerated or not.
DegStep: 15 (Steps of degree, each 15deg a test)
maxDeg: 180 (Max. degree, 180deg, half the the rotation is enough to get every direction)
cropPerc: 100 (well, the image could be cropped at center gravity, in this case its 100%, so not croppped)
The deviation numbers:
[ '0.47640', '0.09185' ]
1. number: Ratio between: Diff min to max and Diff max to total (maxDegDevi - minDegDevi) / (originalDeviation - minDegDevi)
2. number: Diff min to max, percentage to total (maxDegDevi - minDegDevi) / originalDeviation * 100
When looking at our initial image: CRB_7983.TIF 0x3: [ '0.40087', '6.94035' ]
We can see a high rate of difference between the minimum and maximum deviations found in the different tested directions. 6.9% of the overall deviation is big and indicates clearly a blurriness based on linear motion.
When testing this against two images, which are pretty similar, one sharp and the other with moderate motion blur, we can see the difference of min. and max. deviation is not representative. Actually its saying the opposite:
blurry.jpg 0x3: [ '0.41651', '0.29287' ]
sharp.jpg 0x3: [ '0.54890', '0.44267' ]
0.29287 (blurry) against 0.44267 (sharp). That should be actually the opposite. So the algorithm might only work with strong blurrines. See here the two new images (sharp.jpg, blurry.jpg):
https://www.dropbox.com/sh/tnjkomqf7556 ... 89ITa?dl=0
I will check your new approach.