In this example OpenCV gives, the training set is of 250 and testing amount is also the same. However when the testing and training numbers are changed, the accuracy goes down to 0.
# First half is trainData, remaining is testData
train_cells = [ i[:40] for i in cells ]
test_cells = [ i[40:] for i in cells]
train_amt = 200
responses = np.float32(np.repeat(np.arange(10),train_amt)[:,np.newaxis])
I have changed the values in above lines from the original code. What am I doing wrong? And what should x be?
The training and testing data provided with OpenCV: http://wormassay.googlecode.com/svn/trunk/ThirdParty/OpenCV/samples/python2/data/digits.png