Ask Your Question

Revision history [back]

Using pictures as input to ML module?

I'd like to compare the performance of all the various machine learning algorithms on a visual classification problem. I have my own training and test images but I'm not sure how to pass them to the ML algorithms. Some examples I have seen just use imported xml files. How could pictures possibly be converted to xml? Should I somehow convert my jpg images to xml? Or am I supposed to make an xml of features (such as grayscale values)? I came across this Member Function Documentation and it seems that images must be passed as arrays. What should be the format of these arrays? According to this the arrays can be mat or vectors but since my training data will have multiple images, there will be multiple mats/vectors so does that mean I pass an array of mats (or an array of vectors)? Do I make such an array from mats that are concatenated horizontally or vertically? What if I want to pass HSV values for the machine learning algorithms? Every sample of training data would have three dimensions then so what would the format of the input array be then?

If there's a guide, example or a tutorial I should look at, please let me know.