Ask Your Question

Alice's profile - activity

2019-04-03 07:28:00 -0500 received badge  Famous Question (source)
2018-01-19 14:51:28 -0500 received badge  Notable Question (source)
2017-09-14 01:54:19 -0500 received badge  Popular Question (source)
2016-12-26 16:56:25 -0500 answered a question ubuntu 16.10, OpenCV build fails - stdlib.h missing

Problem still exists in master branch. The solution which i have found is described here:
https://github.com/opencv/opencv/issu...

In short:

  • solution 1:
    Configure compilation process with following parameter:

cmake -DENABLE_PRECOMPILED_HEADERS=OFF ...

  • solution 2:
    Patch the cmake file (see link above for details).
2016-12-26 16:50:48 -0500 commented answer ubuntu 16.10, OpenCV build fails - stdlib.h missing

@berak thank you for your answer. The problem which I described still occurs. I hace tried that with master branch on 2016.12.02 and again - today (2016.12.26).

2016-12-04 12:00:11 -0500 asked a question ubuntu 16.10, OpenCV build fails - stdlib.h missing

Hello,

I'm trying to build OpenCV on Ubuntu 16.10. The build process is interrupted with the error shown below.

Obviously the file "/usr/include/c++/6/stdlib.h" exists in my system. I have tried this with: OpenCV master branch, OpenCV 3.1.0, 3.0.0, 2.4.13.

Could you please give me some clues what can cause this error and how to solve it? All ideas are welcome :)

...
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/bitstrm.cpp.o
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/rgbe.cpp.o
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/exif.cpp.o
[ 16%] Linking CXX shared library ../../lib/libopencv_imgcodecs.so
[ 16%] Built target opencv_imgcodecs
Scanning dependencies of target opencv_highgui_automoc
[ 16%] Automatic moc for target opencv_highgui
Generating moc_window_QT.cpp
[ 16%] Built target opencv_highgui_automoc
Scanning dependencies of target opencv_highgui_pch_dephelp_automoc
[ 16%] Automatic moc for target opencv_highgui_pch_dephelp
[ 16%] Built target opencv_highgui_pch_dephelp_automoc
Scanning dependencies of target opencv_highgui_pch_dephelp
[ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui_pch_dephelp.dir/opencv_highgui_pch_dephelp.cxx.o
[ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui_pch_dephelp.dir/opencv_highgui_pch_dephelp_automoc.cpp.o
[ 16%] Linking CXX static library ../../lib/libopencv_highgui_pch_dephelp.a
[ 16%] Built target opencv_highgui_pch_dephelp
Scanning dependencies of target pch_Generate_opencv_highgui
[ 16%] Generating precomp.hpp
[ 16%] Generating precomp.hpp.gch/opencv_highgui_RELEASE.gch
In file included from /usr/include/c++/6/bits/stl_algo.h:59:0,
                 from /usr/include/c++/6/algorithm:62,
                 from /home/alice/opencv/opencv-master/modules/core/include/opencv2/core/base.hpp:55,
                 from /home/alice/opencv/opencv-master/modules/core/include/opencv2/core.hpp:54,
                 from /home/alice/opencv/opencv-master/modules/highgui/include/opencv2/highgui.hpp:46,
                 from /home/alice/opencv/opencv-master/build/modules/highgui/precomp.hpp:45:
/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
                         ^
compilation terminated.
modules/highgui/CMakeFiles/pch_Generate_opencv_highgui.dir/build.make:62: recipe for target 'modules/highgui/precomp.hpp.gch/opencv_highgui_RELEASE.gch' failed
make[2]: *** [modules/highgui/precomp.hpp.gch/opencv_highgui_RELEASE.gch] Error 1
CMakeFiles/Makefile2:4061: polecenia dla obiektu 'modules/highgui/CMakeFiles/pch_Generate_opencv_highgui.dir/all' failed
make[1]: *** [modules/highgui/CMakeFiles/pch_Generate_opencv_highgui.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
2016-04-20 04:44:41 -0500 commented answer .yml file reading - complex structure

Works flawlessly - thank you :)

2016-04-20 02:48:13 -0500 received badge  Editor (source)
2016-04-20 02:47:25 -0500 asked a question .yml file reading - complex structure

Good morning everyone,

I wish to read data from .yml file. The structure is a bit deeper than the one showed in the example: http://docs.opencv.org/3.0-rc1/d4/da4...

Keeping same names as in the mentioned example, I have a file like this:

%YAML:1.0
features:
   -
      x: 103
      y: 166
      lbp:
         -
            a: 43
            b: 56
         -
            a: 23
            b: 87
         -
            a: 45
            b: 34
   -
      x: 115
      y: 113
      lbp:
         -
            a: 76
            b: 54
         -
            a: 42
            b: 2
         -
            a: 64
            b: 14
   -
      x: 586
      y: 12
      lbp:
         -
            a: 6
            b: 45
         -
            a: 34
            b: 34
         -
            a: 87
            b: 34

The code which read values x and y is:

FileStorage fs2("test.yml", FileStorage::READ);

FileNode features = fs2["features"];
FileNodeIterator it = features.begin(), it_end = features.end();
int idx = 0;

// iterate through a sequence using FileNodeIterator
for( ; it != it_end; ++it, idx++ )
{
    cout << "feature #" << idx << ": ";
    cout << "x=" << (int)(*it)["x"] << ", y=" << (int)(*it)["y"];
    cout << endl;
}

fs2.release();

My question is - how can I read values a and b ? I know it must be simple, however I can't do that :P

-

2015-08-17 02:22:27 -0500 received badge  Supporter (source)
2015-08-17 02:22:11 -0500 received badge  Scholar (source)
2015-08-06 08:04:25 -0500 commented answer camera rotation and translation based on two images

Thank you for your answer FooBar. I see that cv::solvePNP needs input camera matrix and input vector of distortion coefficients. How can I get these parameters?
EDIT:
I found cv::calibrateCamera() which apears to output what is needed. I will try to use this function.
EDIT 2:
That's exactly what I was looking for :)

2015-08-06 05:56:58 -0500 asked a question camera rotation and translation based on two images

Hello,

I'm just starting my little project in OpenCV and I need your help :) I would like to calculate rotation and translation values of the camera basing on two views of the same planar, square object.

I have already found functions such as: getPerspectiveTransform, decomposeEssentialMat, decomposeHomographyMat. Plenty of tools, but I'm not sure which of them to use in my case.

I have a square object of known real-world dimensions [meters]. After simple image processing I can extract pixel values of the vertices and the center of the square.

Now I would like to calculate the relative rotation and translation of the camera which led to obtain the second of two images:
"Reference view" and "View #n"
(please see below).

Any suggestions will be appreciated :)

  1. Reference view:
    image description
    (center of the object is on the optical axis of camera, the camera-object distance is known)
  2. View #1:
    image description
  3. View #2:
    image description
  4. View #3:
    image description