# Problems when converting to latest opencv version

**URL:** <https://forum.opencv.org/t/problems-when-converting-to-latest-opencv-version/3973>\
**Category:** C++\
**Created:** [June 22, 2021, 11:15pm UTC](https://forum.opencv.org/t/problems-when-converting-to-latest-opencv-version/3973 "2021-06-22T23:15:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![simmania](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@simmania](https://forum.opencv.org/u/simmania)\
**Post date:** [June 22, 2021, 11:15pm UTC](https://forum.opencv.org/t/problems-when-converting-to-latest-opencv-version/3973/1 "2021-06-22T23:15:22Z")

</div>

Hi,  
Im trying to convert an older opencv project to the latest (4.5.2) version. I get the following 3 problems.

1: CV\_TERMCRIT\_EPS and CV\_TERMCRIT\_ITER are undefined

2: There is something strange going on with this try-catch

3: This AutoLock gives a problem

See the pictures:

 ![ProblemsOpenCV](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/0/087797cd3327c8e1c24772c9e920c6e09c6f6f42.jpeg)

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [June 22, 2021, 11:20pm UTC](https://forum.opencv.org/t/problems-when-converting-to-latest-opencv-version/3973/2 "2021-06-22T23:20:38Z")

</div>

please, no useless screenshots of code or errors here.  
replace with _TEXT_ , thank you.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 23, 2021, 11:56am UTC](https://forum.opencv.org/t/problems-when-converting-to-latest-opencv-version/3973/3 "2021-06-23T11:56:41Z")

</div>

you already stated that you understand that you’re porting older code.

you stated three problems.

you don’t have a concrete question.

it seems that you don’t know how to deal with those problems.

you should present your own effort into at least understanding those problems.

---

<div class="post-metadata">

**Author:** ![simmania](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@simmania](https://forum.opencv.org/u/simmania)\
**Post date:** [June 23, 2021, 12:33pm UTC](https://forum.opencv.org/t/problems-when-converting-to-latest-opencv-version/3973/4 "2021-06-23T12:33:19Z")

</div>

I hoped somebody would recognize one of the problems and give me advice how to solve it. Isn’t this forum to help people? Yes I always try to solve it myself first. But I seemed to be stucked with these ones.  
And I assumed that pictures say much more then words. Maybe more experienced users get additional info this way because of the information around it.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 23, 2021, 3:54pm UTC](https://forum.opencv.org/t/problems-when-converting-to-latest-opencv-version/3973/5 "2021-06-23T15:54:04Z")

</div>

> [@simmania](#):
>
> And I assumed that pictures say much more then words

he wasn’t asking for prose. he was asking you to copy the text that’s in the pictures. you know why? that allows search engines to find this thread and help others.

anyway, let’s work on the first point: _termination criteria_.

read OpenCV documentation for the function `cornerSubPix`, which uses those things in your code.

then you figure out what needs to be changed. you can guess and try.

report back with what you’ll have tried and what exact results you got.

we can help you a lot but we won’t do your work for you.
