Ask Your Question
0

is 'round' function really needed in opencv\modules\core\src\hal_internal.cpp ?

asked 2017-01-15 00:48:06 -0500

Hi

I built opencv on my windows 7 machine with visual studio 2012. With a fresh clone from git it will not compile because of the 'round'-functions in opencv\modules\core\src\hal_internal.cpp

Source code

 lwork = (int)round(work1); //optimal buffer size

Compiler error:

opencv\modules\core\src\hal_internal.cpp(232): error C3861: 'round': identifier not found

I 'fixed' it by replacing 'round' with 'ceil', and now it compiles and works well.

lwork = (int)ceil(work1); //optimal buffer size

I dont feel comfortable with neither git not opencv to make a pull request. If you give me exact instructions of which git commands I should use I can give it a try, assuming the replacement above is not breaking anything.

edit retag flag offensive close merge delete

Comments

I think it's better to use #ifdef directive

LBerger gravatar imageLBerger ( 2017-01-15 02:59:34 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-01-15 01:51:25 -0500

berak gravatar image

updated 2017-01-15 02:29:51 -0500

yea, sure, go ahead and fix it !

you probably want to raise an issue first, to see, if there's any counter arguments to your idea.

the proper round() replacement might be cvRound(), though (not sure, if earlier VS compilers know about ceil() without including additional headers)

have a look here and here for tips on working out pr's, also feel free to ask on this site, ofc !

best of luck !

edit flag offensive delete link more

Comments

1

and this good post too

LBerger gravatar imageLBerger ( 2017-01-15 02:52:23 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-01-15 00:48:06 -0500

Seen: 333 times

Last updated: Jan 15 '17