Ask Your Question

Rupan's profile - activity

2018-03-08 07:02:03 -0600 received badge  Supporter (source)
2018-03-04 06:40:14 -0600 edited answer Facial recognition run error: Image step is wrong

Giving the absolute path worked. Thank you very much for your help. Also the pixel size of all the photos that are to be

2018-03-04 06:40:14 -0600 received badge  Editor (source)
2018-03-02 22:17:51 -0600 received badge  Self-Learner (source)
2018-03-02 07:54:21 -0600 marked best answer Facial recognition run error: Image step is wrong

I am a beginner in opencv and using opencv 2.4.13.6 for facial recognition. For this, i am following the official documentation of the opencv. The link to the tutorial is:

https://docs.opencv.org/2.4/modules/c...

The tutorial uses the fisherface algorithm. So firstly, i collected some frontal face photos of a person then, used the create_csv.py code given in the tutorial to make the csv file from the command prompt. The output returned by the command prompt, i copied them and saved to a text file named 'Face'.

Then i copied the code from the tutorial.

Then, i built the solution(i am using visual studio 2017). after the solution was built, I opened the command prompt from the location where the exe file was created. and typed the following:

D:\Face Recognition\x64\Debug>Face_Recognition.exe C:\old_opencv\opencv\sources\data\haarcascades\haarcascade_frontalface_default.xml D:\Face.txt 0

but a pop window appeared which said '' DEBUG ERROR!! program D:\Face Recognition\x64\Debug\Face_Recognition.exe abort() has been called (Please retry to debug the application)." and the command prompt also said:

"OpenCV Error: Image step is wrong (The matrix is not continuous, thus its number of rows can not be changed) in cv::Mat::reshape, file C:\build\2_4_winpack-build-win64-vc14\opencv\modules\core\src\matrix.cpp, line 812"

i searched for the solution on google and found out one solution. it said i needed to replace the line 30 of the code i.e.

images.push_back (imread(path,0));

with

Mat m = imread(path,1); Mat m2; cvtColor(m,m2,CV_BGR_GRAY); images.push_back(m2);

Thats why i replaced the line in visual studio but the visual studio says CV_BGR_GRAY: no such identifier and didnot build. i need help of what is going on and how do i fix it?

2018-03-02 07:53:33 -0600 commented question Facial recognition run error: Image step is wrong

Giving the absolute path worked. Thank you very much for your help.

2018-03-02 06:22:46 -0600 commented question Facial recognition run error: Image step is wrong

You are right.after replacing the code i got this error: Images\s1/rupan0.png could not be read ! what should i do now?

2018-03-02 04:48:49 -0600 asked a question Facial recognition run error: Image step is wrong

Facial recognition run error: Image step is wrong I am a beginner in opencv and using opencv 2.4.13.6 for facial recogni