嗨,所以我必须制作一个脚本(不管是什么编程语言,但我会在这里使用 Java),一个比较两张黑白图像并判断哪一张最模糊的脚本。
所以我必须做一个这样的功能:
function int getImageBlurPercentage()
{
ArrayList<Integer> ColorList = new ArrayList<Integer>();
//Part 1: fill ColorList with color values (0=black, 255=white)
go through Y axis
go through X axis
ColorList -> add colorValue of each pixel; [ie: 0 to 255]
//Part 2: process (This is the part where I need help !)
int lastColor = 0;
for(int color : ColorList)
{
// Something has to be done here
// To compare pixel by pixel
// and get noise result or difference result
// and convert it to a percentage (0% - 100%)
// This is where I need your help !
}
}
所以这就是我需要你们帮助的地方,我真的不知道如何处理这个问题。我认为这需要一些我不擅长的数学公式。
如果有人帮助或提供可以引导我走上正确道路的提示,我将不胜感激。谢谢你。