Error when calling to detectMultiScale (HogDescriptor) With GPU.
Hello , I've compile the opencv 2.4.5 with Cuda5 and trying to implement the detectMultiScale Call. since i've got an error i started to debug it. and found that in hog.cu the error raised.
if (correct_gamma) compute_gradients_8UC1_kernel<nthreads, 1=""><<<gdim, bdim="">>>(height, width, img, angle_scale, grad, qangle); else compute_gradients_8UC1_kernel<nthreads, 0=""><<<gdim, bdim="">>>(height, width, img, angle_scale, grad, qangle);
cudaSafeCall( cudaGetLastError() ); cudaSafeCall( cudaDeviceSynchronize() );
also i can't debug into the compute_gradients_8UC1_kernel does anyone has any idea ?
Regards, Jackal.
Can you please share your error that led you into debugging? Check this develop issue I posted and the error that i didn't succeed in solving. Is it the same? A pull request has been made in the meantime.
I don't know if it's the same. mine is calling the HogDescriptor::detectMultiScale and yours calling the CascadeClassifier::detectMultiScale ..
But this is the exception i get ...
This is the call : hog.detectMultiScale(ColorSRC, found);
This is the exception: Unhandled exception at at 0x7543C41F in OnysusPlayer.exe: Microsoft C++ exception: cv::Exception at memory location 0x665AE388.
Hmm ok was to fast with my answer. It seems that one of your elements that you are passing, isn't correctly initiated. Can you check if ColorSRC contains the correct information and if found is actually initiated properly?
I'm initiate it like this: cv::gpu::GpuMat ColorSRC = cv::gpu::GpuMat(myImageHIGHT,myImageWIDTH,CV_8UC4,&myColorImageMat);
is it ok ?
(I've the same error in it's inside path to 8UC4 and 8UC1)
Initiation is great but you are only reserving the memory here. Are you actually filling it up with data? For example something like this:
Thanks for your answer, I've tried that like you wrote just to be sure, but it returns the same error. It seems like i have something missing.
Thanks in advance, Jackal.
If you want your GPU functionality to work you need:
Could you post the original error in your post? It will direct us much further than a deep search you did yourself.
Thanks StevenPuttemans,
Well i don't know what I've change (maybe with the initialization) but it start to pass the function with no error. but in general it still works slowly ? is there any chance to make it work faster ?
The speed of your algorithm depends on several things, size of your input image, size of your model, step of window taken, ... You cannot clearly state a single solution to make it work better.