Ask Your Question

Elador's profile - activity

2015-07-26 11:46:24 -0500 commented answer QR decomposition in OpenCV

Hmm what, first you describe QR codes, then you link to Eigen's QR decomposition? Very confusing what you're doing here. Actually the question is quite clear - QR decomposition relates to the matrix decomposition, and not to QR codes.

2015-06-30 03:00:04 -0500 commented answer How to perform Linear Discriminant Analysis with OpenCV

Just a quick question, how are you combing the PCA and LDA eigenvectors here, and why? gemm(pca.eigenvectors, leigen, 1.0, Mat(), 0.0, eigenvectors, GEMM_1_T);

2015-06-30 02:54:48 -0500 commented question Probability of correct classification using LDA?

As for your main question, what about using the distance to each cluster center as a score? If that doesn't work so well, try training SVMs?

2015-06-30 02:41:46 -0500 commented question Probability of correct classification using LDA?

Just two random comments: 1) You don't have to initialise trainData with the first image. Just start pushing back. Makes your code easier to understand if you loop from 0 everywhere. 2) std::string filename = "..." - you're copy-constructing a string from const char* here. Best do this: std::string filename("..."), or append 's' to make it a string literal (i.e. "..."s).

2015-01-22 11:55:41 -0500 commented answer RelWithDebInfo build in linux

This doesn't work anymore in >=2.4.8, it always switches back to only building "Release;Debug".

2014-09-22 05:57:03 -0500 commented answer Reshape function

Be careful, Matlabs reshape fills the data by filling the columns first, while OpenCVs reshape fills the rows first.

2013-12-26 08:02:47 -0500 asked a question Cannot create an OpenGL window

The following simple code fails with a

OpenCV Error: OpenGL API call (Can't load OpenGL extension [glGenerateMipmap]) i n IntGetProcAddress, file C:\opencv\2.4.7.2_prebuilt\opencv\sources\modules\core \src\gl_core_3_1.cpp, line 141

I built opencv with 2.4.7.2 with OpenGL enabled. The code below fails on Debug and Release mode, 64bit. I'm on Windows 7 - 64. I updated the graphics drivers (Intel GM45)... What is going wrong?

#include <string>

#include "opencv2/core/core.hpp"

#include "opencv2/highgui/highgui.hpp"

int main(int argc, char* argv[]) {

cv::Mat img = cv::Mat::zeros(640, 480, CV_8UC1);

cv::namedWindow("oglWin", cv::WINDOW_OPENGL);

cv::imshow("oglWin", img); // crash here

return 0;

}

2013-10-29 06:40:55 -0500 commented answer Errors building OpenCV-2.4.6 with Visual Studio 2013

The link to your fork is not working. User jlblancoc doesn't exist. Can you please update?

2013-10-03 18:14:07 -0500 asked a question POSIT in C++ API?

Is there a POSIT in the C++ API of OpenCV? I can only find the cvPOSIT of the old C API, and it's using all the old CvPoint3D32f and stuff, which is kind of ugly.

Also, what about when the old C API becomes deprecated in OCV 3.0?

2013-10-03 12:47:43 -0500 commented answer instaling opencv 2.4.6 in win8 visual studio2012

I was able to remove my down-vote today. Didn't work 2 weeks ago.

2013-09-15 13:01:25 -0500 commented answer instaling opencv 2.4.6 in win8 visual studio2012

Sorry, there's a misunderstanding here. The linked tutorial says "how to easily install OpenCv". But it does not install it, it shows how to make a _own_ project _using_ OpenCv, which is something different. For using OpenCv, of course CMake is not required (yet in my opinion still the easier solution than to add include paths and dozens of .lib's in every project manually). But judging from the initial post ("instaling", "pliz explain [...] tnx"), for that particular user, the linked tutorial indeed seems best. Sadly I cannot remove my down-vote, sorry for that.

2013-09-15 12:56:12 -0500 commented answer Can't see Mat members in the debugger (VS2012)

Can you explain the downvote for suggesting ImageWatch, which is a 5-star vs2012 plugin and a perfect extension to the debugger for showing cv::Mat's?

2013-09-14 20:13:55 -0500 answered a question Can't see Mat members in the debugger (VS2012)

Try ImageWatch, it's a great plugin for looking at cv::Mat's of all kinds (images and matrix-data).

Aside from that, I was never able to see the content of the Mat in text form in the debugger. There's a plus-sign, but it only shows some addresses etc, not the actual values inside the Mat.

2013-09-14 20:08:41 -0500 commented answer instaling opencv 2.4.6 in win8 visual studio2012

Sorry, that's a VERY bad tutorial! You should never do that manually as specified in the tutorial. There is CMAKE. Follow installation instructions with cmake!

2013-09-14 20:07:53 -0500 received badge  Critic (source)
2013-09-12 17:02:25 -0500 commented question Errors building OpenCV-2.4.6 with Visual Studio 2013

I have the same issue with VS2013. The error occurs with both OpenCV 2.4.6-stable and the git-master. The issue occurs in VS2013, but not in VS2012. How can we fix that for VS2013?

2013-07-29 17:56:30 -0500 commented answer Use setOpenGlDrawCallback with a function inside a class?

I was just thinking about the case when I have two windows and two instances MyClass, each having their draw-method bound to one of the windows. But I guess your proposed code also works in that case.

2013-07-29 17:50:34 -0500 commented answer OpenGL interoperability

I don't think that's true, right? I mean why is there a CV_WINDOW_OPENGL and opengl_interop.hpp that specifically allows you to use opencv with opengl (and not viceversa)?

2013-07-26 17:03:05 -0500 commented answer Use setOpenGlDrawCallback with a function inside a class?

Thank you, I perfectly understand the problem now! I was now just wondering, could this be done with boost::bind/function? I've used bind before but only for very simple things, nothing like this.

2013-07-26 12:48:52 -0500 asked a question Use setOpenGlDrawCallback with a function inside a class?

Hi,

When I use

void on_opengl(void* userdata)
{
  // do stuff
}

int main(int argc, char *argv[])
{
  // stuff
  cv::setOpenGlDrawCallback("window", on_opengl, (void *)0);
  // stuff
}

it works fine. But when I try to move the callback-function inside a class:

Header:

namespace mylib {
class MyClass
{
public:
  MyClass();
private:
  void openGlDrawCallbackFunc(void* userdata);
};

CPP:

namespace mylib {

MyClass::MyClass()
{
  // stuff
  cv::setOpenGlDrawCallback("window", openGlDrawCallbackFunc, (void *)0); // errors on this line, on "openGlDrawCallbackFunc"
}

void MyClass::openGlDrawCallbackFunc(void* userdata)
{
  // stuff
}
}

it doesn't compile. The compiler gives the error

error C3867: 'mylib::MyClass::openGlDrawCallbackFunc': function call missing argument list; use '&mylib::MyClass::openGlDrawCallbackFunc' to create a pointer to member

Of course adding the "&" doesn't help. Intellisense shows a slightly different error,

Error: argument of type "void (mylib::MyClass::*)(void *userdata)" is incompatible with parameter of type "cv::OpenGlDrawCallback".

I included "opencv2/core/opengl_interop.hpp" and "opencv2/highgui/highgui.hpp", although the relevant stuff seems to be in highgui.hpp.

What is going wrong here and how can I do this?

2013-04-30 17:50:16 -0500 received badge  Student (source)
2013-04-27 19:40:12 -0500 received badge  Supporter (source)
2013-04-27 19:40:08 -0500 received badge  Scholar (source)
2013-04-26 13:45:15 -0500 commented answer Location of the headers moved?

Yea I generate my .sln also with cmake, but I always point the cmake of my own project to the opencv install dir, not the build-dir, as that's the proper way. But now I understand what you mean - I'll try that if 2.4.5 doesn't satisfy me for some reason, thank you :-)

2013-04-26 13:27:46 -0500 commented answer Location of the headers moved?

Okay, thanks! That probably means for me I'll check out 2.4.5 and use that.

What do you mean with your suggestion "1."? I don't understand at all what you mean.

Concerning "2.", I never did that anyway! I always included the module headers, but as written above, their location has changed too.

I did not get any errors while compiling, what do you mean with am I "still" getting errors - maybe you confuse me with someone else?

2013-04-26 12:42:08 -0500 received badge  Editor (source)
2013-04-26 12:40:43 -0500 asked a question Location of the headers moved?

Hiho,

a few weeks ago, I pulled opencv from git and compiled using cmake & vs2012. On my laptop, after compiling and running the INSTALL target, I get a structure like

`C:\opencv\install\include\opencv2\<moduleName>\someHeader.hpp`, e.g.
`C:\opencv\install\include\opencv2\core\core.hpp`.

In my code, I could then just #include "opencv2/core/core.hpp" and it was working perfectly in windows, linux, with people who used the downloadable-precompiled opencv - so all the paths seem to be right.

When pulling opencv from git today on another computer, also with cmake and vs2012, after compiling and INSTALL'ing, I get one folder

`C:\opencv\install\include`

and all the headers are just in there. There are no module subfolders. All headers are just in the "root". There is still a opencv2 subfolder there but it contains only 2 files. Of course, now my project fails compiling, as it can't find the includes under #include "opencv2/core/core.hpp".

I compiled opencv so many times, always used the same steps and never had this problem. What could possible be gone wrong on this computer?

Thanks!