Revision history [back]

// step 1: load the image as grayscale (not color):

// step 2: flatten it to a 1d array:
image = image.reshape(1,1);

// step 3, convert the data to something the ann likes, i'd even prefer float, not int there:
img.convertTo(image, CV_32F); // or CV32S, if you really want int.

// step 1: load the image as grayscale (not color):