Ask Your Question

awknaust's profile - activity

2019-02-24 01:37:03 -0600 received badge  Popular Question (source)
2017-10-09 08:41:16 -0600 received badge  Student (source)
2013-07-16 09:20:36 -0600 received badge  Nice Answer (source)
2013-05-22 07:51:30 -0600 received badge  Nice Answer (source)
2013-03-13 21:04:08 -0600 commented question Get plane image from sphere photo

Think about the globe and 2D maps, a perfect projection is not possible

2013-03-13 12:09:20 -0600 answered a question Regional maxima from python

You'd have to do it by hand. You make a 2D filter which you slide across the image so that each pixel becomes 0 if it is not the maximum in the neighborhood and retains its value otherwise.

2013-03-12 14:53:20 -0600 commented question Problem with camshift on the raspberry

What is the problem exactly?

2013-03-11 23:49:05 -0600 commented question does opencv work on windows 8 ?

It almost certainly does, why not try it out?

2013-03-11 17:31:09 -0600 commented question Slow Processing on Rasberry Pi

It is probably the video encoding that is so expensive, this takes time even for high end PCs. Try using a different codec, or just write raw images and process them later

2013-03-11 10:40:10 -0600 commented question Need help choosing an OS

I would recommend linux just because it tends to be more flexible in what software you can use and how you can configure the OS. Theres probably distros designed to use low resources and low-power, but if you are beginners I would recommend something like debian or ubuntu. Perhaps starting with a headless installation and then adding a lightweight GUI like XFCE.

2013-03-10 16:18:53 -0600 commented question Closed eye detection C++

Train a new classifier to detect closed eyes and then vote between them. Or retrain the classifier to detect open AND closed eyes, and then train another to decide whether the eye is open or closed.

2013-03-10 16:09:53 -0600 commented question Best way to store a Mat object in Android

I'm not sure about android, but OpenCV provides a FileStorage class that allows you to write matrices to text files as XML or YAML. That is usually sufficient. If your Mat can reasonably be represented as an image, you can just save them to pngs as well

2013-03-10 13:38:57 -0600 commented answer Does Mat::create() reallocate when new size is smaller?

Yes so if you wanted to create a sub-matrix you would use that, not create(). By saying create() you are telling it that you no longer care about the rest of the data, so why would OpenCV keep it around? When you have a ROI, it doesn't rule out that you might still be interested in the original.

2013-03-09 19:47:05 -0600 commented answer Help with cvCreatMat

What exactly is the error? did you use the example code they give in the documentation?

2013-03-09 17:35:35 -0600 answered a question Use the 'normalizeAnchor ()'

That function isn't part of the OpenCV API I don't think. It is only used internally. If you really want to use it, you can just copy it from the source code (imgproc/src/precomp.hpp)and probably rename it/put it in a different namespace

2013-03-08 17:58:21 -0600 answered a question Help with cvCreatMat

You are mixing the OpenCV C API (CvMat*) and OpenCV C++ (Mat), something you do not really want to do, at least not like this. If you want to create an image with a 1pixel extra border, its easy theres even a function to do it directly

2013-03-08 13:51:13 -0600 answered a question Does Mat::create() reallocate when new size is smaller?

It will reallocate unless the size is identical. It would be hard to keep track of the data otherwise.

2013-03-08 13:38:20 -0600 answered a question Implement imfilter(matlab) with OpenCV

Short answer : Matlab probably isn't doing what you want. If you look at the documentation for imfilter, it defaults to using a 0-padded border which is nonsense in most scenarios. You can specify the border type to filter2D in OpenCV by passing the last argument, borderType. BORDER_DEFAULT is BORDER_WRAP_101 (which you can read about in the documentation)

Long answer is you do this:

Point anchor( 0 ,0 );
double delta = 0;

float data[2][5] = {{11,11,11,11,11},{11,11,11,11,11}};
float kernel[2][2] = {{2,2},{2,2}};

Mat src = Mat(2, 5, CV_32FC1, &data);
Mat ker = Mat(2, 2, CV_32FC1, &kernel);
Mat dst = Mat(src.size(), src.type());

Ptr<FilterEngine> fe =  createLinearFilter(src.type(), ker.type(), ker, anchor,
        delta, BORDER_CONSTANT, BORDER_CONSTANT, Scalar(0));
fe->apply(src, dst);
cout << dst << endl;

The problem is you can pass BORDER_CONSTANT to filter2D, but it doesnt take the value the constant should be, So instead you have to create a FilterEngine object. Additionally, Matlab anchors its kernel in the top-left corner, unlike the OpenCV's default, in the center

2013-03-08 02:35:09 -0600 answered a question how to find the source code of some functions I want to use in opencv

Download the source, i.e. from http://opencv.org/downloads.html

2013-03-07 14:41:08 -0600 commented question Application Error (0xc0150002) in first project

Are you trying to do a Release build with the debug libraries (they have 'd' at the end of them)?

2013-03-07 10:38:58 -0600 commented question apache not being able to load opencv library

Have you checked whether /usr/local/lib is under the apache user's PATH?

2013-03-05 23:36:20 -0600 commented question Classification methods used in OpenCV

OpenCV is open source, you could just look at/modify the source code!

2013-03-05 21:11:36 -0600 answered a question Converting from JavaCV

According to the documentation, what you should be doing is

Moments m = moments(imgThreshold, true);

In C++ calling new allocates memory for an object and returns a pointer to that object, i.e. the line

m = new Moments();

implies that m's type is "Moments*" not "Moments"

Also to get the moment values, you just get them from the resulting object directly.. m.m00, m.m01 etc.

2013-03-05 18:20:40 -0600 answered a question Brightness variation between cameras

Probably the right way to do this is to somehow access the cameras internal parameters. Other than that, if you can make all 3 cameras point at the same location you could take several sets of 3 identical images and use that to try to train the contrast/brightness adjustments of each, which you can correct when you take new images. This is assuming that the three cameras always have the same relative brightness offsets from one another.

On the other hand, perhaps decomposing the images into HSV and equalizing the mean Value for each image could be an approach. Although this certainly has some drawbacks.

Looking at research into image stitching might also help, I'm sure you aren't the only one with this problem

2013-03-05 18:11:03 -0600 answered a question Cant run my OpenCV first code

Follow the steps described here

Basically the MSVC doesn't like that OpenCV is using fopen, but unless you want to edit OpenCV the only option is to tell MSVC to ignore this problem. The quick fix is to add

#define _CRT_SECURE_NO_WARNINGS

Before you include the opencv header. Alternately you can change this in your project settings.

2013-03-05 15:40:06 -0600 received badge  Nice Answer (source)
2013-03-05 08:16:58 -0600 commented question Trying to detect faces in linux, done it in windows

It would be better if you could run it with a debugger and print the whole traceback of the error. Also indentation would make this much more readable...

2013-03-04 21:37:27 -0600 answered a question Negative Values When Getting Pixels in Java API

You are correct, its because java bytes are thought of as signed, whereas in the image they are unsigned, in [0, 255]

2013-03-04 17:40:15 -0600 commented question BRISK vs ORB vs FREAK

perhaps the best course is to read the research papers on these descriptors or to find a paper that compares the three.

2013-03-04 14:28:28 -0600 received badge  Critic (source)
2013-03-04 08:49:51 -0600 commented question how to run opencv_creatsamples.exe

You probably need to add opencv_core249.dll to your system Path. This means locating it in your OpenCV install and adding that entire directory to your PATH variable in Windows->Advanced Settings.

This is the last step in the installation tutorial

2013-03-02 20:02:47 -0600 answered a question Mouse callback - I wan't to know what I'm doing

setmouseCallback only registers a handler for the window. It doesn't actually call mouse_ev itself. Instead when you click on a point, opencv will call 'mouse_ev' with the event type and the coordinates of the point that was clicked on.

The last argument void* allows you to pass additional arguments to the mouse_ev function when it is called, but it isn't clear from your code how that is happening.

2012-11-07 04:30:41 -0600 marked best answer Copying an SVM

I try the following code in C++ using OpenCV 2.42 and it fails when attempting to copy the svm

include <opencv2/opencv.hpp>
using namespace cv;

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

    Mat trainData(100, 3, CV_32F);
    randu(trainData, 0.0f, 10.f);

    Mat classes = Mat::zeros(100, 1, CV_32F);
    for(int i = 50; i < classes.rows; i++)
        classes.at<float>(i) = 1.0f;

    Mat sample = Mat::ones(1, 3, CV_32F);

    SVM svm;
    svm.train_auto(trainData, classes, Mat(), Mat(), SVMParams(), 2);

    SVM svm2 = SVM(svm);
}

and gives the message (VS2010 Windows XP)

OpenCV Error: Assertion failed (udata < (uchar*)ptr && ((uchar*)ptr - udata) <=
(ptrdiff_t)(sizeof(void*)+16)) in unknown function, file ..\..\..\src\opencv\mod
ules\core\src\alloc.cpp, line 78

Is this a bug, or is there something I am missing about copying an SVM? I expected it to copy the decision function, support vectors, and other parameters, but something seems to be going wrong. I had a look at the source in ml.hpp and it doesn't seem to define a copy constructor.

2012-08-30 22:00:35 -0600 answered a question Does OpenCV have any Online Machine Learning Algorithms?

You can specify UPDATE_WEIGHTS when training a Neural Network in OpenCV to update them instead of completely recompute them

2012-08-07 15:04:00 -0600 answered a question tbb_debug.dll missing, but it's there...

The Library needs to be somewhere on your system path, or in the path of the program. Putting it in the directory with the OpenCV binaries works because you already added that to your PATH variable. You can either move it to a separate folder and add that to your PATH, add it to a directory already in PATH, or add it to the Project folder itself.

2012-08-02 16:20:54 -0600 received badge  Teacher (source)
2012-08-02 14:18:25 -0600 received badge  Editor (source)
2012-08-02 14:17:03 -0600 answered a question Simple Opencv program with link error on

This really sounds like you missed some step of the installation process (the one where you tell your project about *.lib ). Did you read this tutorial? I suggest re-reading it making sure you have followed all steps closely

2012-08-02 13:54:41 -0600 answered a question overflow avoidance on multi-frame accumulation

It looks like you are doing exactly what cv::accumulate does as mentioned in your last question

If you look at the documentation, the Output Array has to be a CV_32F or CV_64F, but the inputs can be 8bit or 16 bit.