opencv - cv::VideoCapture in android native code -


i using cv::videocapture in native code , having issues : in android java code, videocapture gives yuv420 frame, in native code it's bgr one. since need gray image, having yuv image better (i read there no cost in converting yuv gray).

here questions :

a im using asus tf201, acquiring frame takes 26ms lot... standard android camera api gives yuv native version of videocapture performs conversion ? (which explain time cost)

is possible change format cv_cap_prop_format ? whenever try mycapture.get(cv_cap_prop_format) app crashes...

edit : andrey kamaev answered one. have use grab/retrieve methods adding argument in second 1 :

capture.retrieve(frame, cv_cap_android_gray_frame); 

thanks

look @ opencv samples android. of them getting gray image videocapture object:

capture.retrieve(mgray, highgui.cv_cap_android_grey_frame); 

internally gray image "converted" yuv420 frame in efficient way - without copying.


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -