I have read the documentation of opencv regarding image processing but I am still pretty new to opencv. I am trying to convert some images into matrix so that I can do some classification after that. Can anyone help tell me how I should start this? Thanks so much!
Asked
Active
Viewed 5,090 times
1
-
2This link could help you http://stackoverflow.com/questions/7762948/how-to-convert-an-rgb-image-to-numpy-array . – MAYANK SHARMA Oct 28 '16 at 04:02
1 Answers
1
If you simply read an image with opencv in python, you will get it in a matrix. Eg.:
import cv2
img = cv2.imread('a.jpg',0)
type(img)
Out[3]: numpy.ndarray
img.shape
Out[4]: (200, 200)

quantummind
- 2,086
- 1
- 14
- 20