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
OpenCVBridge Compile error ITK 5.1RC1 #1651
Comments
Is this issue still open? #1650 might have touched it. |
@Hicham-Damae solution worked for ITK 5.0.1 and OpenCV 4.2.0 too. |
Can either of you turn it into a PR? |
Hi, I was having the same error with ITK 5.2.0 and OpenCV 4.3.0 (latest stable version of both). The solution proposed by @Hicham-Damae works for me too. This is due to the fact that IplImage has been deprecated in OpenCV for quite a long time now. It was eventually removed in version 4.0.0 and only remains in the C API. The fix works because it is explicitely invoking the C API. This however, is only a temporary fix because the OpenCV C API is likely to be completely removed in future versions (it is already absent from the documentation as of version 4.3.0 - see https://docs.opencv.org/4.3.0/ - although it appears to be still accessible). |
This fixes issue #1651 in a lasting manner by introducing specific implementations for functions CVMatToITKImage and ITKImageToCVMat that no longer depend on the legacy C API while avoiding unnescessary memory copies. This also fixes issue #1906 by adding support for int pixel type (IPL_DEPTH_32S in the legacy C API, CV_32S in the C++ API) for both OpenCV legacy C and C++ APIs. In addition, exceptions for pixel/component type mismatches and impossible conversions were added to both IplImageToITKImage and CVMatToITKImage functions. Some extra functions had to be introduced to ensure minimal code duplication/redundancy.
Description
I managed to compile ITK 5.1RC1 with OpenCV Bridge, after some corrections (already fixed on master or ongoing).
Everything works pretty well, except when I use OpenCVImageBridge function.
I have the folowing error :
C:\Program Files\ITK\Release\include\ITK-5.1\itkOpenCVImageBridge.hxx(98): error C2440: 'initializing': cannot convert from 'const cv::Mat' to 'const IplImage'
I fixed this error using
on line 98 (itkOpenCVImageBridge.hxx)
Versions
OpenCV 4.2
ITK 5.1RC1
Environment
Windows 10 x64
MSVC 2019 16.4
Additional Information
The text was updated successfully, but these errors were encountered: