java Neuroph图像识别插件是否正确地将RGB图像转换为黑白?
我有一个关于Neuroph 2.6的FractionRgbData
类Neuroph图像识别的问题。我不完全理解静态FractionRgbData.convertRgbInputToBinaryBlackAndWhite(double[] inputRGB)
方法的实现(请参阅下面方法的副本)。更具体地说,我不明白为什么输入数组的长度在for循环条件下被3除,而for循环变量i
也在每次迭代中以3递增?我认为将输入数组除以3就足够了
注意,这个方法在^{inputRGB
double来自FractionRgbData.getFlattenedRgbValues()
,可以看到here。据我所知inputRGB
双数组包含图像的红色、绿色和蓝色通道
希望有人能对这个实现有所启发
提前感谢,
巴里荷兰
/**
* Converts image rgb data to binary black and white data
* @param inputRGB flatten rgb data
* @return binary black and white representation of image
*/
public static double[] convertRgbInputToBinaryBlackAndWhite(double[] inputRGB) {
double inputBinary[]= new double[inputRGB.length/3];
for(int i=0; i<inputRGB.length/3; i+=3) {
if (inputRGB>0) inputBinary = 0;
else inputBinary = 1;
}
return inputBinary;
}
# 1 楼答案
一位欧米诺开发者在欧米诺的支持论坛上回答了上述问题。可以在here找到它
简而言之,开发人员说实现是不正确的,并且没有正确地转换为黑/白