Ask Your Question

Doha's profile - activity

2016-06-09 03:45:49 -0600 received badge  Enthusiast
2016-06-05 09:20:37 -0600 commented question unable to read image using opencv-2.4.13

if you mean the image name ,yes it is right

2016-06-03 19:42:06 -0600 received badge  Editor (source)
2016-06-03 19:39:26 -0600 asked a question unable to read image using opencv-2.4.13

I have statically cross compiled opencv-2.4.13 for ARM. I use this command to compile my code :

 g++  cppcode.c  -L/Desktop/opencvBuild -lopencv_highgui -lopencv_imgproc -lopencv_core -L/Desktop/opencvBuild/3rdparty/lib -llibpng  -lz -lm -lpthread -o ocv

here is the code:

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

    using namespace std;
    using namespace cv;


    int main(int argc, char *argv[])
    {   

    Mat image = imread("puzzle.png");
      if(image.empty()){
    cout<<"No image found";
        return -1;
} 
      waitKey();

     return 0;
}

The image is in the same directory but I always receive the" no image found" message . why it is unable to read the image ?

Update: I added

cout << getBuildInformation() << endl;

and here is the output

General configuration for OpenCV 2.4.12.2 =====================================
  Version control:               unknown

  Platform:
    Host:                        Linux 3.19.0-58-generic x86_64
    Target:                      Linux armv5l
    CMake:                       3.5.2
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/make
    Configuration:               Release

  C/C++:
    Built as dynamic libs?:      NO
    C++ Compiler:                /Desktop/buildroot-Final/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-g++  (ver 4.9.3)
    C++ flags (Release):         -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static -static  -fPIC   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static -static  -fPIC   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                 /Desktop/buildroot-Final/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc
    C flags (Release):           -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static  -fPIC   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static  -fPIC   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):
    Linker flags (Debug):
    Precompiled headers:         NO

  OpenCV modules:
    To be built:                 core flann imgproc highgui features2d calib3d ml objdetect video contrib legacy photo stitching superres ts videostab
    Disabled:                    gpu nonfree world
    Disabled by dependency:      -
    Unavailable:                 androidcamera dynamicuda java ocl python viz

  GUI: 
    QT:                          NO
    GTK+ 2.x:                    NO
    GThread :                    NO
    GtkGlExt:                    NO
    OpenGL support:              NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                       /Desktop/buildroot-Final/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib32/libz.a (ver 1.2.8)
    JPEG:                        NO
    PNG:                         NO
    TIFF:                        NO
    JPEG 2000:                   NO
    OpenEXR:                     NO

  Video I/O:
    DC1394 1.x:                  NO
    DC1394 2.x:                  NO
    FFMPEG:                      NO
      codec:                     NO
      format:                    NO
      util:                      NO
      swscale:                   NO
      resample:                  NO
      gentoo-style:              NO
    GStreamer:                   NO
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    PvAPI:                       NO
    GigEVisionSDK:               NO
    UniCap:                      NO
    UniCap ucil:                 NO
    V4L/V4L2:                    NO/NO
    DirectShow:                  NO
    XIMEA:                       NO
    Xine:                        NO ...
(more)
2016-05-29 09:06:47 -0600 received badge  Scholar (source)
2016-05-29 07:18:57 -0600 asked a question cannnot statically compile opencv code

Hello, I have statically cross compiled opencv-2.4.13 for ARM , the installation directory is /Desktop/opencv-build. now I am trying to compile a simple opencv code that displays an image using this command:

/arm-buildroot-linux-uclibcgnueabi-g++ opencv.cpp -L/Desktop/opencv-build/lib/libopencv_highgui.a -L/Desktop/opencv-build/lib/libopencv_imgproc.a -L/Desktop/opencv-build/lib/libopencv_core.a -o ocvccode

I then get this error message

opencv.cpp:(.text+0x7c): undefined reference to cv::imread(std::string const&, int)' opencv.cpp:(.text+0xc8): undefined reference tocv::namedWindow(std::string const&, int)' opencv.cpp:(.text+0x118): undefined reference to cv::_InputArray::_InputArray(cv::Mat const&)' opencv.cpp:(.text+0x12c): undefined reference tocv::imshow(std::string const&, cv::_InputArray const&)' opencv.cpp:(.text+0x14c): undefined reference to cv::waitKey(int)' /tmp/ccksKPb6.o: In functioncv::Mat::~Mat()': opencv.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x3c): undefined reference to cv::fastFree(void*)' /tmp/ccksKPb6.o: In functioncv::Mat::release()': opencv.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x58): undefined reference to `cv::Mat::deallocate()' collect2: error: ld returned 1 exit status

how to solve this and is there is any other way to statically compile opencv code for ARM?