Ask Your Question

farzad_1990's profile - activity

2016-09-20 09:22:26 -0600 received badge  Enthusiast
2016-09-18 14:46:31 -0600 asked a question rendering in opencv

I get point cloud's from stereo matching. but I can not to convert to surface (3d).how can I do this???

2016-09-07 05:33:48 -0600 asked a question depth_estimate

hi I want to measure depth with OpenCV Stereo_match algorithms that are available in the examples(Cpp) I use. but Input data can not be detected in below loop: if (argc < 3) { print_help(); return 0; }

Inputs have been introduced in the form below: const char* algorithm_opt = "var"; const char* maxdisp_opt = "1024"; const char* blocksize_opt = "3"; const char* nodisplay_opt = "1"; const char* scale_opt = "1";

and: const char* img1_filename = "left110.jpg"; const char* img2_filename = "right110.jpg"; const char* intrinsic_filename = "C:/Users/farzad/Desktop/camera_calibration/camera_calibration/camera_calibration/intrinsics.yml"; const char* extrinsic_filename = "C:/Users/farzad/Desktop/camera_calibration/camera_calibration/camera_calibration/extrinsics.yml"; const char* disparity_filename = "disparity.jpg"; const char* point_cloud_filename = "point_cloud.xml";

where is the problem from???? thanks.

the complete code is:

/* * stereo_match.cpp * calibration * * Created by Victor Eruhimov on 1/18/10. * Copyright 2010 Argus Corp. All rights reserved. * */

include "opencv2/calib3d/calib3d.hpp"

include "opencv2/imgproc/imgproc.hpp"

include "opencv2/highgui/highgui.hpp"

include "opencv2/contrib/contrib.hpp"

include <stdio.h>

using namespace cv;

static void print_help() { printf("\nDemo stereo matching converting L and R images into disparity and point clouds\n"); printf("\nUsage: stereo_match <left_image> <right_image> [--algorithm=bm|sgbm|hh|var] [--blocksize=<block_size>]\n" "[--max-disparity=<max_disparity>] [--scale=scale_factor>] [-i <intrinsic_filename>] [-e <extrinsic_filename>]\n" "[--no-display] [-o <disparity_image>] [-p <point_cloud_file>]\n"); }

static void saveXYZ(const char* filename, const Mat& mat) { const double max_z = 1.0e4; FILE* fp = fopen(filename, "wt"); for(int y = 0; y < mat.rows; y++) { for(int x = 0; x < mat.cols; x++) { Vec3f point = mat.at<vec3f>(y, x); if(fabs(point[2] - max_z) < FLT_EPSILON || fabs(point[2]) > max_z) continue; fprintf(fp, "%f %f %f\n", point[0], point[1], point[2]); } } fclose(fp); }

int main(int argc, char* argv) { const char algorithm_opt = "--algorithm=sgbm"; const char* maxdisp_opt = "--max-disparity=1024"; const char* blocksize_opt = "--blocksize=3"; const char* nodisplay_opt = "--no-display"; const char* scale_opt = "--scale=1";

if(argc < 3)
{
    print_help();
    return 0;
}
const char* img1_filename = 0;
const char* img2_filename = 0;
const char* intrinsic_filename = 0;
const char* extrinsic_filename = 0;
const char* disparity_filename = 0;
const char* point_cloud_filename = 0;

enum { STEREO_BM=0, STEREO_SGBM=1, STEREO_HH=2, STEREO_VAR=3 };
int alg = STEREO_SGBM;
int SADWindowSize = 0, numberOfDisparities = 0;
bool no_display = false;
float scale = 1.f;

StereoBM bm;
StereoSGBM sgbm;
StereoVar var;

for( int i = 1; i < argc; i++ )
{
    if( argv[i][0] != '-' )
    {
        if( !img1_filename )
            img1_filename = argv[i];
        else
            img2_filename = argv[i];
    }
    else if( strncmp(argv[i], algorithm_opt, strlen(algorithm_opt)) == 0 )
    {
        char* _alg = argv[i] + strlen(algorithm_opt);
        alg = strcmp(_alg, "bm") == 0 ? STEREO_BM :
              strcmp(_alg, "sgbm") == 0 ? STEREO_SGBM :
              strcmp(_alg, "hh") == 0 ? STEREO_HH :
              strcmp(_alg, "var") == 0 ? STEREO_VAR : -1;
        if( alg < 0 )
        {
            printf("Command-line parameter error: Unknown stereo algorithm\n\n");
            print_help();
            return -1;
        }
    }
    else if( strncmp(argv[i], maxdisp_opt, strlen(maxdisp_opt)) == 0 )
    {
        if( sscanf( argv[i] + strlen(maxdisp_opt), "%d", &numberOfDisparities ) != 1 ||
            numberOfDisparities < 1 || numberOfDisparities % 16 != 0 )
        {
            printf("Command-line parameter error: The max disparity (--maxdisparity=<...>) must be a positive integer divisible by 16\n");
            print_help();
            return -1;
        }
    }
    else if( strncmp(argv[i], blocksize_opt, strlen(blocksize_opt)) == 0 )
    {
        if( sscanf( argv[i] + strlen(blocksize_opt), "%d", &SADWindowSize ) != 1 ||
            SADWindowSize < 1 ...
(more)
2016-09-06 15:22:50 -0600 asked a question measure depth

hi I want to measure depth with OpenCV Stereo_match algorithms that are available in the examples(Cpp) I use. but Input data can not be detected in below loop:

if (argc < 3)
{
    print_help();
    return 0;
}

Inputs have been introduced in the form below:

const  char* algorithm_opt = "var";
const  char* maxdisp_opt = "1024";
const  char* blocksize_opt = "3";
const  char* nodisplay_opt = "1";
const  char* scale_opt = "1";

and:

const char* img1_filename = "left110.jpg";
const char* img2_filename = "right110.jpg";
const char* intrinsic_filename = "C:/Users/farzad/Desktop/camera_calibration/camera_calibration/camera_calibration/intrinsics.yml";
const char* extrinsic_filename = "C:/Users/farzad/Desktop/camera_calibration/camera_calibration/camera_calibration/extrinsics.yml";
const char* disparity_filename = "disparity.jpg";
const char* point_cloud_filename = "point_cloud.xml";

where is the problem from???? thanks.

2016-05-27 14:22:40 -0600 received badge  Critic (source)
2016-05-27 14:07:07 -0600 commented answer 'MODE_SGBM_3WAY' is not a member of 'cv::StereoSGBM'

Please explain more precisely.

2016-04-29 16:47:53 -0600 asked a question voluminosity of a substance which is infront of two cameras

Hi I want to calculate the voluminosity of a substance which is infront of two cameras. And my question is this, do we have any program in sampling of opencv? I would be grateful if you send me the entrance as well. And at last again I appreciate if you share me any related program.

Sincerely

2016-02-12 07:06:22 -0600 asked a question calculate volume fruit

I want to calculate volume of a kiwi with opencv and by using two camera . Please tell the details with little steps.

2016-02-12 06:54:30 -0600 asked a question cannot find -lippicv

hi i installed opencv and opencv_contrib from this link(http://embedonix.com/articles/image-processing/installing-opencv-3-1-0-on-ubuntu/) and i linked it with QT by this statment in pro files project(LIBS +=pkg-config opencv --libs). i want to calculate the volume by means of stereo_match(opencv/samples/cpp/stereo_match.cpp) but when i adjust inputs program and run it , give me this errors: ((((((cannot find -lippicv)))) (((((collect2: error: ld returned 1 exit status)))))

2016-02-11 08:19:48 -0600 asked a question 'MODE_SGBM_3WAY' is not a member of 'cv::StereoSGBM'

Dear friends for calculate the volume, I used the stereo_match.cpp file that available in OpenCV3.1.0 (opencv3.1.0 / sampels / cpp/stereo_match.cpp).I wrote the program entries as follows: std::string img1_filename = "/home/farzad/Desktop/mathing/build-matching-Desktop-Debug/left.jpg"; std::string img2_filename = "/home/farzad/Desktop/mathing/build-matching-Desktop-Debug/right.jpg"; std::string intrinsic_filename = "/home/farzad/Desktop/calibration/build-calibration-Desktop-Debug/intrinsics.yml"; std::string extrinsic_filename = "/home/farzad/Desktop/calibration/build-calibration-Desktop-Debug/extrinsics.yml"; std::string disparity_filename = "/home/farzad/Desktop/mathing/build-matching-Desktop-Debug/opencv_storage/disparity.jpg"; std::string point_cloud_filename = "/home/farzad/Desktop/mathing/build-matching-Desktop-Debug/opencv_storage/point_cloud.yml";

But I faced the following error: 'MODE_SGBM_3WAY' is not a member of 'cv::StereoSGBM'

Does anyone know the problem?