Ask Your Question

benzwt's profile - activity

2014-04-28 07:47:15 -0500 received badge  Student (source)
2014-03-30 12:46:56 -0500 answered a question building openCV 2.4.2 on OS X 10.9 fails

adrian, thanks for solving the problem, but your description is no clear and not detail. would you please describe you solution more clearly ?

Thanks!

2014-03-30 11:18:33 -0500 asked a question failed to make opencv.git with gcc48 on macosx mavericks

I forked the repos, and clone a copy on my computer, my OS is macosx maverick and the gcc version is 4.8

I just failed to make the fresh opencv, the error messages are as below, It is the matter of the gcc ?

In file included from /Users/benzene/works/OpenCV/opencv/modules/core/include/opencv2/core.hpp:52:0,
                 from /Users/benzene/works/OpenCV/opencv/modules/highgui/include/opencv2/highgui.hpp:46,
                 from /Users/benzene/works/OpenCV/opencv/modules/highgui/src/precomp.hpp:45,
                 from /Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:43:
/Users/benzene/works/OpenCV/opencv/modules/core/include/opencv2/core/base.hpp:228:35: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
 #   pragma GCC diagnostic ignored "-Winvalid-noreturn"
                                   ^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm: In function 'void cvDestroyAllWindows()':
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:199:23: error: expected ';' before 'in'
     for(NSString *key in list) {
                       ^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:199:23: error: 'in' was not declared in this scope
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:199:26: error: expected ';' before 'list'
     for(NSString *key in list) {
                          ^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:199:26: warning: for increment expression has no effect [-Wunused-value]
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm: In function 'void cvShowImage(const char*, const CvArr*)':
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:31: error: expected ';' before 'in'
             for(NSString *key in [window sliders]) {
                               ^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:31: error: 'in' was not declared in this scope
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:42: error: expected ']' before 'sliders'
             for(NSString *key in [window sliders]) {
                                          ^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:42: error: expected ';' before 'sliders'
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:42: error: 'sliders' was not declared in this scope
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:49: error: expected ')' before ']' token
             for(NSString *key in [window sliders]) {
                                                 ^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:49: error: expected primary-expression before ']' token
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:49: error: expected ';' before ']' token
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:27: warning: unused variable 'key' [-Wunused-variable]
             for(NSString *key in [window sliders]) {
                           ^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm: In function 'const char* cvGetWindowName(void*)':
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:435:23: error: expected ';' before 'in'
     for(NSString *key in windows) {
                       ^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:435:23: error: 'in' was not declared in this scope
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:435:26: error: expected ';' before 'windows'
     for(NSString *key in windows) {
                          ^
/Users/benzene/works/OpenCV ...
(more)
2014-03-30 10:45:07 -0500 received badge  Editor (source)
2014-03-30 05:46:13 -0500 asked a question failed to make opencv with tbb42 on macosx Mavericks

I installed mac version of tbb42_20140122oss on my macbook pro which running on Mavericks. I tried to install opencv-2.4.8 with tbb enabled. (after issuing the cmake with -DWITH_TBB=ON), the report shown "with TBB YES". PS: I'm using gcc4.8

mkdir debug
cmake -DWITH_TBB=ON -DENABLE_SSE3=ON -DENABLE_SSSE3=ON -DENABLE_SSSE3=ON -DENABLE_SSE42=ON -DBUILD_EXAMPLES=ON -DBUILD_NEW_PYTHON_SUPPORT=ON -DBUILD_PERF_TESTS=ON -DINSTALL_C_EXAMPLES=NO -DINSTALL_PYTHON_EXAMPLES=ON  -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/usr/local -G "Unix Makefiles" ..
make

However I was unable to make the opencv, it died at

In file included from /usr/local/include/tbb/combinable.h:32:0,
                 from /usr/local/include/tbb/tbb.h:49,
                 from /Users/benzene/works/OpenCV/opencv-2.4.8/modules/core/include/opencv2/core/internal.hpp:179,
                 from /Users/benzene/works/OpenCV/opencv-2.4.8/modules/highgui/src/precomp.hpp:50,
                 from /Users/benzene/works/OpenCV/opencv-2.4.8/modules/highgui/src/window_cocoa.mm:43:
/usr/local/include/tbb/enumerable_thread_specific.h: In instantiation of 'static _opaque_pthread_t* tbb::interface6::internal::ets_base<ETS_key_type>::key_of_current_thread() [with tbb::ets_key_usage_type ETS_key_type = (tbb::ets_key_usage_type)1u; tbb::interface6::internal::ets_base<ETS_key_type>::key_type = _opaque_pthread_t*]':
/usr/local/include/tbb/enumerable_thread_specific.h:173:54:   required from 'void* tbb::interface6::internal::ets_base<ETS_key_type>::table_lookup(bool&) [with tbb::ets_key_usage_type ETS_key_type = (tbb::ets_key_usage_type)1u]'
/usr/local/include/tbb/enumerable_thread_specific.h:281:36:   required from here
/usr/local/include/tbb/enumerable_thread_specific.h:98:70: warning: declaration of 'id' shadows a global declaration [-Wshadow]
                tbb::tbb_thread::id id = tbb::this_tbb_thread::get_id();
                                                                      ^
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_cocoa.mm.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2

could somebody helps me out ?

2013-09-03 00:49:59 -0500 asked a question the correct use of "step"

I was trying to use draw a gradient image(kind of gimp style) using "step". But the result turn out to be wrong. Could anyone give me some hints ?

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main( int argc, char** argv )
{
    Mat img;
    Scalar a = 0;
    img = Mat(32, 32, CV_8UC1, a);
    unsigned char *p;
    for(int i=0; i<img.rows; i++)
    {
         p = img.data + i*img.step[0];
         for(int j=0; j<img.cols; j++, p++)
         {
            *p = j;
         }
    }
    imwrite("gradient.png", img);
    return 0;
  }
2013-09-02 20:32:25 -0500 received badge  Critic (source)
2013-09-02 20:07:02 -0500 commented question how do I draw a gradient image with internal data structure(step) of opencv

thanks for the reply. But there is some mis-understanding, the gradient image I mentioned is some kind of gimp style gradient image. Please kindly check the code above. thanks!

2013-09-02 04:26:01 -0500 asked a question how do I draw a gradient image with internal data structure(step) of opencv

I was trying to draw a gradient image with opencv's step But the result was wrong. Could someone give me some hints ? thanks!

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main( int argc, char** argv )
{
    Mat img;
    Scalar a = 0;
    img = Mat(32, 32, CV_8UC1, a);
    unsigned char *p;
    for(int i=0; i<img.rows; i++)
    {
        p = img.data + i*img.step[0];
        for(int j=0; j<img.cols; j++, p++)
        {
                *p = j;
        }
    }
    imwrite("gradient.png", img);
    return 0;
  }