how can create and check csv file

asked 2018-06-12 05:20:56 -0500

kishan patel gravatar image

Hello, Actually i am following face recognition tutorial for opencv 3.1.0 . Link is as below:

https://docs.opencv.org/3.1.0/da/d60/...

   I have download the sample database file then copy all image into one folder then execute command "python /home/kishan/opencv-2.4.13.6/modules/contrib/doc/facerec/src/create_csv.py /home/kishan/FACE_SAMPLES/

", But i could not see any effect means i think .txt file has not generated.

  So, how can i check that file is created or not?

Thanks and Regards, Kishan Patel.

edit retag flag offensive close merge delete

Comments

it just prints to stdout. you need to pipe it into a txt file, like::

 python create_csv.py /home/kishan/FACE_SAMPLES/  > my.csv

also:

then copy all image into one folder

no, you need a subfolder per person

berak gravatar imageberak ( 2018-06-12 05:29:34 -0500 )edit

Thanks for reply, I had do same thing but can not see any output.

Lets i clarify path:

argv[0]: python
argv[1]: /home/kishan/opencv-2.4.13.6/modules/contrib/doc/facerec/src/create_csv.py
argv[2]: /home/kishan/FACE_SAMPLES/

Here, argv[1] is a python script
         argv[2] is a path which contains database(images)
kishan patel gravatar imagekishan patel ( 2018-06-12 05:38:42 -0500 )edit

Okay, I have made subfolder per person then re-execute command and got output as below: /home/kishan/FACE_SAMPLES/S15/subject15.happy;0 /home/kishan/FACE_SAMPLES/S15/subject15.sleepy;0 . . which i have save in one .txt file and execute command to run application as below: "./facerec_demo csv.txt" But i got error as below: Processing /home/kishan/FACE_SAMPLES/S13/subject13.leftlight /home/kishan/FACE_SAMPLES/S13/subject13.leftlight OpenCV Error: Image step is wrong (The matrix is not continuous, thus its number of rows can not be changed) in reshape, file /home/kishan/opencv-2.4.13.6/modules/core/src/matrix.cpp, line 812 terminate called after throwing an instance of 'cv::Exception'

kishan patel gravatar imagekishan patel ( 2018-06-12 06:10:05 -0500 )edit

what(): /home/kishan/opencv-2.4.13.6/modules/core/src/matrix.cpp:812: error: (-13) The matrix is not continuous, thus its number of rows can not be changed in function reshape

Aborted (core dumped)

Regards, Kishan Patel.

kishan patel gravatar imagekishan patel ( 2018-06-12 06:10:40 -0500 )edit

check, if your csv file has non-images (like thumbs.db, or readme, the like)

oh, and: subject15.sleepy -- sounds like the gif files from yale db. opencv can't read gif's you have to convert those to png or jpg with an external tool.

berak gravatar imageberak ( 2018-06-12 06:14:35 -0500 )edit

Okay, I will update after test. Regards, Kishan Patel.

kishan patel gravatar imagekishan patel ( 2018-06-12 06:35:34 -0500 )edit

I have changed file name. But still same issue occur.

Processing /home/kishan/FACE_SAMPLES/S13/subject13.happy.gif /home/kishan/FACE_SAMPLES/S13/subject13.happy.gif Processing /home/kishan/FACE_SAMPLES/S13/subject13.sleepy.gif /home/kishan/FACE_SAMPLES/S13/subject13.sleepy.gif OpenCV Error: Image step is wrong (The matrix is not continuous, thus its number of rows can not be changed) in reshape, file /home/kishan/opencv-2.4.13.6/modules/core/src/matrix.cpp, line 812 terminate called after throwing an instance of 'cv::Exception' what(): /home/kishan/opencv-2.4.13.6/modules/core/src/matrix.cpp:812: error: (-13) The matrix is not continuous, thus its number of rows can not be changed in function reshape

Aborted (core dumped)

kishan patel gravatar imagekishan patel ( 2018-06-13 01:05:53 -0500 )edit

it means, it could not read an image. again, you have to convert the imagesto png or such, as it cannot read gif files.

berak gravatar imageberak ( 2018-06-13 01:08:30 -0500 )edit

i have also tried to raname by .png , but still same issue occur. I have downloaded database of "Yale Facedatabase A".

Regards, Kishan Patel.

kishan patel gravatar imagekishan patel ( 2018-06-13 01:30:37 -0500 )edit

you don't get it.

don't rename files, but you have to convert them, using a 3rd party image editor, or some library like gd or imagemagic.

berak gravatar imageberak ( 2018-06-13 01:45:11 -0500 )edit