Ask Your Question
0

How does logging work in the stitching_detailed example?

asked 2014-07-14 04:44:18 -0600

updated 2014-07-14 04:45:50 -0600

berak gravatar image

Hi, I'm new to opencv and c++ as well. I was going through the stitching detailed sample which comes with opencv 2.4.9. I saw that there is some code for timing the functions in between #if ENABLE_LOG and also there are some lines using "LOGLN()" . Looking at them, i kind of figured out what they do. But how do I enable them? And where will I see the output? Will it be on stdout? I tried adding "#undef ENABLE_LOG" followed by "#define ENABLE_LOG 1" but I couldn't see any output from those lines. I also checked the opencv2/stitching/detail/util.hpp file where they seem to be defined but couldn't figure out what was going on. Are they IDE specific? (I'm using Xcode 5)

edit retag flag offensive close merge delete

Comments

"Are they IDE specific?" - no, they even will work on stupid apple gadgets.

berak gravatar imageberak ( 2014-07-14 04:53:40 -0600 )edit

Thanks! But where do i see the output of LOGLN()? and also, is #undef ENABLE_LOG followed by #define ENABLE_LOG 1 the right way to use it?

aneeesh gravatar imageaneeesh ( 2014-07-14 04:57:04 -0600 )edit
1

you probably have to enable it before including utils.hpp, so if there's a way to set preprocessor macros in your ide, add it there.

berak gravatar imageberak ( 2014-07-14 05:10:12 -0600 )edit

Thanks! Just adding preprocessor macro didn't work. I had to edit the header file a bit and it worked!

aneeesh gravatar imageaneeesh ( 2014-07-14 14:16:01 -0600 )edit

Could you please tell me how to adding the preprocessor macro? I try add "cgicc.h"and cgidefs.h and util.hpp, and add #undef ENABLE_LOG #define ENABLE_LOG 1 But still doesn't work, could you please help me?

Tobyzhong gravatar imageTobyzhong ( 2016-03-21 11:49:12 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-06-21 12:46:21 -0600

I had the same question and doing some research I found the answer. Add this to CMakeLists:

add_definitions(-DENABLE_LOG=1 )
edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-07-14 04:44:18 -0600

Seen: 1,631 times

Last updated: Jul 14 '14