Ask Your Question

morphogencc's profile - activity

2018-09-14 19:03:36 -0600 received badge  Famous Question (source)
2017-06-24 02:26:50 -0600 received badge  Notable Question (source)
2017-03-03 13:58:39 -0600 received badge  Notable Question (source)
2016-11-01 03:36:24 -0600 received badge  Popular Question (source)
2016-09-12 08:58:08 -0600 received badge  Popular Question (source)
2016-01-31 14:37:27 -0600 received badge  Student (source)
2015-07-31 11:57:42 -0600 commented answer Simple algorithm for tracking objects between frames

I've gotten plenty of hits, but I haven't found anything in the documentation that explains how a Kalman Filter or Optical Flow solves my problem. Do you know of any examples that make it clear how these solve the object tracking problem?

2015-07-31 10:29:25 -0600 asked a question Simple algorithm for tracking objects between frames

Hey all,

I'm using contour finding (along with background subtraction) to pick out objects from a scene -- however, I'd like to also be able to track objects from frame to frame.

Given two frames, I'd like to be able to map objects from the new frame to objects in the old frame and keep track of the objects externally. Right now my algorithm:

  • Creates a list of all found objects in the current frame
  • For each object found in the current frame:
    • Find the object in the previous frame that is the closest to its current position
    • Check if the object is within a reasonable distance (say, 100 pixels)
    • If the object is close enough, call it the same object and update the previous object's position.
    • If the object is too far, create a new object (the object must have entered the scene)

This very simplistic algorithm gives me okay results, but I was wondering if there was a better method available in the OpenCV library. I'm not familiar with standard computer vision techniques, but I imagine there must be a better way! Any suggestions?

2015-07-31 08:46:32 -0600 received badge  Enthusiast
2015-07-29 10:47:15 -0600 received badge  Editor (source)
2015-07-29 10:43:49 -0600 commented question MSB6006 Error when building OpenCV from source in VS2015

I have a Geforce GTX 680, which as compatibility with 3.0. In CMake, CUDA_ARCH_BIN is set to 3.0 3.5 and CUDA_ARCH_PTX is blank. When I do that, it doesn't compile with a new message -- 'nvcc fatal : nvcc cannot find a supported version of Microsoft Visual Studio. Only the versions 2010, 2012, and 2013 are supported'

2015-07-28 14:00:39 -0600 asked a question MSB6006 Error when building OpenCV from source in VS2015

I'm following the instructions here for compiling OpenCV 2.4.11 from source. I'm using Windows 7 and Visual Studio 2015.

I'm rebuilding from source using Visual Studio 2015 because of bizarre problems I'm experiencing with std::vector deallocating improperly on my computer (See here).

The compilation always fails with a series of LNK1104 errors. However, I noticed that a small subset of the modules failed with a MSB6006 cmd.exe exited with code 1 error; when I try to compile these I get:

EDIT: The previous message was from a misconfiguration in which CUDA computing architecture I was using; I resolved the error and I am still getting a MSB6006 error:

------ Rebuild All started: Project: opencv_core, Configuration: Debug x64 ------
  Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/Debug/cuda_compile_generated_matrix_operations.cu.obj
  nvcc fatal   : nvcc cannot find a supported version of Microsoft Visual Studio. Only the versions 2010, 2012, and 2013 are supported

  CMake Error at cuda_compile_generated_matrix_operations.cu.obj.cmake:206 (message):
    Error generating
    C:/sdf3/opencv-2.4.11/vs2015-build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/Debug/cuda_compile_generated_matrix_operations.cu.obj


C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.

They seem to crash because Visual Studio 2015 isn't supported. What can I do to make VS2015 supported for building OpenCV?

thanks!

============================================================

UPDATE: I tried this with OpenCV 2.4.8, and I run into the same error.

============================================================

Original error message for future reference:

------ Rebuild All started: Project: opencv_core, Configuration: Debug x64 ------
  Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/Debug/cuda_compile_generated_matrix_operations.cu.obj
  nvcc fatal   : Unsupported gpu architecture 'compute_11'

  CMake Error at cuda_compile_generated_matrix_operations.cu.obj.cmake:206 (message):
    Error generating
    C:/sdf3/opencv-2.4.11/vs2015-build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/Debug/cuda_compile_generated_matrix_operations.cu.obj


C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.
2015-07-28 11:41:15 -0600 commented question Strange crashes during deallocation of std::vector (VS2015, Windows 7)

Did you need to rebuild it from source? Are you using VS2015? I've never rebuilt OpenCV from source before, so I'm a bit reluctant to try it -- but I'd also love to have this problem solved :) Hoping the rebuild process goes smoothly!

2015-07-27 15:48:29 -0600 commented question Strange crashes during deallocation of std::vector (VS2015, Windows 7)

Just double-checked -- I even removed all of the release .dlls and compiled / ran in Debug to make sure that wasn't the issue, but my program still crashed with the same error.

2015-07-27 14:05:12 -0600 received badge  Organizer (source)
2015-07-27 14:04:18 -0600 asked a question Strange crashes during deallocation of std::vector (VS2015, Windows 7)

Hey all,

I'm running OpenCV 2.4.11 on Windows 7, compiling with Visual Studio 2015.

I've found that during several function calls (to Stitcher::Stich and cv::findContours, for example), there is a critical memory error that causes the program to crash consistently.

For these errors, I get an error like the following in visual studio:

Debug Assertion Failed!

Program: ...a\code\my-project\software\Debug\my-project.exe
File: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0
Line: 116

Expression: "reinterpret_cast<uintptr_t *>(_Ptr_ptr)[-1] == _BIG_ALLOCATION_SENTINEL" && 0

When I follow the call stack to find out where the crash happened, it always happens at the end of a function when local variables go out of scope. The error is usually on the line:

my-project.exe!std::_Deallocate<cv::Point_<int> >(cv::Point_<int> * _Ptr, unsigned __int64 _Count) Line 114 C++

or similar (I believe when I call Sticher::stitch the crash is for a vector of type cv::DMatch rather than cv::Point).

If I comment out the specific lines (such as cv::findContours), the program runs just fine. In fact, the program works just fine until cv::findContours actually finds a contour; in this case it immediately crashes with the above memory errors.

I've checked that I have the right .dll files, and I do -- I'm wondering if perhaps I need to rebuild OpenCV for Visual Studio 2015? I'm not sure what else would be causing this problem.

thanks!

2015-07-24 12:58:27 -0600 commented question Issue with finding homography between two images

It crashes right on return result;, at the end of the function when it is presumably deallocating local variables.

2015-07-23 23:20:39 -0600 commented question Issue with finding homography between two images

I tried this code with these test images, and I get the same error in the destructor for cv::DMatch -- imgur.com/a/u34NJ

2015-07-23 23:20:39 -0600 asked a question Issue with finding homography between two images

I have two cameras that are looking overhead at a square object, and I'd like to take the two images and combine them to get one image that is (approximately) representative of the overall area.

The views from my two cameras look like so:

Two camera images.

The left edge of the left image should stitch with the right edge of the right image, with the dotted black line being the point where they overlap.

My first attempt is to stitch the images together using the stitcher class:

if (mObservers[0]->isImageBufferReady() && mObservers[1]->isImageBufferReady()) {
            try {
                cv::Mat leftImage = cv::Mat(mObservers[0]->getImageHeight(), mObservers[0]->getImageWidth(), CV_8UC1, mObservers[0]->getImageBuffer());
                cv::transpose(leftImage, leftImage);
                cv::flip(leftImage, leftImage, -1);

                cv::Mat rightImage = cv::Mat(mObservers[1]->getImageHeight(), mObservers[1]->getImageWidth(), CV_8UC1, mObservers[1]->getImageBuffer());
                cv::transpose(rightImage, rightImage);

                std::vector<cv::Mat> images;
                images.push_back(leftImage);
                images.push_back(rightImage);

                cv::Mat result;
                cv::Stitcher stitcher = cv::Stitcher::createDefault(true);

                stitcher.setRegistrationResol(-1); /// 0.6
                stitcher.setSeamEstimationResol(-1);   /// 0.1
                stitcher.setCompositingResol(-1);   //1
                stitcher.setPanoConfidenceThresh(-1);   //1
                stitcher.setWaveCorrection(true);
                stitcher.setWaveCorrectKind(cv::detail::WAVE_CORRECT_HORIZ);

                cv::Stitcher::Status status = stitcher.stitch(images, result);

                if (status != cv::Stitcher::OK) {
                    sdfLog::logFormat("Stitching failed! Error code = %i", int(status));
                    return cv::Mat::zeros(500, 500, CV_8UC1);
                }

                return result;


            }

Here, Observer is an external class that wraps around my camera, and exposes the data buffer (of type unsigned char*).

Unfortunately, this fails (consistently) with the error:

Debug Assertion Failed! Program: ....\VC\include\xmemory0 Line 106 Expression "(_Ptr_user & (_BIG_ALLOCATION_ALIGNMENT -1)) == 0" && 0

The call stack indicates that this happens during the call to std::_Deallocate<cv::KeyPoint> -- presumably when the keypoints vectors are deallocated.

Needless to say, the image stitching fails.

I've tried using the cv::Stitcher class, but I get the same error.

How can I attempt to stitch images together and get information about how or why this is failing?

thanks!