Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCV 3.x, 4.x no more support IplImage, some codes should be modified. #2

Open
Huixxi opened this issue Dec 9, 2020 · 1 comment

Comments

@Huixxi
Copy link

Huixxi commented Dec 9, 2020

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);
@Huixxi Huixxi changed the title OpenCV 3.x, 4.x is no more support IplImage, some codes should be modified. OpenCV 3.x, 4.x no more support IplImage, some codes should be modified. Dec 9, 2020
@Ldpe2G
Copy link
Owner

Ldpe2G commented Dec 28, 2020

@Huixxi thanks for your advice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants