is there an unnecessary code repeat? [closed]
hi all,
could you take a look at the code in copy.cpp
is there an unnecessary code repeat? ( the part below is exactly same )
switch (rotateMode)
{
case ROTATE_90_CLOCKWISE:
transpose(_src, _dst);
flip(_dst, _dst, 1);
break;
case ROTATE_180:
flip(_src, _dst, -1);
break;
case ROTATE_90_COUNTERCLOCKWISE:
transpose(_src, _dst);
flip(_dst, _dst, 0);
break;
default:
break;
Maybe try to remove
ocl_rotate()
andCV_OCL_RUN(_dst.isUMat(), ocl_rotate(_src, _dst, rotateMode))
. Try to validate it with a sample test code withUmat
andMat
and by running the OpenCV tests.But yes, it looks like not needed at first sight.
thanks for your comment @Eduardo
@Tetragramm what is your opinion ?
I would like to think I had a reason for putting that there, but I can't remember, and it certainly looks unnecessary. It should be safe to remove, because flip and transpose contain the necessary OCL checks.
@Tetragramm thank you.