Ask Your Question
0

Speedup stitching

asked 2013-07-11 11:47:40 -0600

nikkadim gravatar image

updated 2013-07-11 12:13:53 -0600

Now for stitching 6 images (1280*960) I spend 5 - 10 seconds, each run different time. And when it tooks 10 secs I've got result.tif with size 158 bytes (header only?).

    LARGE_INTEGER frequency;        // ticks per second
    LARGE_INTEGER t1, t2;           // ticks
    double elapsedTime;


    [...]  QueryPerformanceCounter(&t1);
    Stitcher stitcher = Stitcher::createDefault(false);
    Stitcher::Status status = stitcher.stitch(imgs, rois, pano);
    if (status != Stitcher::OK)
    {
        cout << "Can't stitch images, error code = " << status << endl;
        return -1;
    }
    QueryPerformanceCounter(&t2);
    elapsedTime = (t2.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
    printf("%.6f ms",elapsedTime);
    imwrite(result_name, pano); [...]

And I have a two questions.

(1) Why it (different computation time) happened

(2) Is it possible to improve the speed?

PS: Unfortunately, I can't simply use true flag in Stitcher::createDefault, because my roi size is small (170x960), and as I know this is the issue for GPU SURF functions. But may be it's possible to use TBB or GPU in other sipmle steps (like cv::detail::BestOf2NearestMatcher)?

PPS: I'm, already tried to play with registrationResol, it helps a little, but not much.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-07-15 04:36:41 -0600

joonho1145 gravatar image

Cuda toolkit install. The graphics card must support cuda. (NVIDIA GTX xxx) Cmake use opencv build.

int num_device = getCudaEnabledDeviceCount(); //GPU is must num_device == 1 if(num_device > 0) Stitcher stitcher = Stitcher::createDefault(true); //try_use_gpu //use GPU else Stitcher stitcher = Stitcher::createDefault(false); //use only CPU Stitcher::Status status = stitcher.stitch(imgs, rois, pano);

it is fast.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-07-11 11:47:40 -0600

Seen: 1,006 times

Last updated: Jul 15 '15