//src -> yuv420P, 1920*1088*1.5
//ySrc-> 1920*1088
//size=128 only for test
//rotate_degree=FASTCV_ROTATE_90;
uint8_t* dst = new uint8_t[1920*1088*3/2];
memset(dst, 0, 1920*1088*3/2);
uint8_t *yDst=dst, *uDst=dst+widthAndHeight, ......
fcvStatus status = fcvRotateImageu8 (ySrc, 128, 128, 0, yDst, 128, rotate_degree);
I set breakpoint after fcvRotateImageu8.
status=FASTCV_SUCCESS
for 90 degrees, the result should like this: src[y * width + x] == dst[x* height + height - y - 1]
but the output debug is:
(lldb) p ySrc[0]
(const uint8_t) $0 = '\xb4' 180 '\xb4'
(lldb) p ySrc[1]
(const uint8_t) $1 = '\xb6' 182 '\xb6'
(lldb) p ySrc[2]
(const uint8_t) $2 = '\xb7' 183 '\xb7'
(lldb) p yDst[127]
(uint8_t) $3 = '\0' 0 '\0'
(lldb) p yDst[255]
(uint8_t) $4 = '\0' 0 '\0'
(lldb) p yDst[383]
(uint8_t) $5 = '\0' 0 '\0'
// can I rotate yuv420p like this?
status=fcvRotateImageu8 (ySrc, w, h, 0, yDst, 0, rotate_degree);
status=fcvRotateImageu8(uSrc, w/2, h/2, src_stride, uDst, dst_stride, rotate_degree);
status=fcvRotateImageu8(vSrc, w/2, h/2, src_stride, vDst, dst_stride, rotate_degree);
can anyone tell me how to rotate yuv420p for 90 degrees use fastcv? thanks in advance~~~
Hi,
The rotation API works on grayscale image. It cannot rotate YUV420p. However, it can rotate Y plane if you set up the parameters correctly.
Cheers,
-Jeff
dear
The Y and the function parameters are correct ,why yDst is not what i want?
1. src_stride must be the same as dst_stride
-- fcvStatus status = fcvRotateImageu8 (ySrc, 128, 128, 0, yDst, 128, rotate_degree);
++ fcvStatus status = fcvRotateImageu8 (ySrc, 128, 128, 128, dstY, 128, rotate_degree);
2. you can use below api to rotate UV image
++ fcvRotateImageInterleavedu8(uvSrc, w, h, src_stride, uvDst, dst_stride, rotate_degree);
Thanks!