c++ - GstBuffer to color Mat -


gstbuffer *gstimagebuffer = gst_app_sink_pull_buffer((gstappsink*)app_data.gst_data.sink); mat matleft = mat(size(width, height),cv_8u, (char*)gst_buffer_data(gstimagebuffer)); 

i can pull buffer , convert opencv mat object, in grayscale. want pull buffer in color. know stream in color creating same pipeline in terminal. i've searched solution without success. using gstreamer-0.10 , opencv-2.4.10.

finally of post changing cv::mat image copied buffer affects original image can pull buffer in color. size of buffer make sense, 640*360*3.

i had link in different way appsink ffmpegcolorspace element:

gst_element_link_filtered(data->gst_data.converter, data->gst_data.sink, gst_caps_new_simple("video/x-raw-rgb", null)) 

and when pulling buffer:

gstimagebuffer = gst_app_sink_pull_buffer((gstappsink*)app_data.gst_data.sink); matleft = mat(size(width, height), cv_8uc3, (char*)gst_buffer_data(gstimagebuffer)); cvtcolor(matleft, matleft, cv_rgb2bgr); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -