How to convert RGB to yuv420sp with NCNN

rbpvctlc  于 4个月前  发布在  其他
关注(0)|答案(1)|浏览(37)

detail | 详细描述 | 詳細な説明

I am doing video processing on Android with ncnn,

for each frame :
convert yuv420sp frame into rbg mat
ncnn inference rbg frame
edit rgb frame with result from previous step
convert rbg frame into yuv420sp frame and throw it into media codec encoder

4 steps for each frame and 3 of them can be done with ncnn, and I stuck in last step
How can I do rgb2yuv420sp with ncnn?
there is a function yuv420sp2rbg but I can not find a a function named rgb2yuv420sp in ncnn
And similar problem happens in OpenCV::cvt_color either .

idv4meu8

idv4meu81#

Basically, I want to crop the frame base on inference result, So it still can be done if I can crop a yuv frame.
Is there any function can crop a yuv420sp image?
Of cause I can crop the converted rgb frame in both ncnn or ncnn, but none of them can do reverse.

相关问题