Ask Your Question
0

Error when calling to detectMultiScale (HogDescriptor) With GPU.

asked 2013-06-05 07:09:10 -0600

Jackal gravatar image

updated 2013-06-05 07:10:57 -0600

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.

edit retag flag offensive close merge delete

Comments

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.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-06-05 07:13:58 -0600 )edit

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.

Jackal gravatar imageJackal ( 2013-06-05 07:42:37 -0600 )edit
1

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?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-06-05 07:49:56 -0600 )edit

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)

Jackal gravatar imageJackal ( 2013-06-05 07:58:37 -0600 )edit

Initiation is great but you are only reserving the memory here. Are you actually filling it up with data? For example something like this:

 Mat myImage= imread("data.png",1);
 ColorSRC.upload(myImage);
StevenPuttemans gravatar imageStevenPuttemans ( 2013-06-05 08:27:07 -0600 )edit

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.

  1. Does this function worked to anyone with GPU ?
  2. Do i need something special to be installed ?

Thanks in advance, Jackal.

Jackal gravatar imageJackal ( 2013-06-06 04:37:20 -0600 )edit
1

If you want your GPU functionality to work you need:

  • The complete set of libraries built with CUDA support.
  • Including the CUDA supported core library and the gpu library.
  • Make sure that you have correct CUDA version installed (4.2 for openCV 2.4.4, 5.0 for openCV 2.4.5)

Could you post the original error in your post? It will direct us much further than a deep search you did yourself.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-06-06 04:50:45 -0600 )edit

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 ?

Jackal gravatar imageJackal ( 2013-06-06 06:33:58 -0600 )edit
1

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.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-06-06 06:38:16 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-06-06 06:53:10 -0600

Jackal gravatar image

Thank you ... :)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-06-05 07:09:10 -0600

Seen: 687 times

Last updated: Jun 05 '13