Ask Your Question

Major Squirrel's profile - activity

2020-10-29 17:31:03 -0600 received badge  Popular Question (source)
2020-06-05 10:56:54 -0600 received badge  Notable Question (source)
2019-06-20 03:53:20 -0600 received badge  Popular Question (source)
2019-05-27 20:59:21 -0600 received badge  Notable Question (source)
2018-07-10 14:51:33 -0600 received badge  Popular Question (source)
2018-07-03 08:11:47 -0600 commented question What is the best way to call set/get V4L2 controls from GStreamer capture ?

I have tried to get the device file descriptor from GStreamer using g_object_get(G_OBJECT(v4l2src), "device-fd", &de

2018-07-03 03:33:36 -0600 asked a question What is the best way to call set/get V4L2 controls from GStreamer capture ?

What is the best way to call set/get V4L2 controls from GStreamer capture ? Good evening, I have implemented a driver (

2018-02-16 08:51:00 -0600 commented question Measuring cv::VideoCapture::read() execution time in milliseconds gives me incorrect fps

Can someone help me on this one ? I still can't figure out what is going on.

2018-02-12 09:55:17 -0600 asked a question Measuring cv::VideoCapture::read() execution time in milliseconds gives me incorrect fps

Measuring cv::VideoCapture::read() execution time in milliseconds gives me incorrect fps Good evening ! I am trying to

2018-02-12 09:26:12 -0600 commented question How to correct/remap a perspective effect after an undistort from camera calibration ?

Hello @abhijit ! I didn't go further as I use findHomography() to get the matrix instead of going with the rotation and

2017-12-03 05:15:12 -0600 commented question How to correct/remap a perspective effect after an undistort from camera calibration ?

@Der Luftmensch I'm sorry to bring an answer two weeks later, I've been quite busy these days. I've tried using findHom

2017-12-03 05:14:22 -0600 commented question How to correct/remap a perspective effect after an undistort from camera calibration ?

@Der Luftmensch I'm sorry to bring an answer two weeks later, I've been quite busy these days. I've tried using warpPer

2017-11-16 18:37:51 -0600 commented question How to correct/remap a perspective effect after an undistort from camera calibration ?

@sjhalayka Sure, here is the the code : https://gist.github.com/MajorSquirrelTVS/c0c455e8c7e66e52b9d3fc8e792169f5 This

2017-11-16 18:37:08 -0600 commented question How to correct/remap a perspective effect after an undistort from camera calibration ?

@sjhalayka Sure, here is the the code : https://gist.github.com/MajorSquirrelTVS/c0c455e8c7e66e52b9d3fc8e792169f5 This

2017-11-16 18:35:16 -0600 edited question How to correct/remap a perspective effect after an undistort from camera calibration ?

How to correct/remap a perspective effect after an undistort from camera calibration ? Good evening, I would like to re

2017-11-16 09:41:12 -0600 edited question How to correct/remap a perspective effect after an undistort from camera calibration ?

How to correct/remap a perspective effect after an undistort from camera calibration ? Good evening, I would like to re

2017-11-16 09:39:28 -0600 asked a question How to correct/remap a perspective effect after an undistort from camera calibration ?

How to correct/remap a perspective effect after an undistort from camera calibration ? Good evening, I would like to re

2017-09-21 17:05:27 -0600 commented question Assertion failed (u->origdata == data) in deallocate, using OpenCL

Hi @berak, I modified my code with your pseudo-code : void performOpenCL(const std::string &imagePath, bool use

2017-09-20 10:46:47 -0600 asked a question Assertion failed (u->origdata == data) in deallocate, using OpenCL

Assertion failed (u->origdata == data) in deallocate, using OpenCL Hello everyone, I am trying to use OpenCL (OpenCV

2016-08-03 04:46:23 -0600 received badge  Student (source)
2016-08-02 11:32:55 -0600 commented question Using OpenCL's opencv API with RK3288 SoC (regarding OpenCL versions)

Ok so it seems that OpenCV requires an OpenCL 1.1 full profile minimum, and the Mali T-760 seems to support OpenCL 1.1 embedded profile.

I did some research and it seems that the only differences between the embedded profile and the full profile is that the former is lowering constant buffer sizes, some allocation size, and is not supporting any 64-bits integers nor integer vectors.

This is pretty annoying because I really want to use OpenCV's transparent API of OpenCL to do some image processing on an embedded device. For now, I didn't receive any information despite the lot of googling I did since few days.

We just received this awesome board and it would be really sad not to be able to use the tools we want on it.

2016-07-29 03:02:40 -0600 asked a question Using OpenCL's opencv API with RK3288 SoC (regarding OpenCL versions)

Good morning,

I'm planning to develop a software using OpenCV 3.1.0 for an embedded Firefly RK 3288, using OpenCL's API to fully consume the hardware acceleration potential of the embedded GPU (which is a Mali T-760).

The thing is that Mali T-760 processor seems to support a specific version of OpenCL which is 1.1, yet the OpenCL's opencv API seems to be based of a 1.2 version.

I was wondering if I could use the OpenCL's opencv API for the Firefly, even if the versions are not matching ?

NB: ARM is giving the OpenCL's SDK which includes the header files and the libraries to use for coding.

Thank you in advance for you time.

EDIT (08/02/2016) : added some infos in comment below.

2016-07-09 05:04:56 -0600 commented answer Remapping contours (vectors of points) with maps from camera calibration (using cv::remap instead of cv::undistortPoints ?)

Thanks you @Tetragramm for your answer. I will take a look into remap and undistortPoints codes on GitHub to try parallelization with it. :)

2016-07-08 08:37:15 -0600 commented question Remapping contours (vectors of points) with maps from camera calibration (using cv::remap instead of cv::undistortPoints ?)

Sorry @Eduardo, I forgot to mention it : it takes a certain amount of time to remap the frame entirely, that is why I am looking for remapping the infos I need only. :)

2016-07-08 04:20:24 -0600 asked a question Remapping contours (vectors of points) with maps from camera calibration (using cv::remap instead of cv::undistortPoints ?)

Hello there,

I have some contours (multiple std::vector of cv::Point) that I get using cv::findContours and I would like to modify the values of each point (meaning remapping the contours) using both maps that I got from cv::fisheye::initUndistortRectifyMap.

Is there any way to use cv::remap with contours as inputs and outputs ? When I try to use it, I get this assertion from matrix.cpp :

OpenCV Error: Assertion failed (d == 2 && (sizes[0] == 1 || sizes[1] == 1 || sizes[0]*sizes[1] == 0)) in create, file /home/lemaker/Documents/opencv-github/modules/core/src/matrix.cpp, line 2363

I am aware of the existence of cv::fisheye::undistortPoints but it seems that cv::remap is optimized for my case (NEON support + parallel_for_) and I don't need to re-calculate the maps matrix each time (as undistortPoints seems to do it by itself), that is why cv::remap would be a good solution.

Thank you in advance for your answer, and have a good day ! :)

2016-07-07 02:52:38 -0600 answered a question Are cv::fisheye::undistortImage and (cv::initUndistortRectifyMap + cv::remap) different ?

See my comment behind @Tetragramm answer : I was using a function from the wrong module !

You get the same result between cv::fisheye::undistortImage and cv::fisheye::initUndistortRectifyMap + cv::remap, but if you use cv::initUndistortRectifyMap + cv::remap it seems that the transformation is contained in the frame (meaning no loss of data, the frame isn't cropped on the corners).

2016-07-07 02:38:18 -0600 commented answer Are cv::fisheye::undistortImage and (cv::initUndistortRectifyMap + cv::remap) different ?

Thank you for pointing me the detailed description of both modules. :)

2016-07-06 09:25:22 -0600 commented answer Are cv::fisheye::undistortImage and (cv::initUndistortRectifyMap + cv::remap) different ?

Hello @Tetragramm, sorry for the delay.

I figured out that I was using the wrong function : I was using cv::initUndistortRectifyMap instead of cv::fisheye::initUndistortRectifyMap

The thing I don't understand is : what is the difference between the fisheye module and the imgproc for these functions ?

2016-07-04 07:59:16 -0600 commented question why am i getting so many roi crashes

@atv Try to insert some debug messages to verify some values, especially srcBGR.cols and srcBGR.rows, what do they tell you ?

2016-07-04 07:44:55 -0600 asked a question Are cv::fisheye::undistortImage and (cv::initUndistortRectifyMap + cv::remap) different ?

Hello there,

I am having trouble understanding the functioning of both processes as written in the title.

I am working with a micro-camera (with which seems a barrel distortion) and I would like to undistort the frames given by the camera. I am not working with the camera calibration at the moment, because the micro-camera vendor (DFRobot) already provides the distortion coefficients for this type of lens. I am just having fun with the different functions for the camera calibration. Here are some basic points that might help to understand:

  • The frame has a size of 640x480.
  • The X center projection is assumed to be 320.
  • The Y center projection is assumed to be 240.
  • The focal length is manually set to 544 (for both fx and fy).
  • The R matrix (the rectification transformation matrix) is set as an identity matrix.
  • The newCameraMatrix is set using cv::getOptimalNewCameraMatrix.

This is a picture taken when I execute my program using cv::fisheye::undistortImage :

image description

I was expecting to get the same result using cv::initUndistortRectifyMap and cv::remap, because the OpenCV documentation for undistortImage stipulates :

The function is simply a combination of fisheye::initUndistortRectifyMap (with unity R ) and remap (with bilinear interpolation).

Here is what I am getting using both functions above :

image description

Why is that ? I don't really understand, I might miss something over there. I can provide some code for further help if needed. :)

Have a good day !

2016-07-04 07:19:28 -0600 commented question why am i getting so many roi crashes

@atv In OpenCV, it seems that the size of a picture has to be inverted according to the matrix initialization. For example, a picture with a size of 640x480 has to be initialized as a matrix like so :

cv::Mat(480, 640, CV_YOUR_DATATYPE);

Are you sure the matrix is well initialized according to the picture size ?

EDIT: It should be helpful if you code give us some example code to help your further. :)

2016-07-04 05:48:41 -0600 commented question why am i getting so many roi crashes

Hello there, could you give us the exact assertion statements ? :)

2016-06-22 03:29:55 -0600 commented question cap.set property is not working in C++

@Cemow Maybe your camera doesn't support 60 fps, or that the frame height must be set before the fps. I know for sure that, in opencv code, frame width/height and fps are set in a special order. Maybe by swapping both lines it would work.

Also, did you check that your camera supports 60 fps ? You could verify it by installing v4l2-ctl and then doing v4l2-ctl -d /dev/video0 --list-formats-ext (change /dev/video0 by your camera of course). It lists all the available size and their framerate !

2016-06-20 08:24:11 -0600 commented answer Is there any range of values for the exposure flag?

@pklab @Sarala Actually, V4L supports CAP_PROP_EXPOSURE. You just have to change the CAP_PROP_AUTO_EXPOSURE setting (which is toggled on "auto" mode by default on many cases) to switch it from "auto" to "manual" :

capture.set(cv::CAP_PROP_AUTO_EXPOSURE, 0.25) // where 0.25 means "manual exposure, manual iris"

Then, you will be able to set CAP_PROP_EXPOSURE correctly.

The CAP_PROP_EXPOSURE setting won't work if you downloaded OpenCV directly from their download page, because their official build lasts from decembrer 2015. The V4L exposure setting has been corrected on april 18th 2016 and thus hasn't been included in the build from the official download page.

2016-06-16 10:21:02 -0600 marked best answer Cannot run a script that executes my opencv program at startup under Linux

Hi there,

I would need some help there.

I'm trying (since this morning) to make a script that can launch my opencv program at startup. The script does work well :

#!/bin/sh

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lemaker/Documents/Project/opencv/install/lib

/home/lemaker/Documents/Project/opencv_program

As you can see (or not), I work on a LeMaker Guitar using Ubuntu Mate.

EDIT: The thing is, the opencv_program doesnt start at startup, trying to check if it had started using htop or top. In fact, I don't even know if my script is ok, I mean : I don't have any mean to check any debug messages or something.

I explored many solutions :

  • Launching my script from /etc/rc.local
  • Launching my script as a Linux service
  • Launching my script with crontab -e
  • Launching my script after X started (in /etc/X11/xinit/xinitrc)

It does just not work. When, in my script, I put some basic commands like creating a file or something, it works. But when I try to launch my program, only its line does not work. I have to export a library path because I compiled opencv as shared libs.

I tried to do it with sudo :

#!/bin/sh

sudo -s <<EOF

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lemaker/Documents/Project/opencv/install/lib

/home/lemaker/Documents/Project/opencv_program

EOF

This does not work too. I suspect that I have to launch my program with specific requirements but I can't find out which ones. Do I need to run my script after X started, or something ? Do you guys have any experience in launching an opencv program at startup ?

Could you please guide me ?

Thank you in advance, and have a good day !

2016-06-16 10:21:02 -0600 received badge  Scholar (source)
2016-06-16 10:20:50 -0600 answered a question Cannot run a script that executes my opencv program at startup under Linux

Thanks to @kbarni, I was able to make it work :

With Ubuntu MATE on Le Maker Guitar (so, specific hardware + distro), putting my application in "Startup Applications" seems to not work at all. I gave a try at Upstart, rc.local and runlevels init, without success. However, I was able to make my own systemd user service to start my application.

This link helped me to build my service step by step : https://www.freedesktop.org/software/... (take a look at the whole help page to use the full potential of systemd)

You should be able to make your service work for a specific user by taking a look at this link : https://bbs.archlinux.org/viewtopic.p...

(Don't know why, hyperlink doesn't work on the forum right now)

2016-06-16 10:15:30 -0600 commented question Cannot run a script that executes my opencv program at startup under Linux

@kbarni Regarding hardware components, I'm not disappointed because it is hard to find good components like Cortex-A9 and PowerVR SGX544 with this price. But you're right, I feel that I have many problems with Ubuntu MATE on this board, + the support is awful (the hotline doesn't even speak english)

For now, I have bad results with opencv but I think that it is my fault : I suppose that I don't use the full potential of this board for opencv. (I need to learn about NEON and VFP + OpenCL hardware acceleration)

2016-06-14 03:28:33 -0600 commented answer Cannot run a script that executes my opencv program at startup under Linux

Hi @kbami

I tried to run my application from "Startup Applications" or as Upstart : it works on my Ubuntu 64 bits but it doesn't on my LeMakerGuitar with Ubuntu MATE arm.

It just doesn't launch, and I don't know why. At first I thought it was opencv fault with dynamic linking, but it seems not. In fact, it seems that it doesn't launch my program because it doesn't start it in any session.

2016-06-13 12:21:03 -0600 commented question Cannot run a script that executes my opencv program at startup under Linux

@berak Edited !