Old C-style OpenCV types like CvMat: supported until what version of OpenCV?

I am working on a legacy code base that still uses OpenCV 2.3.1. In quite some places, the C-style OpenCV types CvMat and the cvMat function are used.

I am definitely not an OpenCV-guru, but I know that that is old-style OpenCV and one should now use cv::Mat. The note on Basic C Structures and Operations — OpenCV v2.3 documentation confirms that CvMat was already obsolete in OpenCV 2.3.1.

The question that I now have is since what version these old C-style OpenCV types are no longer supported? From what version of OpenCV can one no longer use the CvMat type and functions that use it (e.g. cvMat)? Or is it still possible to use these types with the latest OpenCV?

Looking at OpenCV: Deprecated List I have the impression that CvMat was still in OpenCV 3.4.16. However, looking at OpenCV 4.0 - OpenCV I read

A lot of C API from OpenCV 1.x has been removed.

So based on that, my conclusion would be that CvMat is no longer supported since OpenCV 4.0. Would be nice if somebody could confirm :slight_smile:

yep, all correct.

(sooner or later you’ll have to convert your legacy code, if you want to keep it)
(and the 3.4 branch will be frozen, once 5.0 is out)