     InitTextures();
 
     //prepare image pyramid
-    std::vector< shared_ptr<FloatVector> > img0_pyramid;
-    std::vector< shared_ptr<FloatVector> > img1_pyramid;
+    std::vector< Ptr<FloatVector> > img0_pyramid;
+    std::vector< Ptr<FloatVector> > img1_pyramid;
 
     std::vector<Ncv32u> w_pyramid;
     std::vector<Ncv32u> h_pyramid;

    FloatVector* ptrUNew = &u_new;
    FloatVector* ptrVNew = &v_new;

    std::vector< shared_ptr<FloatVector> >::const_reverse_iterator img0Iter = img0_pyramid.rbegin();
    std::vector< shared_ptr<FloatVector> >::const_reverse_iterator img1Iter = img1_pyramid.rbegin();
    //outer loop
    //warping fixed point iteration
    while(!w_pyramid.empty())

    float scale = 1.0f;

    //cuda arrays for frames
    Ptr<FloatVector> I0(new FloatVector(gpu_mem_allocator, kSizeInPixelsAligned));
    ncvAssertReturn(I0->isMemAllocated(), NCV_ALLOCATOR_BAD_ALLOC);

    Ptr<FloatVector> I1(new FloatVector(gpu_mem_allocator, kSizeInPixelsAligned));
    ncvAssertReturn(I1->isMemAllocated(), NCV_ALLOCATOR_BAD_ALLOC);

    if (!kSkipProcessing)
