opencv image update in gtk for video streaming linux with C programming -


I am using opencv 1.0.0 and gtk2.0. I want to capture the images continuously from the video stream so far I have been successful in capturing the image. This is non-standard IP cameras no VGA / USB / V4L need to know one or clear method to refresh constantly updated images for video streaming

  GtkWidget * image; ... ... IplImage * bayerImage = NULL; IplImage * rgbImage = NULL; ... ... ... cvCvtColor (Bayer image, RGBImage, CV_bearbg2 RGB); // usually opencv image BGR, so we RGB pics = gdk_pixbuf_new_from_data need to replace it ((guchar *) rgbImage- & gt; imageData, GDK_COLORSPACE_RGB, unreal, rgbImage- & gt; depth, rgbImage- & gt ; Width, rgbImage-> height, (RGBIMM-> width phase), null, faucet); Image = gtk_image_new_from_pixbuf (pix); Feel free to use Virgoptrex 2010   

  / * (c) 2010 Retain credit * / #include gtk / gtk.h gint t = 0; gboolean expose_event_callback (GtkWidget * widget, GdkEventExpose * event, gpointer data) {// g_object_ref_sink (widget & gt; window); // gdk_drawable_ref (widget-> window); Gdk_draw_arc (Widget & gt; window, Widgets & gt; style & gt; fg_gc [GTK_WIDGET_STATE (widget)], TRUE, 0, 0, Widgets & gt; allocation. Width, Widgets & gt; allocation. Height , 0, 64 * 18 * t); // gdk_drawable_unref (widget-> window); Return TRUE; } Static Geoboyan Time_Handler (GTK Widget * Widget) {gtk_widget_queue_draw (GTK_WIDGET (widget)); If (T & LT; 20) {T ++; } And if (t> = 20) {t = 0; } Printf ("Hello% d \ n", T); Return TRUE; } Int main (int argc, char * argv []) {GtkWidget * window; GtkWidget * aspect_frame; GtkWidget * drawing_area; Gtk_init (& amp; argc, & argv); Window = gtk_window_new (GTK_WINDOW_TOPLEVEL); Gtk_window_set_title (GTK_WINDOW (window), "aspect frame"); G_signal_connect (G_OBJECT (window), "destroyed", G_CALLBACK (gtk_main_quit), NULL); Gtk_container_set_border_width (GTK_CONTAINER (window), 10); / * Create a aspect_frame and add to our high window * / aspect_frame = gtk_aspect_frame_new ( "2x1", / * Label * / 0.5 / * Center X * / 0.5 / * Center Y * / 2 / * Xsize / Ysize = 2 * / False / * Do not pay attention to child's aspect * /); Gtk_container_add (GTK_CONTAINER (window), aspect_frame); Gtk_widget_show (aspect_frame); / * Add a hair widget to the aspect frame now / / drawing_area = gtk_drawing_area_new (); / * Ask for a 200x200 window, but AspectFrame give us since a 200x100 * window we are forced into a 2x1 aspect ratio * / gtk_widget_set_size_request (drawing_area, 200, 200); Gtk_container_add (GTK_CONTAINER (aspect_frame), drawing_reara); Gtk_widget_show (drawing_tera); G_signal_connect (G_OBJECT (Drawing_rea), "Exposure_Avent", GColBlack (Exposure_EventCalbackBack), Faucet); G_timeout_add (100, (GSourceFunc) time_handler, (gpointer) drawing_area); Gtk_widget_show (window); Gtk_main (); Return 0; }  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -