How can pass raw data of RGB/BGR format to read
Actually, When i open video file of raw_data in RGB/ BGR format. It could not open. What should be wrong with this?
Please check lines of code as below:
/**
* @function main
*/
int main( void )
{
VideoCapture capture;
Mat frame;
//-- 1. Load the cascades
if( !face_cascade.load( face_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; };
if( !eyes_cascade.load( eyes_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; };
//-- 2. Read the video stream
//capture.open( -1 );
//capture.open("test_rgb.mp4");
//capture.open("vid_web_input1.mov");
capture.open("video_test.rgb");
//capture.open("rgb.avi");
//capture.open("1.rgb");
//capture.open("2.rgb");
//capture.open("rtsp://admin:jenex#[email protected]:554");
//capture.open("rgb.mov");
//capture.open("/home/kishan/HD_CAM_1280_720.avi");
//capture.open(0);
if( capture.isOpened() )
{
int total_frames = 0;
int frame_width, frame_height;
//char frame_codec_type[6]={0};
double frame_codec_type=0;
total_frames = capture.get(CV_CAP_PROP_FRAME_COUNT);
frame_width = capture.get(CV_CAP_PROP_FRAME_WIDTH);
frame_height = capture.get(CV_CAP_PROP_FRAME_HEIGHT);
frame_codec_type = capture.get(CV_CAP_PROP_FOURCC);
printf("\nNo. of Frames= %d\nwidth= %d\nheight= %d\ntype= %lf\n",total_frames, frame_width, frame_height, frame_codec_type);
for(;;)
{
capture >> frame;
//-- 3. Apply the classifier to the frame
if( !frame.empty() )
{ detectAndDisplay( frame ); }
else
{ printf(" --(!) No captured frame -- Break!"); break; }
int c = waitKey(10);
if( (char)c == 'c' ) { break; }
Regards, Kishan Patel.
It could not open. What should be wrong with this? Too general, please provide error messages and relevant code pieces, otherwise people cannot help you.
I am assuming your have a video encoded with a specific codec and want to read in the frames. The class for capturing frames is VideoCapture. If you have a problem with that you either have encoding problems (my guess now) or some hardware related problems (camera)
what exactly is this ? please be more concise.
also, we cannot help, without seing code here.
Okay, if( !face_cascade.load( face_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; }; if( !eyes_cascade.load( eyes_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; };
//-- 2. Read the video stream //capture.open( -1 ); //capture.open("test_rgb.mp4"); //capture.open("vid_web_input1.mov"); capture.open("video_test.rgb"); //capture.open("rgb.avi"); //capture.open("1.rgb"); //capture.open("2.rgb"); //capture.open("rtsp://admin:jenex#[email protected]:554"); //capture.open("rgb.mov"); //capture.open("/home/kishan/HD_CAM_1280_720.avi"); //capture.open(0); if( capture.isOpened() ) {
I have just open and play video file of raw data in RGB/BGR format. This video file can be play by "vooya" software in ububtu system.
error: [IMGUTILS @ 0x7ffccb6f6790] Picture size 0x0 is invalid
(app:3043): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed
for heavens sake, put your code into your question, (where it belongs), not into comments.
Okay, Now fine?
Well if you have problems - try to split it - Can you try the video capture part on another video and see if you can capture at all?
Your error message includes the following part: " [IMGUTILS @ 0x7ffccb6f6790] Picture size 0x0 is invalid"
Can you also try out the sample code from the video capture sample on your video?
Yes, I have tried to use another video_file as you can see in code. I have comment out remaining video_files.
Yes, i am using sample code name objectdetection(path: samples/cpp/tutorialcode/objectdetection)