Ask Your Question

JackGold1's profile - activity

2017-06-07 03:30:43 -0600 commented question Create ROI from a set of points > 4

Have you tried using a polygon to specify the ROI? https://stackoverflow.com/questions/1...

2017-04-26 08:10:07 -0600 commented question detective find particular shapes on an image

You can use http://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#matchshapes (matchShapes()) function, so firstly just take a test image which only contains the shape that you would like to detect, then find the contours of that shape and then simply read in the second image where you would like to detect the shape in and find all the contours in that image and use the matchShapes() function and pass all the contours of that image and the contour of the shape alone as parameters to the function

2017-04-24 10:30:31 -0600 asked a question Fisheye distortion correction using Omnidir namespace - change of perspective

I have been able to correctly calibrate a 180 degrees FOV camera (fisheye), i.e. I have been able to extract the distortion and camera matrices using the omnidirectional model, so I used the omnidir::calibrate() function to extract the matrices and used the omnidir::undistortImage() function for undistorting the images.

Everything works well, but I would like to change the angle at which the undistort is done, i.e. the angle at which the camera is viewing when the image is undistorted. To get a better idea of what I am after please check this link: paulbourke.net/dome/fish2/ (4th image down - looking right by 40 degrees) something similar to that. I have tried changing the cx value in the Knew matrix but that doesn't have the desired effect.

Any help would be greatly appreciated.

2017-04-20 10:25:24 -0600 commented answer Fisheye lens calibration using OpenCV returning zero valued distortion matrix

I tried the omnidirectional model using the omnidir namespace, thank you for pointing me in that direction. I have been able to extract the camera and distortion matrices, as a result, I have been able to correctly undistort the image. Just one question, do you know how I can change the angle at which the undistorted image is looked at. I want to do something similar to this http://paulbourke.net/dome/fish2/ where the resulting image (undistorted) is looked at from an 80-degree angle. I have tried altering the cameraParameters "Knew" in the omnidir::undistortImage() function but that simply just changes the centre point and other things but it doesn't actually give me a view from an angle. Any help would be greatly appreciated.

2017-04-20 10:16:39 -0600 received badge  Enthusiast
2017-03-31 01:11:22 -0600 commented answer Fisheye lens calibration using OpenCV returning zero valued distortion matrix

Thanks for your response, will give that a try and let you know how that goes.

2017-03-29 09:10:58 -0600 received badge  Editor (source)
2017-03-29 08:31:55 -0600 commented question Fisheye lens calibration using OpenCV returning zero valued distortion matrix

I have found a GitHub issue opened for this which reported similar problems: https://github.com/opencv/opencv/issues/7008

2017-03-29 08:31:47 -0600 commented question Fisheye lens calibration using OpenCV returning zero valued distortion matrix

Link to checkerboard images: https://github.com/derlunz/opencv-fisheye-calibration-set

2017-03-29 08:31:15 -0600 asked a question Fisheye lens calibration using OpenCV returning zero valued distortion matrix

I am doing all the usual for calibrating a fisheye lens, I have 22 images that return true using the findChessboardCorners() function, I concatenate the points into a vector<vector<Point2f>> which I use for the calibrate function.

I have altered my code which was using the standard model (worked flawlessly) to accommodate the fisheye model provided by OpenCV under the fisheye:: namespace and now the fisheye::calibrate() function returns a camera matrix with valid results. However, the distortion Mat that is returned is just full of zeros.

Here are the main components of the code:

Populating the vector<Point3f> object:

vector<vector<Point2f>> imagePoints;
vector<vector<Point3f>> objectPoints;
vector<Point3f> obj;
int boardCols = 15;
int boardRows = 9

for(int j=0;j<boardCols*boardRows;j++)
    obj.push_back(Point3f(j/boardCols, j%boardCols, 0.0f));

Finding the corners of the checkerboard:

QString dir = ""; // Path to checkerboard images

QDirIterator it(dir, QDir::Files, QDirIterator::Subdirectories);

while (it.hasNext())
{

    Mat inputImage = imread(it.next().toStdString());

    vector<Point2f> ptvec;

    bool found = findChessboardCorners( inputImage, Size(boardCols,boardRows), ptvec,  CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FILTER_QUADS);

    if(found==true){
        objectPoints.push_back(obj);
        imagePoints.push_back(ptvec);
    }
}

Trying to extract the distortion and camera matrices:

Mat distCoeffs = Mat::ones(4, 1, CV_64F);
Mat cameraMatrix = Mat::eye(3, 3, CV_64F);
vector<Mat> rvecs, tvecs;

double rms = fisheye::calibrate(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, fisheye::CALIB_FIX_SKEW | fisheye::CALIB_RECOMPUTE_EXTRINSIC);
2016-11-25 04:59:34 -0600 commented question Detecting a pebble in videos

Yeah I guess a gray camera would be better, but I am not looking for a colour detection solution, I want to see whether I can either do shape recognition or object detection.

2016-11-24 19:27:08 -0600 asked a question Detecting a pebble in videos

I would like to detect a pebble in videos, the image below is an example of how the pebble(s) look like. I would ideally like to detect and track the pebbles. What is the best approach to solving this problem?

image description

  • The approach needs to be computationally inexpensive as it needs to be able to run on a mobile device
  • The background will not be of a uniform colour - like it is in the image, the background will be dynamic
  • Only need to detect and track a single pebble
  • Don't want to use colour for detection as lighting conditions will be varied
  • I am able to obtain multiple images of the pebble for training purposes

Any help will be greatly appreciated.