Skip to content

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

@Huixxi

Description

@Huixxi

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions