Note that there are some explanatory texts on larger screens.

plurals
  1. PODoes Neuroph Image Recognition Plugin correctly convert RGB images to Black/White?
    primarykey
    data
    text
    <p>I have a question regarding the <code>FractionRgbData</code> class of Neuroph ImageRecognition of Neuroph 2.6. I do not fully understand the implementation of the static <code>FractionRgbData.convertRgbInputToBinaryBlackAndWhite(double[] inputRGB)</code> method (see a copy of the method below). More specifically, I do not understand why the length of the input array is divided by 3 in the for-loop condition and the for-loop variable <code>i</code> is also incremented with 3 every iteration? I would think dividing the input array by 3 should be enough.</p> <p>Note that this method is used in the <a href="http://neuroph.svn.sourceforge.net/viewvc/neuroph/tags/neuroph-2.6/src/org/neuroph/contrib/imgrec/ImageRecognitionHelper.java?revision=1271&amp;view=markup" rel="nofollow"><code>ImageRecognitionHelper</code></a> class and this class shows that the <code>inputRGB</code> double comes from the <code>FractionRgbData.getFlattenedRgbValues()</code> which can be seen <a href="http://neuroph.svn.sourceforge.net/viewvc/neuroph/tags/neuroph-2.6/src/org/neuroph/contrib/imgrec/FractionRgbData.java?revision=1271&amp;view=markup" rel="nofollow">here</a>. As far as I could understand the <code>inputRGB</code> double array contains the red, green and blue channel of the image one after another.</p> <p>Hopefully someone can shed some light on this implementation!</p> <p>Thanks in advance,</p> <p>Barry NL</p> <pre><code>/** * 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&lt;inputRGB.length/3; i+=3) { if (inputRGB&gt;0) inputBinary = 0; else inputBinary = 1; } return inputBinary; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload