# How to get more accurate results with OpenCV

I would like to ask about this function in OpenCV:

cvTermCriteria( CV_TERMCRIT_ITER | CV_TERMCRIT_EPS, 20, .3 )


How do I get more accurate results - do I need to increase the value of epsilon or decrease it?

• look at my comment . – rɑːdʒɑ May 21 '13 at 15:51
• (cv.CV_TERMCRIT_EPS, 0, 0.1) then cvterminate when epsilon reaches 0.1 – rɑːdʒɑ May 21 '13 at 16:28

## 1 Answer

This termination criteria tells the algorithm to stop when it has either done 20 iterations or when epsilon is greater than .3. You can play with these parameters for speed vs accuracy but these values work pretty well in many situations.

So if you want to improve accuracy then you will get more accurate value with more iterations but the time taken for doing such iterations will be improved , I mean speed will be reduced.

• if I increase the number of epsilon (.3) I will get more accurate results???? ... or If I reduce it ? – seereen May 21 '13 at 15:24
• No, if epsilon value > .3 then it will stop the operation.The better way to improve accuracy is increase the number iterations, I mean > 20 . – rɑːdʒɑ May 21 '13 at 15:50
• even though I want to know what is the effect of epsilon value , I will try to increase the iteration number – seereen May 21 '13 at 16:03
• epsilon stands here for Required accuracy. you can use both Number of iterations and epsilon values for accuracy. If you place .4 then you will get better accuracy than .3 . – rɑːdʒɑ May 21 '13 at 16:26