【发布时间】:2012-05-15 00:38:54
【问题描述】:
我对 Neuroph 2.6 的 Neuroph ImageRecognition 的 FractionRgbData 类有疑问。我不完全理解静态FractionRgbData.convertRgbInputToBinaryBlackAndWhite(double[] inputRGB) 方法的实现(请参阅下面的方法副本)。更具体地说,我不明白为什么在for循环条件下输入数组的长度除以3,而for循环变量i每次迭代也增加3?我认为将输入数组除以 3 就足够了。
请注意,此方法在ImageRecognitionHelper 类中使用,并且该类显示inputRGB 双精度来自FractionRgbData.getFlattenedRgbValues(),可以看到here。据我了解,inputRGB double 数组依次包含图像的红色、绿色和蓝色通道。
希望有人可以对此实现有所了解!
提前致谢,
巴里荷兰
/**
* 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;
}
【问题讨论】:
标签: java image-processing artificial-intelligence neural-network