If you want to compile and run those code with a higher version opencv(opencv 3.x+), you should change the following lines of code:
|
img = cvLoadImage(path, CV_LOAD_IMAGE_GRAYSCALE); |
|
|
|
change = cvCreateImage(cvGetSize(img), IPL_DEPTH_64F, img->nChannels); |
|
cvConvertScale(img, change, 1.0/255, 0); |
|
bmtx = new cv::Mat(change); |
|
InImgs.push_back(*bmtx); |
with:
cv::Mat img = cv::imread(path, CV_LOAD_IMAGE_GRAYSCALE);
img.convertTo(img, CV_64F, 1.0 / 255.0);
InImgs.push_back(img);
If you want to compile and run those code with a higher version opencv(opencv 3.x+), you should change the following lines of code:
PCANet/cpp_version/main.cpp
Lines 52 to 57 in d48d888
with: