Ask Your Question

charles.fox's profile - activity

2019-05-09 10:56:01 -0500 received badge  Popular Question (source)
2018-06-06 13:34:48 -0500 commented answer calibration from points instead of chessboard

thanks -- that's extremely useful !

2018-06-06 13:34:36 -0500 marked best answer calibration from points instead of chessboard

All the camera calibration tools I have found so far are based on chessboards. But I have some data where I know the 3D and 2D locations of a load of non-chessboard points in images (X and Y matrices) and I would like to calibrate for radial distortion and camera matrix directly from them. Do we have a way to do this in CV? Like, perhaps the chessboard functions are calling something internally with X and Y matrices - after doing the chessboard detection -- which I could call directly ? I would like to just call a function callibrateMyCamera(X,Y) with a large number of these known points and get back a 4*3 camera matrix M plus whatever is needed for the radial distortion.

2018-06-06 11:14:10 -0500 edited question calibration from points instead of chessboard

calibration from points instead of chessboard All the camera calibration tools I have found so far are based on chessboa

2018-06-06 11:13:54 -0500 edited question calibration from points instead of chessboard

calibration from points instead of chessboard All the camera calibration tools I have found so far are based on chessboa

2018-06-06 11:12:01 -0500 asked a question calibration from points instead of chessboard

calibration from points instead of chessboard All the camera calibration tools I have found so far are based on chessboa

2018-05-22 17:23:49 -0500 edited question can't open capture from gstreamer loopback

can't open capture from gstreamer loopback This is maybe a bit obscure as it involves a problem with several tools toget

2018-05-22 17:23:24 -0500 edited question can't open capture from gstreamer loopback

can open capture from gstreamer loopback This is maybe a bit obscure as it involves a problem with several tools togethe

2018-05-22 17:22:24 -0500 asked a question can't open capture from gstreamer loopback

can open capture from gstreamer loopback This is maybe a bit obscure as it involves a problem with several tools togethe

2018-03-29 06:46:22 -0500 received badge  Enthusiast
2018-03-28 17:52:00 -0500 received badge  Editor (source)
2018-03-28 17:52:00 -0500 edited question Draw onto CV image with OpenGL commands?

Draw onto CV image with OpenGL commands? I would like to draw some simple augmented reality style 3d graphics over a vid

2018-03-28 17:48:09 -0500 asked a question Draw onto CV image with OpenGL commands?

Draw onto CV image with OpenGL commands? I would like to draw some simple augmented reality style 3d graphics over a vid

2016-08-24 06:39:04 -0500 received badge  Supporter (source)
2016-08-24 04:20:13 -0500 asked a question Move SVM between python and cpp ?

I have trained an OpenCV SVM using the python API but would like to run it in a cpp program. Is there a way to save and import it between the two languages, or would I need to retrain it in cpp ?

2016-07-27 04:59:16 -0500 received badge  Scholar (source)
2016-07-25 16:27:23 -0500 asked a question Read latest live image from webcam, not from queue?

Hi all,

I've been running some speed tests of a webcam-based opencv program and I was surprised to find that a bottleneck seems to be due to cap.read() behaviour for live cams.

My cpp code runs every 0.5 seconds and takes a snapshot from the webcam, displays it on screen, then sleeps till the next time. When I display these images on the screen there is loads of latency, sometimes several seconds.

What I think is happening is that cap.read() isn't reading the latest image from the webcam. Rather, the webcam is running at a higher fps, eg 10fps, determined by its 4vl settings, and storing these images in a buffer. Then cap.read() is only getting the next image from the buffer, as if it was reading from a movie file. As my code only runs twice per second, I'm reading old image from the camera hardware rather than the latest ones. It looks like the buffer holds a few seconds of images, because my latency doesn't get worse than that once the buffer is full.

My webcam doesn't go down to 2fps, I think the lowest is about 10. But regardless of this, I wonder if cv has a function that is like cap.read() but which always returns the latest available live image rather than the next one off the buffer? Something like cap.readlatest() ? Or any other workarounds? At the moment I just call cap.read() five times in a row on each callback, which has just about got rid of the latency. But that's a hack for the particular rates here, I'd prefer a general solution. Maybe there is some way to purge the buffer of all but the latest image? I have googled but can't find the right words for such a thing if it exists.

(Strange I have never noticed this effect before -- all my other cv codes have been driven by the frame rate of the camera, blocking on cap.read, but this is the first time I've needed the timer to come from elsewhere.)