m3y54m / dotnet-app-opencv

An embedded-developer-friendly project for .NET 5.0 with C# in Linux + SerialPort + Multi-threading + OpenCV C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C# App for Embedded Developers :)

An embedded developer friendly project for .NET 5.0 with C# in Linux ,capable of:

  • Calling an OpenCV-based C++ function in a C# program
  • Communication with a serial port in C#
  • Multi-threading for processing serial port incoming bytes

Useful Commands

Create the app

https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code

dotnet new console --framework net5.0

Create libsobel.so C shared library

cmake -S sobel_opencv_cpp/src -B sobel_opencv_cpp/build
cmake --build sobel_opencv_cpp/build

Install .NET dependencies

  • Add support for Bitmap images

    dotnet add package System.Drawing.Common --version 5.0.2
    sudo apt install libgdiplus
  • Add support for SerialPort communication

    dotnet add package System.IO.Ports --version 5.0.1
  • Add support for Threads

    dotnet add package System.Threading --version 4.3.0

Run the app

dotnet run

Testing serial port

In order to test the functionality of serial port data processing of this C# program you can use upload the Arduino program available in arduino_serial_port directory to an Arduino board.

About

An embedded-developer-friendly project for .NET 5.0 with C# in Linux + SerialPort + Multi-threading + OpenCV C++

License:MIT License


Languages

Language:C# 70.6%Language:C++ 20.6%Language:CMake 8.7%