Ask Your Question

antithing's profile - activity

2020-04-05 11:46:38 -0500 commented question Using findHomography to create 'fake' intrinsics?

Is this the correct approach? //test normailse points std::vector<cv::Point2f> outputUndistortedPoints; c

2020-04-04 10:26:50 -0500 commented question Using findHomography to create 'fake' intrinsics?

Hi, thank you for getting back to me. Can you please explain the second option for me? How do I compute the image coordi

2020-04-04 08:29:12 -0500 edited question Using findHomography to create 'fake' intrinsics?

Using findHomography to create 'fake' intrinsics? I have two images from very different cameras. cv::Mat CameraA is fr

2020-04-04 05:44:24 -0500 asked a question Using findHomography to create 'fake' intrinsics?

Using findHomography to create 'fake' intrinsics? I have two images from very different cameras. cv::Mat CameraA is fro

2020-03-20 06:35:55 -0500 received badge  Teacher (source)
2020-03-20 06:17:35 -0500 marked best answer Detecting ChAruco board using example code, strange result.

I am using the following code, pulled straight from the tutorials:

void detectCharucoBoardWithoutCalibration(cv::Mat image)
{

    cv::Ptr<cv::aruco::Dictionary> dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_6X6_1000);
    cv::Ptr<cv::aruco::CharucoBoard> board = cv::aruco::CharucoBoard::create(7, 5, 0.04f, 0.02f, dictionary);
    cv::Ptr<cv::aruco::DetectorParameters> params = cv::aruco::DetectorParameters::create();
    params->cornerRefinementMethod = cv::aruco::CORNER_REFINE_NONE;
        cv::Mat  imageCopy;
        image.copyTo(imageCopy);
        std::vector<int> markerIds;
        std::vector<std::vector<cv::Point2f> > markerCorners;
        cv::aruco::detectMarkers(image, board->dictionary, markerCorners, markerIds, params);
        //or
        //cv::aruco::detectMarkers(image, dictionary, markerCorners, markerIds, params);
        // if at least one marker detected
        if (markerIds.size() > 0) {
            cv::aruco::drawDetectedMarkers(imageCopy, markerCorners, markerIds);
            std::vector<cv::Point2f> charucoCorners;
            std::vector<int> charucoIds;
            cv::aruco::interpolateCornersCharuco(markerCorners, markerIds, image, board, charucoCorners, charucoIds);
            // if at least one charuco corner detected
            if (charucoIds.size() > 0)
                cv::aruco::drawDetectedCornersCharuco(imageCopy, charucoCorners, charucoIds, cv::Scalar(255, 0, 0));
        }
        cv::imshow("out", imageCopy);
        cv::imwrite("data/markers.jpg", imageCopy);
        cv::waitKey(1);

}

instead of the expected corners, I get this result:

image description

What is going wrong here? Why are my corners not aligned?

I have tried other images, and i see the same thing.

Thank you!

2020-03-20 06:16:53 -0500 received badge  Self-Learner (source)
2020-03-20 05:53:37 -0500 answered a question Detecting ChAruco board using example code, strange result.

Ah, as usual, user error. I was passing the number of squares in the format that findChessboard needs, using the inner

2020-03-20 05:52:14 -0500 commented question Detecting ChAruco board using example code, strange result.

Hi, thanks for your reply. As in the image above, the corner points are misaligned. However, I have just figured this ou

2020-03-20 05:07:55 -0500 asked a question Detecting ChAruco board using example code, strange result.

Detecting ChAruco board using example code, strange result. I am using the following code, pulled straight from the tuto

2020-03-19 10:37:45 -0500 asked a question Detecting ChAruco board using example code, strange result.

Detecting ChAruco board using example code, strange result. I am using the following code, pulled straight from the tuto

2020-03-02 10:54:41 -0500 received badge  Popular Question (source)
2020-02-16 21:38:23 -0500 received badge  Notable Question (source)
2020-02-06 08:03:04 -0500 answered a question Return both solutions from solvePnp cv::SOLVEPNP_IPPE_SQUARE?

Ah, this will do it. solvePnPGeneric instead of regular solvePnP. std::vector<cv::Vec3d> rvecsVec, tvecsVec;

2020-02-06 07:41:24 -0500 edited question Return both solutions from solvePnp cv::SOLVEPNP_IPPE_SQUARE?

Return both solutions from solvePnp cv::SOLVEPNP_IPPE_SQUARE? I have a PnP function that uses solvePnP with the cv::SOLV

2020-02-06 07:37:30 -0500 asked a question Return both solutions from solvePnp cv::SOLVEPNP_IPPE_SQUARE?

Return both solutions from solvePnp cv::SOLVEPNP_IPPE_SQUARE? I have a PnP function that uses solvePnP with the cv::SOLV

2019-12-16 04:46:32 -0500 commented question Calculating depth with Ptr<StereoSGBM>, black bar on image

Hi, thank you for your answers. I am successfully creating a point cloud, using this: float fx = 284.492615; float

2019-12-12 05:35:38 -0500 asked a question Calculating depth with Ptr<StereoSGBM>, black bar on image

Calculating depth with Ptr<stereosgbm>, black bar on image I have a calibrated fisheye stereo pair that I am using

2019-12-08 21:29:00 -0500 received badge  Self-Learner (source)
2019-12-05 08:23:36 -0500 answered a question cv::fisheye::stereoRectify giving black image.

Setting the cx and cy values manually to the real middle of the image size has helped me here. Creating the Projection

2019-12-04 11:07:29 -0500 edited question cv::fisheye::stereoRectify giving black image.

cv::fisheye::stereoRectify giving black image. I am trying to create a depth map from a fisheye stereo camera. I have in

2019-12-04 10:52:18 -0500 asked a question cv::fisheye::stereoRectify giving black image.

cv::fisheye::stereoRectify giving black image. I am trying to create a depth map from a fisheye stereo camera. I have in

2019-11-28 11:02:21 -0500 asked a question Get 3d point from clicked depth map pixel?

Get 3d point from clicked depth map pixel? I have a depth map, from the Zed stereo camera. I need a function that gives

2019-10-29 05:09:29 -0500 marked best answer triangulate 3d points from a stereo camera and chessboard.

Hi, I have a calibrated stereo camera, so i have the extrinsics, intrinsics and dist cooeffs.

I have a chessboard, and using :

bool findChessboardCornersAndDraw(Mat inputLeft, Mat inputRight) {
    _leftOri = inputLeft;
    _rightOri = inputRight;
    bool foundLeft = false, foundRight = false;
    cvtColor(inputLeft, inputLeft, COLOR_BGR2GRAY);
    cvtColor(inputRight, inputRight, COLOR_BGR2GRAY);
    foundLeft = findChessboardCorners(inputLeft, boardSize, cornersLeft, CALIB_CB_ADAPTIVE_THRESH | CALIB_CB_NORMALIZE_IMAGE);
    foundRight = findChessboardCorners(inputRight, boardSize, cornersRight, CALIB_CB_ADAPTIVE_THRESH | CALIB_CB_NORMALIZE_IMAGE);
    drawChessboardCorners(_leftOri, boardSize, cornersLeft, foundLeft);
    drawChessboardCorners(_rightOri, boardSize, cornersRight, foundRight);
    _leftOri = displayMode(_leftOri);
    _rightOri = displayMode(_rightOri);
    if (foundLeft && foundRight) {
        return true;
    }
    else {
        return false;
    }
}

I get the chessboard points. What i need to do now, is write a function that returns the 3d triangulated coordinates of those points, in relation to the camera.

Is there a function existing that will do this for me? Should I use:

cv::triangulatePoints(cam0,cam1,cam0pnts,cam1pnts,pnts3D);

Thank you!

2019-10-29 04:50:59 -0500 received badge  Notable Question (source)
2019-09-30 08:25:59 -0500 asked a question test transform between two cameras with projectPoints?

test transform between two cameras with projectPoints? I have a stereo calibrated camera pair, so i have known intrinsic

2019-09-29 11:47:24 -0500 marked best answer cv::Mat imread to unsigned short*?

I am trying to replace the following function with opencv: (from: https://github.com/stevenlovegrove/Pa...)

  uint64_t loadDepthFromPath(std::string filepath, pangolin::Image<unsigned short> & depth)
    {

        pangolin::TypedImage depthRaw = pangolin::LoadImage(filepath, pangolin::ImageFileTypePng);

        pangolin::Image<unsigned short> depthRaw16((unsigned short*)depthRaw.ptr, depthRaw.w, depthRaw.h, depthRaw.w * sizeof(unsigned short));

        for (unsigned int i = 0; i < 480; i++)
        {
            for (unsigned int j = 0; j < 640; j++)
            {
                depth.RowPtr(i)[j] = depthRaw16(j, i) / 5;
            }
        }

        uint64_t time = getCurrTime();
        return time;
    }

This returns a pangolin::Image<unsigned short>, that is then passed to a function:

initModel(depth.ptr);

where depth.ptr is unsigned short *

I am trying to remove pangolin from this, and use opencv instead.

So I load the same image:

     std::string frame1 = "rgbd_dataset_freiburg1_desk/depth/1305031453.374112.png";

Mat img1;
img1 = imread(frame1, 0);

convert it to unsigned short:

    cv::Mat mat_ushort1(img1.cols,img1.rows, CV_16UC1);
img1.convertTo(mat_ushort1, CV_16UC1);

Then use the pointer to the data to pass to the function:

initModel((unsigned short*)mat_ushort1.data);

The problem is, I see a very different result when I use this method. Where am i going wrong here? How can I replicate the pangolin function with openCv?

thank you.

2019-09-07 07:34:17 -0500 received badge  Notable Question (source)
2019-08-28 01:42:16 -0500 received badge  Popular Question (source)
2019-08-21 12:28:56 -0500 commented question Calculate extrinsics between two cameras using FindHomography?

Hi, using new images did indeed help, but I ended up going with a stereo calibration type approach, adding bundle adjust

2019-08-16 06:45:54 -0500 commented question Calculate extrinsics between two cameras using FindHomography?

Thank you! I cannot sync them, it's true. I will try to use a static chessboard, and adjust the focus / lighting conditi

2019-08-14 10:03:11 -0500 edited question Calculate extrinsics between two cameras using FindHomography?

Calculate extrinsics between two cameras using FindHomography? I have two cameras with different lenses and resolutions.

2019-08-14 10:02:35 -0500 commented question Calculate extrinsics between two cameras using FindHomography?

Hi, I just noticed an error in the code I uploaded, the read should be: cv::Mat frame1_2 = cv::imread("frames/frame

2019-08-14 07:24:23 -0500 commented question Calculate extrinsics between two cameras using FindHomography?

Sure, you can grab the intrinsics and frames here: https://drive.google.com/file/d/1GJo_D4MTiAKlYU3kQduHIbhG2klg1j_S/vi

2019-08-14 07:23:28 -0500 edited question Calculate extrinsics between two cameras using FindHomography?

Calculate extrinsics between two cameras using FindHomography? I have two cameras with different lenses and resolutions.

2019-08-14 07:07:40 -0500 edited question Calculate extrinsics between two cameras using FindHomography?

Calculate extrinsics between two cameras using FindHomography? I have two cameras with different lenses and resolutions.

2019-08-14 06:37:45 -0500 edited question Calculate extrinsics between two cameras using FindHomography?

Calculate extrinsics between two cameras using FindHomography? I have two cameras with different lenses and resolutions.

2019-08-14 06:36:20 -0500 commented question Calculate extrinsics between two cameras using FindHomography?

Hi, that is correct. i have updated the question with more code to show what I am doing. the relative rotation and trans

2019-08-13 04:16:30 -0500 commented question Calculate extrinsics between two cameras using FindHomography?

Hi, thanks for your reply. My default setup, which I am having trouble getting a good result with, is camera A at 1920 x

2019-08-13 03:55:50 -0500 commented question Calculate extrinsics between two cameras using FindHomography?

Hi, thanks for your reply. My default setup, which I am having trouble getting a good result with, is camera A at 1920 x

2019-08-13 03:34:19 -0500 commented question Calculate extrinsics between two cameras using FindHomography?

Hi, thanks for your reply. My default setup, which I am having trouble getting a good result with, is camera A at 1920 x

2019-08-12 10:26:21 -0500 asked a question Calculate extrinsics between two cameras using FindHomography?

Calculate extrinsics between two cameras using FindHomography? I have two cameras with different lenses and resolutions.

2019-08-12 06:53:32 -0500 received badge  Popular Question (source)
2019-07-26 16:51:20 -0500 commented question Fisheye undistorted image, does the camera matrix change?

Ah I thought they were the same! I will try that. Thanks!

2019-07-26 12:41:35 -0500 asked a question Fisheye undistorted image, does the camera matrix change?

Fisheye undistorted image, does the camera matrix change? I am trying to run solvePnP on a series of pre-mapped AruCo ma

2019-05-07 08:38:28 -0500 asked a question Triangulate points from a calibrated fisheye camera pair

Triangulate points from a calibrated fisheye camera pair I have a stereo camera pair, made up of fisheye lenses. I have

2019-05-02 05:43:00 -0500 received badge  Popular Question (source)