Ozeki Camera Recorder Stat

YCbCr

The YCbCr technique is a way of adjusting and displaying RGB information. In this tutorial you can learn how to create an YCbCr adjuster and add it to your application using OZEKI Camera SDK. You will also find a detailed example code that you can use to create a Windows Forms Application to adjust your webcamera's YCbCr settings. It is very useful if you wish to separate the background from the foreground of an image, e.g. in grey hallways where many clothes are only hardly different from the background.

Important: you should study this article in order to find out how to setup your Windows Forms Application correctly.

Properties

In addition to the methods covered in the previous tutorials this filter has several own functions as well.

Cb: Specifies the Blue chroma value.

Cr: Specifies the Red chroma value.

Y: Specifies the Luma value.

Fillcolor: This method will expect a color defined by YCbCr values to fill out the image with a suitable main color. Note that this method fills out the image and not the background.


Figure 1 - Original image


Figure 2 - New image after YCbCr modification

Windows Form  

MainForm.cs

using System;
using System.Windows.Forms;
using Ozeki.Camera;
using Ozeki.Media;

namespace MainForm{
    public partial class MainForm : Form
    {
        private ICamera _camera;
        private DrawingImageProvider _imageProvider;
        private MediaConnector _connector;

        #region Initialize manipulation and filter
        private ImageManipulation _manipulation;
        private OzYbCrFiltering _filter;
        #endregion

        public MainForm()
        {
            InitializeComponent();

            _connector = new MediaConnector();
            _imageProvider = new DrawingImageProvider();
            // Create video viewer UI control

            // Bind the camera image to the UI control
            videoViewer.SetImageProvider(_imageProvider);

            _manipulation = new ImageManipulation();
            _manipulation.Start();

            _filter = new OzYbCrFiltering();
        }

        private void btn_Connect_Click(object sender, EventArgs e)
        {
            _camera = new WebCamera();

            if (_camera == null) return;

            _connector.Connect(_camera.VideoChannel, _manipulation);
            _connector.Connect(_manipulation, _imageProvider);

            _camera.Start();
            videoViewer.Start();
        }

        private void btn_Add_Click(object sender, EventArgs e)
        {
            _manipulation.Add(_filter);
        }

        private void btn_Remove_Click(object sender, EventArgs e)
        {
            _manipulation.Remove(_filter);
        }

        //TOP SLIDERS

        float crMin;
        float crMax;
        private void crmin_TrackScroll(object sender, EventArgs e)
        {
            var tb_crmin = sender as TrackBar;
            if (tb_crmin != null)
            {
                var value = (float)(tb_crmin.Value) / (float)100;
                crMin = value;
                _filter.Cb = new OzRange(crMin, crMax);
                lb_min1.Text = @"Minimum : " + value;
            }
        }

        private void crmax_TrackScroll(object sender, EventArgs e)
        {
            var tb_crmax = sender as TrackBar;
            if (tb_crmax != null)
            {
                var value = (float)(tb_crmax.Value) / (float)100;
                crMax = value;
                _filter.Cb = new OzRange(crMin, crMax);
                lb_max1.Text = @"Maximum : " + value;
            }
        }
        // MIDDLE SLIDERS
        float cbMin;
        float cbMax;
        private void cbmin_TrackScroll(object sender, EventArgs e)
        {
            var tb_cbmin = sender as TrackBar;
            if (tb_cbmin != null)
            {
                var value = (float)(tb_cbmin.Value) / (float)100;
                cbMin = value;
                _filter.Cb = new OzRange(cbMin, cbMax);
                lb_min2.Text = @"Minimum : " + value;
            }
        }

        private void cbmax_TrackScroll(object sender, EventArgs e)
        {
            var tb_cbmax = sender as TrackBar;
            if (tb_cbmax != null)
            {
                var value = (float)(tb_cbmax.Value) / (float)100;
                cbMax = value;
                _filter.Cb = new OzRange(cbMin, cbMax);
                lb_max2.Text = @"Maximum : " + value;
            }
        }

        // BOTTOM SLIDERS

        float yMin;
        float yMax;
        private void ymin_TrackScroll(object sender, EventArgs e)
        {
            var tb_ymin = sender as TrackBar;
            if (tb_ymin != null)
            {
                var value = (float)(tb_ymin.Value) / (float)100;
                yMin = value;
                _filter.Y = new OzRange(yMin, yMax);
                lb_min3.Text = @"Minimum : " + value;
            }
        }

        private void ymax_TrackScroll(object sender, EventArgs e)
        {
            var tb_ymax = sender as TrackBar;
            if (tb_ymax != null)
            {
                var value = (float)(tb_ymax.Value) / (float)100;
                yMax = value;
                _filter.Y = new OzRange(yMin, yMax);
                lb_max3.Text = @"Maximum : " + value;
            }
        }

        // FILLCOLOR SLIDERS

        float Y;
        float Cb;
        float Cr;
        private void filly_TrackScroll(object sender, EventArgs e)
        {
            var tb_y = sender as TrackBar;
            if (tb_y != null)
            {
                var value = (float)(tb_y.Value) / (float)100;
                Y = value;
                _filter.Fillcolor = new OzYCbCr(Y, Cb, Cr);
                lb_y.Text = @"Y : " + value;
            }
        }

        private void fillcb_TrackScroll(object sender, EventArgs e)
        {
            var tb_cb = sender as TrackBar;
            if (tb_cb != null)
            {
                var value = (float)(tb_cb.Value) / (float)100;
                Cb = value;
                _filter.Fillcolor = new OzYCbCr(Y, Cb, Cr);
                lb_cb.Text = @"Cb : " + value;
            }
        }

        private void fillcr_TrackScroll(object sender, EventArgs e)
        {
            var tb_cr = sender as TrackBar;
            if (tb_cr != null)
            {
                var value = (float)(tb_cr.Value) / (float)100;
                Cb = value;
                _filter.Fillcolor = new OzYCbCr(Y, Cb, Cr);
                lb_cr.Text = @"Cr : " + value;
            }
        }

        // CHECKBOXES
 
        private void chk_event_cr(object sender, EventArgs e)
        {
            var chk_updcr = sender as CheckBox;
            var isUpcr = (bool)chk_updcr.Checked;
            _filter.UpdateCr = isUpcr;
        }

        private void chk_event_cb(object sender, EventArgs e)
        {
            var chk_updcb = sender as CheckBox;
            var isUpcb = (bool)chk_updcb.Checked;
            _filter.UpdateCr = isUpcb;
        }

        private void chk_event_y(object sender, EventArgs e)
        {
            var chk_updy = sender as CheckBox;
            var isUpy = (bool)chk_updy.Checked;
            _filter.UpdateCr = isUpy;
        }
    }
}
		

Code 1 YCbCr in C#

GUI

MainForm.Designer.cs

	namespace MainForm{
    partial class MainForm
    {
        /// 
        /// Required designer variable.
        /// 
        private System.ComponentModel.IContainer components = null;

        /// 
        /// Clean up any resources being used.
        /// 
        /// true if managed resources should be disposed; otherwise, false.
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// 
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// 
        private void InitializeComponent()
        {
            this.videoViewer = new Ozeki.Media.VideoViewerWF();
            this.btn_Connect = new System.Windows.Forms.Button();
            this.btn_add = new System.Windows.Forms.Button();
            this.btn_remove = new System.Windows.Forms.Button();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.tb_crmax = new System.Windows.Forms.TrackBar();
            this.tb_crmin = new System.Windows.Forms.TrackBar();
            this.lb_max1 = new System.Windows.Forms.Label();
            this.lb_min1 = new System.Windows.Forms.Label();
            this.chk_updcr = new System.Windows.Forms.CheckBox();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.tb_cbmax = new System.Windows.Forms.TrackBar();
            this.lb_max2 = new System.Windows.Forms.Label();
            this.lb_min2 = new System.Windows.Forms.Label();
            this.tb_cbmin = new System.Windows.Forms.TrackBar();
            this.chk_updcb = new System.Windows.Forms.CheckBox();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.lb_max3 = new System.Windows.Forms.Label();
            this.lb_min3 = new System.Windows.Forms.Label();
            this.tb_ymax = new System.Windows.Forms.TrackBar();
            this.tb_ymin = new System.Windows.Forms.TrackBar();
            this.chk_updy = new System.Windows.Forms.CheckBox();
            this.groupBox4 = new System.Windows.Forms.GroupBox();
            this.tb_cr = new System.Windows.Forms.TrackBar();
            this.tb_cb = new System.Windows.Forms.TrackBar();
            this.tb_y = new System.Windows.Forms.TrackBar();
            this.lb_cr = new System.Windows.Forms.Label();
            this.lb_cb = new System.Windows.Forms.Label();
            this.lb_y = new System.Windows.Forms.Label();
            this.groupBox1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.tb_crmax)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.tb_crmin)).BeginInit();
            this.groupBox2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.tb_cbmax)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.tb_cbmin)).BeginInit();
            this.groupBox3.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.tb_ymax)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.tb_ymin)).BeginInit();
            this.groupBox4.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.tb_cr)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.tb_cb)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.tb_y)).BeginInit();
            this.SuspendLayout();
            // 
            // videoViewer
            // 
            this.videoViewer.BackColor = System.Drawing.Color.Black;
            this.videoViewer.FlipMode = Ozeki.Media.FlipMode.None;
            this.videoViewer.FrameStretch = Ozeki.Media.FrameStretch.Uniform;
            this.videoViewer.FullScreenEnabled = true;
            this.videoViewer.Location = new System.Drawing.Point(12, 57);
            this.videoViewer.Name = "videoViewer";
            this.videoViewer.RotateAngle = 0;
            this.videoViewer.Size = new System.Drawing.Size(471, 334);
            this.videoViewer.TabIndex = 0;
            this.videoViewer.Text = "videoViewerWF1";
            // 
            // btn_Connect
            // 
            this.btn_Connect.Location = new System.Drawing.Point(12, 12);
            this.btn_Connect.Name = "btn_Connect";
            this.btn_Connect.Size = new System.Drawing.Size(152, 26);
            this.btn_Connect.TabIndex = 14;
            this.btn_Connect.Text = "Connect to WebCamera";
            this.btn_Connect.UseVisualStyleBackColor = true;
            this.btn_Connect.Click += new System.EventHandler(this.btn_Connect_Click);
            // 
            // btn_add
            // 
            this.btn_add.Location = new System.Drawing.Point(315, 14);
            this.btn_add.Name = "btn_add";
            this.btn_add.Size = new System.Drawing.Size(75, 23);
            this.btn_add.TabIndex = 21;
            this.btn_add.Text = "Add";
            this.btn_add.UseVisualStyleBackColor = true;
            this.btn_add.Click += new System.EventHandler(this.btn_Add_Click);
            // 
            // btn_remove
            // 
            this.btn_remove.Location = new System.Drawing.Point(408, 14);
            this.btn_remove.Name = "btn_remove";
            this.btn_remove.Size = new System.Drawing.Size(75, 23);
            this.btn_remove.TabIndex = 22;
            this.btn_remove.Text = "Remove";
            this.btn_remove.UseVisualStyleBackColor = true;
            this.btn_remove.Click += new System.EventHandler(this.btn_Remove_Click);
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.tb_crmax);
            this.groupBox1.Controls.Add(this.tb_crmin);
            this.groupBox1.Controls.Add(this.lb_max1);
            this.groupBox1.Controls.Add(this.lb_min1);
            this.groupBox1.Controls.Add(this.chk_updcr);
            this.groupBox1.Location = new System.Drawing.Point(525, 14);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(265, 154);
            this.groupBox1.TabIndex = 24;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Cr settings";
            // 
            // tb_crmax
            // 
            this.tb_crmax.Location = new System.Drawing.Point(95, 94);
            this.tb_crmax.Maximum = 100;
            this.tb_crmax.Minimum = -100;
            this.tb_crmax.Name = "tb_crmax";
            this.tb_crmax.Size = new System.Drawing.Size(164, 45);
            this.tb_crmax.TabIndex = 4;
            this.tb_crmax.Scroll += new System.EventHandler(this.crmax_TrackScroll);
            // 
            // tb_crmin
            // 
            this.tb_crmin.Location = new System.Drawing.Point(95, 43);
            this.tb_crmin.Maximum = 100;
            this.tb_crmin.Minimum = -100;
            this.tb_crmin.Name = "tb_crmin";
            this.tb_crmin.Size = new System.Drawing.Size(164, 45);
            this.tb_crmin.TabIndex = 3;
            this.tb_crmin.Scroll += new System.EventHandler(this.crmin_TrackScroll);
            // 
            // lb_max1
            // 
            this.lb_max1.AutoSize = true;
            this.lb_max1.Location = new System.Drawing.Point(6, 94);
            this.lb_max1.Name = "lb_max1";
            this.lb_max1.Size = new System.Drawing.Size(51, 13);
            this.lb_max1.TabIndex = 2;
            this.lb_max1.Text = "Maximum";
            // 
            // lb_min1
            // 
            this.lb_min1.AutoSize = true;
            this.lb_min1.Location = new System.Drawing.Point(7, 43);
            this.lb_min1.Name = "lb_min1";
            this.lb_min1.Size = new System.Drawing.Size(48, 13);
            this.lb_min1.TabIndex = 1;
            this.lb_min1.Text = "Minimum";
            // 
            // chk_updcr
            // 
            this.chk_updcr.AutoSize = true;
            this.chk_updcr.Location = new System.Drawing.Point(7, 19);
            this.chk_updcr.Name = "chk_updcr";
            this.chk_updcr.Size = new System.Drawing.Size(74, 17);
            this.chk_updcr.TabIndex = 0;
            this.chk_updcr.Text = "Update Cr";
            this.chk_updcr.UseVisualStyleBackColor = true;
            this.chk_updcr.CheckedChanged += new System.EventHandler(this.chk_event_cr);
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.tb_cbmax);
            this.groupBox2.Controls.Add(this.lb_max2);
            this.groupBox2.Controls.Add(this.lb_min2);
            this.groupBox2.Controls.Add(this.tb_cbmin);
            this.groupBox2.Controls.Add(this.chk_updcb);
            this.groupBox2.Location = new System.Drawing.Point(525, 174);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(265, 168);
            this.groupBox2.TabIndex = 25;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Cb setings";
            // 
            // tb_cbmax
            // 
            this.tb_cbmax.Location = new System.Drawing.Point(95, 101);
            this.tb_cbmax.Maximum = 100;
            this.tb_cbmax.Minimum = -100;
            this.tb_cbmax.Name = "tb_cbmax";
            this.tb_cbmax.Size = new System.Drawing.Size(164, 45);
            this.tb_cbmax.TabIndex = 4;
            this.tb_cbmax.Scroll += new System.EventHandler(this.cbmax_TrackScroll);
            // 
            // lb_max2
            // 
            this.lb_max2.AutoSize = true;
            this.lb_max2.Location = new System.Drawing.Point(6, 101);
            this.lb_max2.Name = "lb_max2";
            this.lb_max2.Size = new System.Drawing.Size(51, 13);
            this.lb_max2.TabIndex = 3;
            this.lb_max2.Text = "Maximum";
            // 
            // lb_min2
            // 
            this.lb_min2.AutoSize = true;
            this.lb_min2.Location = new System.Drawing.Point(7, 44);
            this.lb_min2.Name = "lb_min2";
            this.lb_min2.Size = new System.Drawing.Size(48, 13);
            this.lb_min2.TabIndex = 2;
            this.lb_min2.Text = "Minimum";
            // 
            // tb_cbmin
            // 
            this.tb_cbmin.Location = new System.Drawing.Point(95, 44);
            this.tb_cbmin.Maximum = 50;
            this.tb_cbmin.Minimum = -50;
            this.tb_cbmin.Name = "tb_cbmin";
            this.tb_cbmin.Size = new System.Drawing.Size(164, 45);
            this.tb_cbmin.TabIndex = 1;
            this.tb_cbmin.Scroll += new System.EventHandler(this.cbmin_TrackScroll);
            // 
            // chk_updcb
            // 
            this.chk_updcb.AutoSize = true;
            this.chk_updcb.Location = new System.Drawing.Point(7, 20);
            this.chk_updcb.Name = "chk_updcb";
            this.chk_updcb.Size = new System.Drawing.Size(76, 17);
            this.chk_updcb.TabIndex = 0;
            this.chk_updcb.Text = "Update cb";
            this.chk_updcb.UseVisualStyleBackColor = true;
            this.chk_updcb.CheckedChanged += new System.EventHandler(this.chk_event_cb);
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.lb_max3);
            this.groupBox3.Controls.Add(this.lb_min3);
            this.groupBox3.Controls.Add(this.tb_ymax);
            this.groupBox3.Controls.Add(this.tb_ymin);
            this.groupBox3.Controls.Add(this.chk_updy);
            this.groupBox3.Location = new System.Drawing.Point(525, 358);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(265, 143);
            this.groupBox3.TabIndex = 26;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Y settings";
            // 
            // lb_max3
            // 
            this.lb_max3.AutoSize = true;
            this.lb_max3.Location = new System.Drawing.Point(13, 95);
            this.lb_max3.Name = "lb_max3";
            this.lb_max3.Size = new System.Drawing.Size(51, 13);
            this.lb_max3.TabIndex = 4;
            this.lb_max3.Text = "Maximum";
            // 
            // lb_min3
            // 
            this.lb_min3.AutoSize = true;
            this.lb_min3.Location = new System.Drawing.Point(13, 43);
            this.lb_min3.Name = "lb_min3";
            this.lb_min3.Size = new System.Drawing.Size(48, 13);
            this.lb_min3.TabIndex = 3;
            this.lb_min3.Text = "Minimum";
            // 
            // tb_ymax
            // 
            this.tb_ymax.Location = new System.Drawing.Point(95, 95);
            this.tb_ymax.Maximum = 100;
            this.tb_ymax.Minimum = -100;
            this.tb_ymax.Name = "tb_ymax";
            this.tb_ymax.Size = new System.Drawing.Size(164, 45);
            this.tb_ymax.TabIndex = 2;
            this.tb_ymax.Scroll += new System.EventHandler(this.ymax_TrackScroll);
            // 
            // tb_ymin
            // 
            this.tb_ymin.Location = new System.Drawing.Point(95, 43);
            this.tb_ymin.Maximum = 50;
            this.tb_ymin.Minimum = -50;
            this.tb_ymin.Name = "tb_ymin";
            this.tb_ymin.Size = new System.Drawing.Size(164, 45);
            this.tb_ymin.TabIndex = 1;
            this.tb_ymin.Scroll += new System.EventHandler(this.ymin_TrackScroll);
            // 
            // chk_updy
            // 
            this.chk_updy.AutoSize = true;
            this.chk_updy.Location = new System.Drawing.Point(7, 20);
            this.chk_updy.Name = "chk_updy";
            this.chk_updy.Size = new System.Drawing.Size(71, 17);
            this.chk_updy.TabIndex = 0;
            this.chk_updy.Text = "Update Y";
            this.chk_updy.UseVisualStyleBackColor = true;
            this.chk_updy.CheckedChanged += new System.EventHandler(this.chk_event_y);
            // 
            // groupBox4
            // 
            this.groupBox4.Controls.Add(this.tb_cr);
            this.groupBox4.Controls.Add(this.tb_cb);
            this.groupBox4.Controls.Add(this.tb_y);
            this.groupBox4.Controls.Add(this.lb_cr);
            this.groupBox4.Controls.Add(this.lb_cb);
            this.groupBox4.Controls.Add(this.lb_y);
            this.groupBox4.Location = new System.Drawing.Point(29, 420);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new System.Drawing.Size(454, 202);
            this.groupBox4.TabIndex = 27;
            this.groupBox4.TabStop = false;
            this.groupBox4.Text = "Fill color";
            // 
            // tb_cr
            // 
            this.tb_cr.Location = new System.Drawing.Point(80, 140);
            this.tb_cr.Maximum = 50;
            this.tb_cr.Name = "tb_cr";
            this.tb_cr.Size = new System.Drawing.Size(368, 45);
            this.tb_cr.TabIndex = 5;
            this.tb_cr.Scroll += new System.EventHandler(this.fillcr_TrackScroll);
            // 
            // tb_cb
            // 
            this.tb_cb.Location = new System.Drawing.Point(80, 84);
            this.tb_cb.Maximum = 50;
            this.tb_cb.Name = "tb_cb";
            this.tb_cb.Size = new System.Drawing.Size(368, 45);
            this.tb_cb.TabIndex = 4;
            this.tb_cb.Scroll += new System.EventHandler(this.fillcb_TrackScroll);
            // 
            // tb_y
            // 
            this.tb_y.Location = new System.Drawing.Point(80, 33);
            this.tb_y.Maximum = 50;
            this.tb_y.Name = "tb_y";
            this.tb_y.Size = new System.Drawing.Size(368, 45);
            this.tb_y.TabIndex = 3;
            this.tb_y.Scroll += new System.EventHandler(this.filly_TrackScroll);
            // 
            // lb_cr
            // 
            this.lb_cr.AutoSize = true;
            this.lb_cr.Location = new System.Drawing.Point(25, 140);
            this.lb_cr.Name = "lb_cr";
            this.lb_cr.Size = new System.Drawing.Size(17, 13);
            this.lb_cr.TabIndex = 2;
            this.lb_cr.Text = "Cr";
            // 
            // lb_cb
            // 
            this.lb_cb.AutoSize = true;
            this.lb_cb.Location = new System.Drawing.Point(25, 84);
            this.lb_cb.Name = "lb_cb";
            this.lb_cb.Size = new System.Drawing.Size(20, 13);
            this.lb_cb.TabIndex = 1;
            this.lb_cb.Text = "Cb";
            // 
            // lb_y
            // 
            this.lb_y.AutoSize = true;
            this.lb_y.Location = new System.Drawing.Point(25, 33);
            this.lb_y.Name = "lb_y";
            this.lb_y.Size = new System.Drawing.Size(14, 13);
            this.lb_y.TabIndex = 0;
            this.lb_y.Text = "Y";
            // 
            // MainForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.Control;
            this.ClientSize = new System.Drawing.Size(802, 655);
            this.Controls.Add(this.groupBox4);
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.btn_remove);
            this.Controls.Add(this.btn_add);
            this.Controls.Add(this.btn_Connect);
            this.Controls.Add(this.videoViewer);
            this.Name = "MainForm";
            this.Text = "YbCr settings";
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.tb_crmax)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.tb_crmin)).EndInit();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.tb_cbmax)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.tb_cbmin)).EndInit();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.tb_ymax)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.tb_ymin)).EndInit();
            this.groupBox4.ResumeLayout(false);
            this.groupBox4.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.tb_cr)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.tb_cb)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.tb_y)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private Ozeki.Media.VideoViewerWF videoViewer;
        private System.Windows.Forms.Button btn_Connect;
        private System.Windows.Forms.Button btn_add;
        private System.Windows.Forms.Button btn_remove;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.TrackBar tb_crmax;
        private System.Windows.Forms.TrackBar tb_crmin;
        private System.Windows.Forms.Label lb_max1;
        private System.Windows.Forms.Label lb_min1;
        private System.Windows.Forms.CheckBox chk_updcr;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.TrackBar tb_cbmax;
        private System.Windows.Forms.Label lb_max2;
        private System.Windows.Forms.Label lb_min2;
        private System.Windows.Forms.TrackBar tb_cbmin;
        private System.Windows.Forms.CheckBox chk_updcb;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.Label lb_max3;
        private System.Windows.Forms.Label lb_min3;
        private System.Windows.Forms.TrackBar tb_ymax;
        private System.Windows.Forms.TrackBar tb_ymin;
        private System.Windows.Forms.CheckBox chk_updy;
        private System.Windows.Forms.GroupBox groupBox4;
        private System.Windows.Forms.TrackBar tb_cr;
        private System.Windows.Forms.TrackBar tb_cb;
        private System.Windows.Forms.TrackBar tb_y;
        private System.Windows.Forms.Label lb_cr;
        private System.Windows.Forms.Label lb_cb;
        private System.Windows.Forms.Label lb_y;
    }
}
		

Code 2 YCbCr GUI in C#

Conclusion

With the help of this lecture you can successfully implement YCbCr with your C# camera application using the Ozeki Camera SDK.

Related Pages

FAQ

Below you can find the answers for the most frequently asked questions related to this topic:

  1. What kind of developer environment is needed?

    • Microsoft Visual Studio 2010
    • Microsoft .Net Framework 4.0
    • Internet connection
  2. How can I get the URL of the camera?

    You can get the URL from the producer of the camera.

  3. I have not managed to build the solution. How to solve it?

    • Please set the Target framework property of the project to .NET 4.0.
    • You should add the OzekiSDK.dll to the references of the solution.
    • Please import the missing classes.