Ask Your Question

User's profile - activity

2019-11-04 05:05:15 -0500 received badge  Popular Question (source)
2019-04-13 01:26:20 -0500 received badge  Popular Question (source)
2017-01-14 08:08:46 -0500 commented question OpenCV 3.1 build for windows imshow doesn't work

I build in new directory and it works

2017-01-14 07:19:45 -0500 commented question OpenCV 3.1 build for windows imshow doesn't work

Yes, I update my question

2017-01-14 07:19:00 -0500 received badge  Editor (source)
2017-01-14 06:44:15 -0500 asked a question OpenCV 3.1 build for windows imshow doesn't work

Blockquote

I build OpenCV 3.1 with CMake 3.2.2 with Visual Studio 2013 64 in Windows 7

WITH_WIN32UI flag is set to true

but when I try to imshow I get the following runtime error:

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the li brary with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file D:\libs\opencv 3.1\opencv\sources\modules\highgui\src\window.c pp, line 545

my cmake output is:

sizeof(void) = 4 on x86 / x86_64 processor. Assume 32-bit compilation mode (X86=1) found IPP (ICV version): 9.0.1 [9.0.1] at: D:/libs/opencv 3.1/opencv/sources/3rdparty/ippicv/unpack/ippicv_win Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.7") Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.6") Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.4") Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.2") Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file Caffe: NO Protobuf: NO Glog: NO Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags Tesseract: NO Could NOT find PROTOBUF (missing: PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR) Build libprotobuf from sources: libprotobuf not found into system The protocol buffer compiler not found Tesseract: NO Complex module opencv_contrib_world + opencv_bgsegm + opencv_bioinspired + opencv_ccalib - opencv_cvv + opencv_datasets + opencv_face - opencv_latentsvm + opencv_line_descriptor + opencv_optflow + opencv_reg + opencv_rgbd + opencv_saliency + opencv_surface_matching + opencv_text + opencv_tracking + opencv_xfeatures2d + opencv_ximgproc + opencv_xobjdetect + opencv_xphoto

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

Platform: Host: Windows 6.1 AMD64 CMake: 3.2.3 CMake generator: Visual Studio 12 2013 Win64 CMake build tool: C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe MSVC: 1700

C/C++: Built as dynamic libs?: YES C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio 2012/VC/bin/cl.exe (ver 17.0.50727.1) C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /EHa /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:fast /wd4251 /wd4324 /wd4275 /wd4589 /MP4 /MD /O2 /Ob2 /D NDEBUG /Zi C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /EHa /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:fast /wd4251 /wd4324 /wd4275 /wd4589 /MP4 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 C Compiler: C:/Program Files (x86)/Microsoft Visual Studio 2012/VC/bin/cl.exe C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:fast /MP4 /MD /O2 /Ob2 /D NDEBUG /Zi C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp ...

(more)
2016-05-30 09:12:11 -0500 received badge  Student (source)
2016-04-30 13:38:52 -0500 commented answer Minoru 3d: How to run 2 cameras simultaneously?

@pklab It doesn't work too :((( I was able to capture 640x480 at Linux with libv4l2cam library, but at Windows it doesn't work

2016-04-28 16:17:18 -0500 commented answer Minoru 3d: How to run 2 cameras simultaneously?

@pklab Thank you for detailed explanaition and answer. But as I mentioned I try with 10 FPS even with 5, it says "unable grab from some Cam." because capR.read(imgR) gives false

2016-04-27 11:10:21 -0500 received badge  Organizer (source)
2016-04-27 03:22:22 -0500 asked a question Error during stereocalibration

I streoCalibrate Minoru 3d camera with OpenCV 3.1 and libcamm and I get the following error:

OpenCV Error: One of arguments' values is out of range (The specified aspect ratio (= cameraMatrix[0][0] / cameraMatrix[1][1]) is incorrect) in cvCalibrateCamera2, file /media/DATA1/libs/opencv 3.1/opencv/sources/modules/calib3d/src/calibration.cpp, line 1450 terminate called after throwing an instance of 'cv::Exception' what(): /media/DATA1/libs/opencv 3.1/opencv/sources/modules/calib3d/src/calibration.cpp:1450: error: (-211) The specified aspect ratio (= cameraMatrix[0][0] / cameraMatrix[1][1]) is incorrect in function cvCalibrateCamera2

Though the same code works fine when I do calibration in windows with OpenCV 2.3 with already captured images or standart VideoCapture

2016-04-23 13:09:06 -0500 commented answer Minoru 3d: How to run 2 cameras simultaneously?

Camera supports 640x480 resolution, but at that resolution only one of the cameras works. I. e. capL.read(imgR) gives true and capR.read(imgR) gives false

2016-04-23 09:27:01 -0500 commented answer Minoru 3d: How to run 2 cameras simultaneously?

But it works only for 320x240 resolution. Is it way to work for 640x480?

2016-04-23 07:36:51 -0500 commented answer Minoru 3d: How to run 2 cameras simultaneously?

Thank you very much, it works :)) My problem was, that I didn't specified CV_CAP_DSHOW flag

2016-04-23 07:35:43 -0500 received badge  Scholar (source)
2016-04-23 07:35:42 -0500 received badge  Supporter (source)
2016-04-23 05:29:25 -0500 received badge  Enthusiast
2016-04-21 17:42:34 -0500 asked a question Minoru 3d: How to run 2 cameras simultaneously?

use Minoru 3D stereocamera and want to capture images from left and right camera at the same time with OpenCV. I use Windows 7 64 bit

I have tried all solutions that I found in web, trying it with minoru drivers from CD and without.I try at 640x480 resolution with fps 15, even 5. I tried with standart OpenCV VideoCapture and also with videoInput library. But no one gives the expected result.

How can I run 2 Minoru cameras simultaneously?

2015-05-06 03:12:51 -0500 commented question Get depth map from disparity map

@Eduardo: I do exactly what you say: if( point[2] < 10) this if means that

2015-05-05 14:10:37 -0500 asked a question Get depth map from disparity map

I can't get normal depth map from disparity. Here is my code:

#include "opencv2/core/core.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "opencv2/contrib/contrib.hpp"
#include <cstdio>
#include <iostream>
#include <fstream>

using namespace cv;
using namespace std;

ofstream out("points.txt");

int main()
{
    Mat img1, img2;
    img1 = imread("images/im7rect.bmp");
    img2 = imread("images/im8rect.bmp");

    //resize(img1, img1, Size(320, 280));
    //resize(img2, img2, Size(320, 280));

    Mat g1,g2, disp, disp8;
    cvtColor(img1, g1, CV_BGR2GRAY);
    cvtColor(img2, g2, CV_BGR2GRAY);

    int sadSize = 3;
    StereoSGBM sbm;
    sbm.SADWindowSize = sadSize;
    sbm.numberOfDisparities = 144;//144; 128
    sbm.preFilterCap = 10; //63
    sbm.minDisparity = 0; //-39; 0
    sbm.uniquenessRatio = 10;
    sbm.speckleWindowSize = 100;
    sbm.speckleRange = 32;
    sbm.disp12MaxDiff = 1;
    sbm.fullDP = true;
    sbm.P1 = sadSize*sadSize*4;
    sbm.P2 = sadSize*sadSize*32;
    sbm(g1, g2, disp);

    normalize(disp, disp8, 0, 255, CV_MINMAX, CV_8U);

    Mat dispSGBMscale; 
    disp.convertTo(dispSGBMscale,CV_32F, 1./16); 

    imshow("image", img1);

    imshow("disparity", disp8);

    Mat Q;
    FileStorage fs("Q.txt", FileStorage::READ);
    fs["Q"] >> Q;
    fs.release();

    Mat points, points1;
    //reprojectImageTo3D(disp, points, Q, true);
    reprojectImageTo3D(disp, points, Q, false, CV_32F);
    imshow("points", points);

    ofstream point_cloud_file;
    point_cloud_file.open ("point_cloud.xyz");
    for(int i = 0; i < points.rows; i++) {
        for(int j = 0; j < points.cols; j++) {
            Vec3f point = points.at<Vec3f>(i,j);
            if(point[2] < 10) {
                point_cloud_file << point[0] << " " << point[1] << " " << point[2]
                    << " " << static_cast<unsigned>(img1.at<uchar>(i,j)) << " " << static_cast<unsigned>(img1.at<uchar>(i,j)) << " " << static_cast<unsigned>(img1.at<uchar>(i,j)) << endl;
            }
        }
    }
    point_cloud_file.close(); 

    waitKey(0);

    return 0;
}

My images are:

image description image description

Disparity map:

image description

I get smth like this point cloud: image description

Q is equal: [ 1., 0., 0., -3.2883545303344727e+02, 0., 1., 0., -2.3697290992736816e+02, 0., 0., 0., 5.4497170185417110e+02, 0., 0., -1.4446083962336606e-02, 0. ]

I tried many other things. I tried with different images, but no one is able to get normal depth map.

What am I doing wrong? Should I do with reprojectImageTo3D or use other approach instead of it? What is the best way to vizualize depth map? (I tried point_cloud library) Or could you provide me the working example with dataset and calibration info, that I could run it and get depth map. Or how can I get depth_map from middlebury stereo database (http://vision.middlebury.edu/stereo/d...), I think there isn't enough calibration info.