Ask Your Question

OpenCV 4 and TermCriteria CV_TERMCRIT_ITER [closed]

asked 2020-11-26 08:27:48 -0500

marius gravatar image


I am using OpenCV and Android Ndk. I recently upgraded from OpenCV 3.5.0 to OpenCV 4.5.0 and I have some errors:

I have this line here:

kmeans(samples, nbClusters, clusters, TermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS, 10000, 0.0001), nbAttempts, KMEANS_PP_CENTERS, centers );

that throws this errors:

error: use of undeclared identifier 'CV_TERMCRIT_ITER'
error: use of undeclared identifier 'CV_TERMCRIT_EPS'

Can somebody help to find a solution ? thank you

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by marius
close date 2020-11-26 08:52:48.264603


OpenCV have moved to remove the CV_ prefixed

supra56 gravatar imagesupra56 ( 2020-11-26 08:46:15 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2020-11-26 08:52:35 -0500

marius gravatar image

I used TermCriteria::MAX_ITER|TermCriteria::EPS and it works

edit flag offensive delete link more


Glad u solved problem

supra56 gravatar imagesupra56 ( 2020-11-26 09:02:23 -0500 )edit

Question Tools

1 follower


Asked: 2020-11-26 08:27:48 -0500

Seen: 2,842 times

Last updated: Nov 26 '20