how to display the camera feed in C# using OpenCvSharp

Sdílet
Vložit
  • čas přidán 29. 07. 2023
  • My fiverr link: www.fiverr.com/hamzakhalid178
    My Upwork Profile: www.upwork.com/freelancers/~0...
    Whatsapp Number: +923338672398
    contact me on hamzahumzahamzah@gmail.com for custom software's.
    Please share and like the video and subscribe the channel
    If any question comment below
    code:
    private VideoCapture _capture=new VideoCapture(0);
    private Mat _image=new Mat();
    Thread thread;
    private void Form1_Load(object sender, EventArgs e)
    {
    thread = new Thread(new ThreadStart(CaptureCameraCallback));
    thread.Start();
    }
    public void CaptureCameraCallback()
    {
    while(true)
    {
    _capture.Read(_image);
    if (this.InvokeRequired)
    {
    this.Invoke(new MethodInvoker(() =(lessthansign) pictureBox1.Image = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(_image)));
    }
    else
    {
    pictureBox1.Image = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(_image);
    }
    }
    }
    #csharp #csharpdevelopers #csharpdotnet #csharpprogramming #csharptutorial #csharptutorial #opencv #opencvsharp #camera #camerafeed #livevideo #live #video #videos #display
  • Věda a technologie

Komentáře •