Skip to content

Problems while rotating/flipping an image on CPU and GPU #206

@vguptai

Description

@vguptai

Hi,

Can anyone share an example for rotation of an image on CPU and GPU?

When I try the CPU version, it seems to indicate that rotate function is not available.

local cv_im = cv.imread{'demo/data/lena.jpg',  cv.IMREAD_COLOR}
local im_rotated = cv.rotate{src=cv_im, dsize={512,512}, angle=1.5708}

attempt to call field 'rotate' (a nil value)

And when I rotate on GPU, I do not seem to get the correct result.

local cv_im = cv.imread{'demo/data/lena.jpg',  cv.IMREAD_COLOR}

local im_cuda = cv_im:cuda()

local im_rotated_gpu = cv.cuda.rotate{src=im_cuda, dsize={512,512}, angle=1.5708}

cv.imwrite{'demo/data/lena_rotated_gpu.jpg', im_rotated_gpu:byte()}

The image written is all black !!

Similar error while flipping an image on GPU:

cv.cuda.flip{src=im_cuda, flipCode = 0}

attempt to call field 'flip' (a nil value)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions