Ask Your Question

Lucas Walter's profile - activity

2019-12-09 08:12:22 -0600 received badge  Notable Question (source)
2018-12-02 06:41:46 -0600 received badge  Famous Question (source)
2017-07-25 10:29:36 -0600 received badge  Notable Question (source)
2016-12-24 09:15:39 -0600 received badge  Popular Question (source)
2016-11-15 09:49:20 -0600 received badge  Nice Question (source)
2016-03-31 23:48:09 -0600 received badge  Popular Question (source)
2016-02-19 16:53:53 -0600 answered a question How do I load an OpenCV generated yaml file in python?

I ended up following this: http://stackoverflow.com/questions/28..., though I only needed to skip the first line, the rest of my yamls are not opencv data types, just strings and numbers and dicts and lists.

2016-02-19 16:42:16 -0600 commented answer How do I load an OpenCV generated yaml file in python?

It's more than just an array, it is a bunch of key value pairs. cv2.cv.Load on my yamls produce The node does not represent a user object (unknown type?) errors.

2016-02-17 16:42:39 -0600 answered a question camera_calibration.cpp fisheye calibration aborted

Setting <Write_extrinsicParameters> to 0 avoids the problem and allow the calibration to finish.

I also discovered I needed to bootstrap the calibration using the intrinsic guess in order to get that reprojection error down to something reasonable.

2016-02-17 12:36:32 -0600 asked a question camera_calibration.cpp fisheye calibration aborted

I'm trying out fisheye calibration with samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp. I've adapted the example VID5.xml file, then calibrated without fisheye, and get a 1.36 pixel reprojection error. Next I added <Calibrate_UseFisheyeModel>1</Calibrate_UseFisheyeModel>, and get an exception:

Re-projection error reported by calibrateCamera: 282.075
Calibration succeeded. avg re projection error = 282.075
OpenCV Error: Assertion failed (rvecs[i].rows == 3 && rvecs[i].cols == 1) in saveCameraParams, file /home/lwalter/other2/opencv_latest/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp, line 611
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/lwalter/other2/opencv_latest/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp:611: error: (-215) rvecs[i].rows == 3 && rvecs[i].cols == 1 in function saveCameraParams

Aborted (core dumped)

This is using the latest source, I could try going back to a release though I'll have to track down when the useFisheye logic was added to camera_calibration.cpp. I'll run this through a debugger as well.

2014-04-07 18:09:43 -0600 answered a question findCirclesGrid frequently finds edges of circles rather than centers

Oops this is the result of applying cornerSubPix to circle grid results...

2014-04-07 17:40:16 -0600 asked a question findCirclesGrid frequently finds edges of circles rather than centers

The original file:

image description

The results of findCirclesGrid with a width of 5, height of 9, and cv::CALIB_CB_ASYMMETRIC_GRID:

image description

Should it be doing this poorly (2.4.6)?

I'm going to experiment with adaptive thresholding or some other preprocessing to see if it can improve the results.

2014-04-03 16:46:05 -0600 asked a question How do I load an OpenCV generated yaml file in python?

It appears that OpenCV is writing yaml 1.0 but PyYaml only wants to read yaml 1.1 (http://pyyaml.org/#Whatimplementationshouldyouuse and http://stackoverflow.com/questions/12058510/xml-or-yml-parsing-in-opencv-with-python). Do I just need a script to reformat the yaml so it doesn't generate errors like expected alphabetic or numeric character, but found ':' on the first line %YAML:1.0, or is there a better way to go about loading the files?

I've tried cv2.cv.load(filename) but it generates and error about not finding xml tags (opencv 2.4.6 and whatever python-opencv bindings are provided in Ubuntu 13.10).

2014-02-12 15:10:34 -0600 commented answer How to find the intersection point of two lines

It would be good to use std::abs or fabs or the epsilon check will fail if not using namespace std.

2013-01-15 13:09:53 -0600 asked a question Per pixel labeling in distanceTransform?

It would be really convenient if this function worked like

  cv::distanceTransform(mask, dist, labels, distance_type, 3, DIST_LABEL_PIXEL);

and then within a double for loop on y and x

  const int label = labels.at<int>(y,x);
  const int label_x = label % width;
  const int label_y = label / width;

But instead the label is dependent on the non-zero pixels in the mask input (the label only increments when pixels are zero), so I have to manually build up a mapping between labels and pixel coordinates to find out where the labeled pixels actually are- or is there an easier way?

I'd take this to the dev zone but code.opencv.org appears to be down.

In my somewhat old git version of opencv disttransform.cpp:

   else    // it would be nice if DIST_LABEL_PIXEL was here for clarity
   {
   int k = 1;
   for( int i = 0;  i < src->rows; i++ )
   {
      const uchar* srcptr = src->data.ptr + src->step*i;
      int* labelptr = (int*)(labels->data.ptr + labels->step*i);

      for( int j = 0; j < src->cols; j++ )
        // it would be nice to get rid of 
        // this conditional and 
        // always increment labelptr, but then 
        // would the icvDistanceTransformEx_5x5_C1R
        // be messed up?
         if( srcptr[j] == 0 ) 
            labelptr[j] = k++;
      }
  }

  icvDistanceTransformEx_5x5_C1R( src->data.ptr, src->step, temp->data.i, temp->step,
                    dst->data.fl, dst->step, labels->data.i, labels->step, size, _mask );
2013-01-15 12:50:35 -0600 received badge  Scholar (source)
2012-11-28 18:28:23 -0600 received badge  Supporter (source)
2012-11-28 18:27:09 -0600 asked a question Is calling morphologyEx() with with MORPH_ERODE the same as erode()?

And correspondingly does calling it with MORPH_DILATE the same as dilate()?

2012-10-18 20:52:45 -0600 received badge  Nice Answer (source)
2012-09-05 14:04:40 -0600 received badge  Teacher (source)
2012-09-05 13:33:21 -0600 received badge  Self-Learner (source)
2012-09-05 12:44:38 -0600 answered a question What is the easiest way to display a cv::Mat in a decoration free full-screen window?

Here is a decoration free fullscreen (which I overlooked before) which doesn't quite answer my question but may be suitable for now:

cv::setWindowProperty("mywindow", WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN);

This always fullscreens on the monitor that has the menus on it in a multi monitor setup which is not ideal- I want the fullscreen output to be on a screen that is uncluttered by menus because the point of it is to be a presentation output. Changing the which monitor has the menus is a matter of dragging the menu in the Ubuntu System Settings | System Tools | Displays dialog.

2012-09-01 04:43:46 -0600 received badge  Student (source)
2012-08-31 14:15:03 -0600 received badge  Editor (source)
2012-08-31 14:13:54 -0600 asked a question What is the easiest way to display a cv::Mat in a decoration free full-screen window?

Being able to remove window decoration (the bar with the minimize/maximize buttons and name, and any window border) from a highgui namedWindow would be ideal, but that doesn't seem possible.

I'm currently considering using SDL which I think SDL_NOFRAME and SDL_SetVideoMode() solves my problem, but I'm curious if there is a faster or easier way. I don't want it to be too difficult to convert the cv::Mat to the new format, and it should also be high performance (low-latency and 10s of fps framerate).

This is using Linux and X windows, and the latest 2.4 OpenCV with Qt and OpenGL built in, so making X, Qt, or OpenGL calls would be acceptable.