Ask Your Question

VSR's profile - activity

2013-10-07 06:24:06 -0600 received badge  Student (source)
2013-06-12 07:58:40 -0600 asked a question How do I correctly add my own .cu files to the open CV poject?

I have added my own .hpp, my own .cpp, and my own .cu files to the OpenCV project. I put the .hpp into the Include, the .cpp file into the host, and the .cu file into the "device" parts of the opencv_gpu module. The .hpp and the .cpp files complie fine. However it appears to me that my .cu file never gets compiled.

  1. When I compile OpenCV I get linker errors for the functions that are inside the .cu file.
  2. If I introduce blatant syntax errors to my .cu file the compiler never complains about them.
  3. When I go to the build menu when I have one of the .cu files that came with OpenCV opened, I get the option to "Build open_cv gpu". I get no such option when I try to do it when I have my .cu file open.

There must be a step that I am missing in order to get Visual studio to see my .cu file and invoke the compiler for it. Do I have to rerun Cmake, or edit some config file?

2013-05-24 09:29:25 -0600 commented answer MOG background subtraction CPU vs GPU implementation differences.

By parameters I also meant the model itself (mean variance weights). In the case of the CPU version you can extend the class and make your own method that uses the protected variables. In the GPU version those are private and any sort of extension is impossible. Are you saying that this is an oversight in the CPU version then?

2013-05-24 08:14:06 -0600 asked a question MOG background subtraction CPU vs GPU implementation differences.

Looking through the files I noticed the following thing.

In the CPU version, in the BackgroundSubtractorMOG class the parameters of the model

Size frameSize;
int frameType;
Mat bgmodel;
int nframes;
int history;
int nmixtures;
double varThreshold;
double backgroundRatio;
double noiseSigma;

are of PROTECTED type. Meaning that if you want to make a modified version of the MOG background subtraction method, you can just extend the class.

On the other hand, in the GPU version MOG_GPU, the parameters of the model

int nmixtures_;

Size frameSize_;
int frameType_;
int nframes_;

GpuMat weight_;
GpuMat variance_;
GpuMat mean_;

GpuMat bgmodelUsedModes_; //keep track of number of modes per pixel

are of PRIVATE type. Making it impossible to make a modified background subtraction method by extending the class. Is this just an oversight, or is there some kind of weird CUDA limitation, that would prevent the methods of the extended class from being able to work on those variables anyways?