Note that there are some explanatory texts on larger screens.

plurals
  1. POToo Slow GpuMat uploading of an small image
    primarykey
    data
    text
    <p>I want to upload an image into the following variable <code>gpu::GpuMat test;</code>. First of all the input image(src) is converted into a grayscale image <code>cvtColor( src, src_gray, COLOR_BGR2GRAY );</code> and then it is uploaded <code>test.upload(src_gray);</code>. Unfortunately, it took so much time for the uploading. More than <strong>two minutes</strong>. The image size is 169x90. I know that that generally there is some delay because of the bandwidth but I think two minutes are too much for such a small image. Finally, I want to mention that after the uploading of the first image the up loading of the next images is almost instant. Is there any initialization procedures? Can we improve such delay?</p> <pre><code>int main( int, char** argv ) { /// Load source image and convert it to gray string filename = argv[1] ;//"yourfile.avi"; VideoCapture capture(filename); if( !capture.isOpened() ) throw "Error when reading steam_avi"; int framenumber=1; Mat src, src_gray; gpu::GpuMat test; namedWindow( "w", 1); time_t start,end; time (&amp;start); for( ; ; ) { //printf("Frame %d: \n", framenumber++ ); capture &gt;&gt; src; cvtColor( src, src_gray, COLOR_BGR2GRAY ); test.upload(src_gray);//it takes too long even for an image of 169x90 if( src_gray.empty() ) break; imshow("w", src_gray); waitKey(20); // waits to display frame } time (&amp;end); double dif = difftime (end,start); printf ("Elasped time is %.2lf seconds.", dif ); getchar(); return(0); } </code></pre> <p><img src="https://i.stack.imgur.com/bnnW6.png" alt="enter image description here"></p> <p>with <strong>--memory=pageable</strong> parameter.</p> <p>PS: Win 7 64x, CUDA SDK 5.5, Opencv 2.4.6, GeForce 9600.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload