Ask Your Question

redfood's profile - activity

2020-10-04 07:38:36 -0600 received badge  Popular Question (source)
2013-08-17 15:31:32 -0600 received badge  Scholar (source)
2013-08-17 15:30:10 -0600 commented question SimpleBlobDetector bug?

That was it! The solution was generated by CMake so I didn't think to check the libs (but obviously I the CMake file setup incorrectly). Thank you. (If you want, post this as an answer, I can mark it as accepted so you can get the Karma).

2013-08-16 18:31:41 -0600 answered a question Traffic Jam Detection

If you do simple frame differencing between frame you should get a basic idea of how much movement you have. If they are not moving or moving very slowly you will have a lot less change than if they are moving quickly.

If you need something more sophisticated you can use optic flow to estimate the movement in the image.

2013-08-16 18:24:17 -0600 received badge  Editor (source)
2013-08-16 18:23:47 -0600 asked a question SimpleBlobDetector bug?

I am using SimpleBlobDetector from OpenCV 2.45 (32-bit) with VS 2010 under windows 7.

When I compile and run my code in VS's debug configuration everything works fine.

When I compile and run my code in VS's release configuration the call to detect crashes with the following error:

image description

Here is the relevant code:

cv::SimpleBlobDetector::Params params;
params.thresholdStep = 60;
params.minThreshold = 60;
params.maxThreshold = 255;
params.minDistBetweenBlobs = 4.5;

params.filterByColor = true;
params.blobColor = 255;

params.filterByArea = true;
params.minArea = 4;
params.maxArea = 100;

params.filterByCircularity = false;

params.filterByInertia = false;

params.filterByConvexity=false;

blobDetector = new cv::SimpleBlobDetector(params);

and then

   cv::Mat myImage
   ... some image processing here ...
   std::vector<cv::KeyPoint> keypoints;
   blobDetector->detect(myImage, keypoints);

and boom. The call to detect crashes (only .

Any ideas or suggestions (beyond always compiling with debug)?

Thanks in advance!

2013-07-22 16:54:58 -0600 commented question cv::threshold crash

That did it! Converting everything to CV_32F fixed the problem. Is this an OpenCV bug or did I miss something in the documentation that says you need to yous 32F? (If you want some Karma, answer the question and I'll accept it).

2013-07-22 16:46:09 -0600 commented question cv::threshold crash

Yes. The input image is CV_16UC1. All the other Mats are just created as cv::Mat background; cv::Mat foreground; cv::Mat difference; cv::Mat thresh; In the header. I assume this uses the default constructor. I'll try to explicitly set their size and types and see if that makes a difference.

2013-07-22 15:57:29 -0600 commented question cv::threshold crash

Why? The src was origionaly 16UC1 and I scale down the color space. What is wrong woth that? Like I said, I call I show on the other images and they look fine. Then threshold crashed.

2013-07-22 14:52:46 -0600 asked a question cv::threshold crash

I hope I'm doing something idiotic and there is a simple fix for this but, every time I try to take a threshold on an image it crashes.

I'm trying to do simple background subtraction and then take a threshold on the resultant image (to later use as a mask). Here is the relevant code:

src.convertTo(src, CV_8UC1, 1.0/256.0, 0);

if(firstFrame) { 
    src.copyTo(background);
    firstFrame = false;
}
cv::addWeighted(src, .001, background , .999, 0, background);
cv::absdiff(src, background, difference);
cv::threshold(difference, thresh, 100, 1, cv::THRESH_BINARY);

src, background,difference, and thresh are all created as cv::Mat In the header.

The code crashes on the last like when I try the call to cv::theshold. I can call imshow on src, background, and difference and they all look reasonable.

I'm using OpenCV 2.4.5 under c++ using VS2010.

Any help or suggestions would be appreciated.