0

I want to read my images in a certain order that they are placed because for training my svm classifier the class labeling has been done sequentially but unfortunately my images are not being read sequentially so I'm getting a wrong classifier.

I tried using glob function. Here's the code

for im in glob.glob("/home/essh/Desktop/database/training set/*.jpg"): img = cv2.imread(im)

But this code is not accessing my images sequentially.

Eswar
  • 1,201
  • 19
  • 45
  • Clarify please, show some code, sample input and expected output – Saeid Dec 15 '15 at 16:19
  • please give us the output of `print glob.glob("/home/essh/Desktop/database/training set/*.jpg")` , and what you expect. – Saeid Dec 16 '15 at 13:26
  • I was expecting it to read my images sequentially as they have been placed in my file called training set. – Eswar Dec 21 '15 at 06:38
  • please give us the output of `print glob.glob("/home/essh/Desktop/database/training set/*.jpg")` , and what you expect. – Saeid Dec 21 '15 at 19:48
  • If I have .png files in order a1, a2, a3 ..... in my file training set. I was expecting it to read in the same fashion as a1, a2, a3,..... But its reading a3, a6, a29,.... – Eswar Dec 22 '15 at 09:52
  • http://stackoverflow.com/questions/6773584/how-is-pythons-glob-glob-ordered – Saeid Dec 22 '15 at 16:12

0 Answers0