# \#csharp

**URL:** https://forum.opencv.org/tag/csharp/265.md

[Latest](https://forum.opencv.org/latest.md) · [Categories](https://forum.opencv.org/categories.md) · [Tags](https://forum.opencv.org/tags.md)

---

## [How properly to wrap OpenCV APIs that take cv::InputArray/cv::OutputArray/cv::InputOutputArray for P/Invoke (C#)](https://forum.opencv.org/t/how-properly-to-wrap-opencv-apis-that-take-cv-inputarray-cv-outputarray-cv-inputoutputarray-for-p-invoke-c/24092)

<div class="topic-metadata">

**Author:** [@LiubovPil](https://forum.opencv.org/u/LiubovPil)\
**Replies:** 6\
**Last updated:** [October 28, 2025, 6:01pm UTC](https://forum.opencv.org/t/how-properly-to-wrap-opencv-apis-that-take-cv-inputarray-cv-outputarray-cv-inputoutputarray-for-p-invoke-c/24092 "2025-10-28T18:01:39Z")

</div>

Hi there! I understand that my question not really suit this forum, but I don’t know any suitable one I am writing my custom OpenCV wrapper (now I am using OpenCV 4.11) for C# I am using DNN-based face detector for fa…

---

## [Fixing dependencies issues utilizing OpenCvSharp for a .NET project](https://forum.opencv.org/t/fixing-dependencies-issues-utilizing-opencvsharp-for-a-net-project/24051)

<div class="topic-metadata">

**Author:** [@Asperjasp](https://forum.opencv.org/u/Asperjasp)\
**Replies:** 1\
**Last updated:** [September 25, 2025, 7:06pm UTC](https://forum.opencv.org/t/fixing-dependencies-issues-utilizing-opencvsharp-for-a-net-project/24051 "2025-09-25T19:06:40Z")

</div>

Hello there, I am trying to install OpenCvsharp and have it working which is for a Computer Vision Role using c# in a .NET console project , I have tried a bunch of things, I am using ubuntu 24.04 in WSL and have alread…

---

## [Emgu CV: CvInvoke.ProjectPoints throws "OpenCV: d == 2 && (sizes\[0\] == 1 || sizes\[1\] == 1 || sizes\[0\]sizes\[1\] == 0)" despite valid inputs](https://forum.opencv.org/t/emgu-cv-cvinvoke-projectpoints-throws-opencv-d-2-sizes-0-1-sizes-1-1-sizes-0-sizes-1-0-despite-valid-inputs/22993)

<div class="topic-metadata">

**Author:** [@NICCOLO\_VITO\_VACCA](https://forum.opencv.org/u/NICCOLO_VITO_VACCA)\
**Replies:** 1\
**Last updated:** [July 9, 2025, 12:20am UTC](https://forum.opencv.org/t/emgu-cv-cvinvoke-projectpoints-throws-opencv-d-2-sizes-0-1-sizes-1-1-sizes-0-sizes-1-0-despite-valid-inputs/22993 "2025-07-09T00:20:40Z")

</div>

I’m using Emgu CV (OpenCV C# wrapper) and trying to project 3D points onto a 2D image plane using CvInvoke.ProjectPoints. However, I’m getting this OpenCV error: OpenCV: d == 2 && (sizes\[0\] == 1 || sizes\[1\] == 1 || size…

---

## [Im just new in using openCV and I am making a face recognition app using OpenCv library with windows form application](https://forum.opencv.org/t/im-just-new-in-using-opencv-and-i-am-making-a-face-recognition-app-using-opencv-library-with-windows-form-application/16177)

<div class="topic-metadata">

**Author:** [@Gino\_Carlo\_Rabina](https://forum.opencv.org/u/Gino_Carlo_Rabina)\
**Replies:** 3\
**Last updated:** [January 17, 2024, 5:05am UTC](https://forum.opencv.org/t/im-just-new-in-using-opencv-and-i-am-making-a-face-recognition-app-using-opencv-library-with-windows-form-application/16177 "2024-01-17T05:05:22Z")

</div>

Severity Code Description Project File Line Suppression State Error CS1503 Argument 1: cannot convert from ‘System.Drawing.Bitmap’ to ‘byte\[,,\*\]’ ClientSideFaceRecognition C:\\Users\\user\\Desktop\\VS Studio projects…

---

## [VideoWriter FFmpeg -movflags +faststart](https://forum.opencv.org/t/videowriter-ffmpeg-movflags-faststart/20111)

<div class="topic-metadata">

**Author:** [@Josh534](https://forum.opencv.org/u/Josh534)\
**Replies:** 0\
**Last updated:** [February 4, 2025, 8:54pm UTC](https://forum.opencv.org/t/videowriter-ffmpeg-movflags-faststart/20111 "2025-02-04T20:54:52Z")

</div>

Hello, I’m trying to write MP4 files using FFmpeg with the -movflags +faststart option, possibly with libx264, but I can’t seem to get it to work properly. I’ve tried setting the OPENCV\_FFMPEG\_WRITER\_OPTIONS environmen…

---

## [EMGU windows gets frozen when this gets open via "Imshow" method](https://forum.opencv.org/t/emgu-windows-gets-frozen-when-this-gets-open-via-imshow-method/19636)

<div class="topic-metadata">

**Author:** [@PereTGN](https://forum.opencv.org/u/PereTGN)\
**Replies:** 2\
**Last updated:** [December 29, 2024, 11:45am UTC](https://forum.opencv.org/t/emgu-windows-gets-frozen-when-this-gets-open-via-imshow-method/19636 "2024-12-29T11:45:33Z")

</div>

Hello, I’m using C# to take a screenshot of my Laptop screen and placed it into the EMGU window via “Imshow” method(see code below). Code compiles and runs but the EMGU window is not showing the screeshot and gets f…

---

## [How to Reduce FPS for Live Camera Feed (RTSP)](https://forum.opencv.org/t/how-to-reduce-fps-for-live-camera-feed-rtsp/19637)

<div class="topic-metadata">

**Author:** [@Josh534](https://forum.opencv.org/u/Josh534)\
**Replies:** 0\
**Last updated:** [December 28, 2024, 8:01pm UTC](https://forum.opencv.org/t/how-to-reduce-fps-for-live-camera-feed-rtsp/19637 "2024-12-28T20:01:01Z")

</div>

Hello, I’m working with a live RTSP camera feed in C# (using VideoCapture) and would like to reduce the incoming FPS for the purpose of detection (for performance optimization). Unfortunately, I can’t change the FPS se…

---

## [Emgu.CV.CvInvoke throws DllNotFoundException: Unable to load DLL 'cvextern'](https://forum.opencv.org/t/emgu-cv-cvinvoke-throws-dllnotfoundexception-unable-to-load-dll-cvextern/19628)

<div class="topic-metadata">

**Author:** [@PereTGN](https://forum.opencv.org/u/PereTGN)\
**Replies:** 2\
**Last updated:** [December 28, 2024, 6:37pm UTC](https://forum.opencv.org/t/emgu-cv-cvinvoke-throws-dllnotfoundexception-unable-to-load-dll-cvextern/19628 "2024-12-28T18:37:30Z")

</div>

Hello, I’m coding with C# and I’m trying to assign a model (xml file) to a cascadeclassifier object and for some reason a get an exception using the 4.9.0 version but the exact same code compile and works well with the …

---

## [How to accumulate images with C# with opencv?](https://forum.opencv.org/t/how-to-accumulate-images-with-c-with-opencv/18013)

<div class="topic-metadata">

**Author:** [@Me17](https://forum.opencv.org/u/Me17)\
**Replies:** 16\
**Last updated:** [July 2, 2024, 8:05am UTC](https://forum.opencv.org/t/how-to-accumulate-images-with-c-with-opencv/18013 "2024-07-02T08:05:35Z")

</div>

I would like to accumulate grayscale images in C# with opencv. Therefore I used this code so far: // Convert to gray image first Mat dst = new Mat(); Cv2.CvtColor(imageMat, dst, ColorConversionCodes.BGR2GRAY); var numO…

---

## [I am unable to rotate or deskew the image it is not rotating correctly in opencvsharp](https://forum.opencv.org/t/i-am-unable-to-rotate-or-deskew-the-image-it-is-not-rotating-correctly-in-opencvsharp/17825)

<div class="topic-metadata">

**Author:** [@kraytonian](https://forum.opencv.org/u/kraytonian)\
**Replies:** 6\
**Last updated:** [June 8, 2024, 6:24am UTC](https://forum.opencv.org/t/i-am-unable-to-rotate-or-deskew-the-image-it-is-not-rotating-correctly-in-opencvsharp/17825 "2024-06-08T06:24:28Z")

</div>

Github issue using opencvsharp for rotation/deskewing an Image is not rotating correctly · Issue #1672 · shimat/opencvsharp · GitHub

---

## [C# WPF opencvsharp4 obtaining all camera initial settings](https://forum.opencv.org/t/c-wpf-opencvsharp4-obtaining-all-camera-initial-settings/17806)

<div class="topic-metadata">

**Author:** [@zh\_y](https://forum.opencv.org/u/zh_y)\
**Replies:** 1\
**Last updated:** [May 31, 2024, 10:41am UTC](https://forum.opencv.org/t/c-wpf-opencvsharp4-obtaining-all-camera-initial-settings/17806 "2024-05-31T10:41:12Z")

</div>

videoCapture = new VideoCapture(0, VideoCaptureAPIs.DSHOW); try { videoCapture.FrameWidth = 1920; videoCapture.FrameHeight = 1080; videoCapture.Fps = 30; videoCapture.AutoExposure = 1; videoCa…

---

## [I can't achieve higher resolution without experiencing a drop in FPS](https://forum.opencv.org/t/i-cant-achieve-higher-resolution-without-experiencing-a-drop-in-fps/16986)

<div class="topic-metadata">

**Author:** [@Manu](https://forum.opencv.org/u/Manu)\
**Replies:** 6\
**Last updated:** [April 5, 2024, 12:35pm UTC](https://forum.opencv.org/t/i-cant-achieve-higher-resolution-without-experiencing-a-drop-in-fps/16986 "2024-04-05T12:35:23Z")

</div>

I am unable to use a camera at its full capacity with either the OpenCvSharp or Emgu.CV library in C# .NET Framework. Setting the resolution to the camera’s maximum possible resolution doesn’t work, and with two differen…

---

## [EmguCv stream Mat frames as RTSP pipeline](https://forum.opencv.org/t/emgucv-stream-mat-frames-as-rtsp-pipeline/16882)

<div class="topic-metadata">

**Author:** [@juan1](https://forum.opencv.org/u/juan1)\
**Replies:** 4\
**Last updated:** [March 20, 2024, 8:45am UTC](https://forum.opencv.org/t/emgucv-stream-mat-frames-as-rtsp-pipeline/16882 "2024-03-20T08:45:36Z")

</div>

Hi, I’m doing a C# application with some image processing from RealSense camera using EmguCv and I want to stream images to RTSP pipeline to allow other (multiple) clients to view RTSP stream. At the moment I have fram…

---

## [Can't load file NativeMethods.cs](https://forum.opencv.org/t/cant-load-file-nativemethods-cs/16736)

<div class="topic-metadata">

**Author:** [@Maahi](https://forum.opencv.org/u/Maahi)\
**Replies:** 1\
**Last updated:** [March 7, 2024, 2:48pm UTC](https://forum.opencv.org/t/cant-load-file-nativemethods-cs/16736 "2024-03-07T14:48:10Z")

</div>

Can’t load file NativeMethods.cs under C:\\projects\\opencvsharp\\src\\OpenCvSharp\\PInvoke. Check the file permission and the existence of that file.

---

## [How to save/load the whole internal states (not the parameters) of the BackgroundSubtractors, OpenCVSharp?](https://forum.opencv.org/t/how-to-save-load-the-whole-internal-states-not-the-parameters-of-the-backgroundsubtractors-opencvsharp/15447)

<div class="topic-metadata">

**Author:** [@Aram\_Nasser](https://forum.opencv.org/u/Aram_Nasser)\
**Replies:** 4\
**Last updated:** [November 9, 2023, 2:53pm UTC](https://forum.opencv.org/t/how-to-save-load-the-whole-internal-states-not-the-parameters-of-the-backgroundsubtractors-opencvsharp/15447 "2023-11-09T14:53:11Z")

</div>

I have successfully used OpenCVSharp, specifically the BackgroundSubtractorGMG, BackgroundSubtractorKNN, and BackgroundSubtractorMOG2, to perform background subtraction on images. However, when attempting to save the tra…

---

## [The Type Initializer for OpenCV.Net.Native.NativeMethods threw an exception](https://forum.opencv.org/t/the-type-initializer-for-opencv-net-native-nativemethods-threw-an-exception/14713)

<div class="topic-metadata">

**Author:** [@Alexander\_Benson](https://forum.opencv.org/u/Alexander_Benson)\
**Replies:** 1\
**Last updated:** [October 1, 2023, 9:47am UTC](https://forum.opencv.org/t/the-type-initializer-for-opencv-net-native-nativemethods-threw-an-exception/14713 "2023-10-01T09:47:10Z")

</div>

I have been having a lot of difficulty figuring this run time error out. I’m trying to run A Basler camera through Pylon using a program called Bonsai that launches multiple applications at the same time. The camera i…

---

## [Can not get any non-empty frame](https://forum.opencv.org/t/can-not-get-any-non-empty-frame/14590)

<div class="topic-metadata">

**Author:** [@zhou](https://forum.opencv.org/u/zhou)\
**Replies:** 0\
**Last updated:** [September 19, 2023, 7:38am UTC](https://forum.opencv.org/t/can-not-get-any-non-empty-frame/14590 "2023-09-19T07:38:45Z")

</div>

Summary of your issue can not get any non-empty frame Environment windows 7 x64 + winform (.Net6) installed Framework4.8/4.6.1 installed nugetpackage OpenCvSharp4.Extensions OpenCvSharp4.runtime.win What did you do whe…

---

## [How can I find all circles in this pictures?](https://forum.opencv.org/t/how-can-i-find-all-circles-in-this-pictures/14165)

<div class="topic-metadata">

**Author:** [@manuHund](https://forum.opencv.org/u/manuHund)\
**Replies:** 2\
**Last updated:** [August 8, 2023, 5:45am UTC](https://forum.opencv.org/t/how-can-i-find-all-circles-in-this-pictures/14165 "2023-08-08T05:45:27Z")

</div>

Hi everyone for a glass fiber project I need to find every of these fibers. The first picture is a good fibre, the second is not so good :smiley: actually I inverted the complete picture and did a Blob detection. My…

---

## [Issues with crosscompiling opencvsharp: "Error adding symbols; File in wrong format" for .so files](https://forum.opencv.org/t/issues-with-crosscompiling-opencvsharp-error-adding-symbols-file-in-wrong-format-for-so-files/13352)

<div class="topic-metadata">

**Author:** [@rash\_dev](https://forum.opencv.org/u/rash_dev)\
**Replies:** 3\
**Last updated:** [May 30, 2023, 5:39am UTC](https://forum.opencv.org/t/issues-with-crosscompiling-opencvsharp-error-adding-symbols-file-in-wrong-format-for-so-files/13352 "2023-05-30T05:39:38Z")

</div>

I am having this problem when trying to cross compile opencvsharp after successfully building and making opencv (for linux-arm64). I cmake opencvsharp with no problems but when I make I get this “Error adding Symbols; Fi…

---

## [OpenCVSharp GetLayer](https://forum.opencv.org/t/opencvsharp-getlayer/12862)

<div class="topic-metadata">

**Author:** [@Visionary](https://forum.opencv.org/u/Visionary)\
**Replies:** 1\
**Last updated:** [April 19, 2023, 6:59pm UTC](https://forum.opencv.org/t/opencvsharp-getlayer/12862 "2023-04-19T18:59:02Z")

</div>

Is there a possibility to specific GetLayer using OpenCvSharp? var net = CvDnn.ReadNetFromTensorflow(path); // Set the number of groups int ngroups = 1; // specify the number of groups here fore…

---

## [Excessive memory leak even after calling GC.Collect()](https://forum.opencv.org/t/excessive-memory-leak-even-after-calling-gc-collect/11141)

<div class="topic-metadata">

**Author:** [@zulfiker\_shishir](https://forum.opencv.org/u/zulfiker_shishir)\
**Replies:** 1\
**Last updated:** [November 29, 2022, 10:15am UTC](https://forum.opencv.org/t/excessive-memory-leak-even-after-calling-gc-collect/11141 "2022-11-29T10:15:34Z")

</div>

I am using Opencvsharp library and running a WPF Desktop application where i load image with 20/25 faces . Run face detection on this image and after that execute emotion analysis on these detected faces based on onnx ml…

---

## [Covert Type OutputArray](https://forum.opencv.org/t/covert-type-outputarray/10727)

<div class="topic-metadata">

**Author:** [@Matthias\_R](https://forum.opencv.org/u/Matthias_R)\
**Replies:** 0\
**Last updated:** [October 28, 2022, 10:12am UTC](https://forum.opencv.org/t/covert-type-outputarray/10727 "2022-10-28T10:12:43Z")

</div>

Hello! I try to convert a OpenCvSharp.OutputArray to a byte array, because i need to store it as byte array. Can someone help me please how i could do this in c#

---

## [Subdiv2D subtract holes (black pixels) from mesh](https://forum.opencv.org/t/subdiv2d-subtract-holes-black-pixels-from-mesh/10716)

<div class="topic-metadata">

**Author:** [@sn4k3](https://forum.opencv.org/u/sn4k3)\
**Replies:** 2\
**Last updated:** [October 28, 2022, 2:35am UTC](https://forum.opencv.org/t/subdiv2d-subtract-holes-black-pixels-from-mesh/10716 "2022-10-28T02:35:38Z")

</div>

I’m trying to convert a stack of images to a 3D mesh. First as test i’m trying to convert just 1 layer, i’m using Subdiv2D to get the triangles from the scanned contours, but it render the holes as positive areas in the…

---

## [Translate python code to c#/c++](https://forum.opencv.org/t/translate-python-code-to-c-c/10126)

<div class="topic-metadata">

**Author:** [@andife](https://forum.opencv.org/u/andife)\
**Replies:** 1\
**Last updated:** [September 9, 2022, 9:44am UTC](https://forum.opencv.org/t/translate-python-code-to-c-c/10126 "2022-09-09T09:44:22Z")

</div>

Hello, I wonder if there is an easy to translate the following python code to c# without looping over all indices? normPic = Pic - min(Pic(:)); normPic = normPic ./ max(normPic(:)); imagesc(normPic.^(1/4)) colormap …

---

## [Deploying OpenCV on RedHat distribution](https://forum.opencv.org/t/deploying-opencv-on-redhat-distribution/4951)

<div class="topic-metadata">

**Author:** [@slashmeister](https://forum.opencv.org/u/slashmeister)\
**Replies:** 2\
**Last updated:** [August 29, 2022, 11:25am UTC](https://forum.opencv.org/t/deploying-opencv-on-redhat-distribution/4951 "2022-08-29T11:25:51Z")

</div>

Is there a list of all the dependencies needed to deploy OpenCV on RedHat? I am using the following docker image (registry.access.redhat.com/ubi8/dotnet-50-runtime). At runtime, I get the following error: —\> System.T…

---

## [Imread return empty matrix](https://forum.opencv.org/t/imread-return-empty-matrix/9873)

<div class="topic-metadata">

**Author:** [@Mathieu\_G](https://forum.opencv.org/u/Mathieu_G)\
**Replies:** 8\
**Last updated:** [August 17, 2022, 10:26am UTC](https://forum.opencv.org/t/imread-return-empty-matrix/9873 "2022-08-17T10:26:59Z")

</div>

I am using the C# wrapper but maybe you could have some tracks to follow to help me. Imread is not working anymore with “.tif” file (48bits) after updating the OpenCvSharp wrapper version from OpenCvSharp3Any-Cpu (wrapp…

---

## [Optical Character Recognition](https://forum.opencv.org/t/optical-character-recognition/8815)

<div class="topic-metadata">

**Author:** [@Barabba](https://forum.opencv.org/u/Barabba)\
**Replies:** 1\
**Last updated:** [May 23, 2022, 3:29pm UTC](https://forum.opencv.org/t/optical-character-recognition/8815 "2022-05-23T15:29:30Z")

</div>

Hi everyone I am working with C # and I would like to create an OCR program. I have a sports scoreboard with real-time scoring. Any advice or project? Thanks

---

## [FindEssentialMat for 2 drone images](https://forum.opencv.org/t/findessentialmat-for-2-drone-images/8494)

<div class="topic-metadata">

**Author:** [@DenysNazarenko](https://forum.opencv.org/u/DenysNazarenko)\
**Replies:** 0\
**Last updated:** [April 21, 2022, 2:16pm UTC](https://forum.opencv.org/t/findessentialmat-for-2-drone-images/8494 "2022-04-21T14:16:04Z")

</div>

Hello, I have 2 images made by the calibrated drone. So I have all camera parameters. Manually I select the same points on both images and pass this information to the function. CameraMatrix1\[0, 0\] = f; …

---

## [Manipulating and accessing Mat data in EmguCV: how to get array elements and apply scalar?](https://forum.opencv.org/t/manipulating-and-accessing-mat-data-in-emgucv-how-to-get-array-elements-and-apply-scalar/8418)

<div class="topic-metadata">

**Author:** [@FupaTroopa](https://forum.opencv.org/u/FupaTroopa)\
**Replies:** 4\
**Last updated:** [April 15, 2022, 10:42pm UTC](https://forum.opencv.org/t/manipulating-and-accessing-mat-data-in-emgucv-how-to-get-array-elements-and-apply-scalar/8418 "2022-04-15T22:42:16Z")

</div>

I’ve started using EmguCV in C# and there is a bit of an adjustment, as method calls here are not all 1-to-1 as they are in C++. If I have a histogram image to work with I call “hist”, and I wanted to access its element…

---

## [How to interpret the result from the yolov3 with blobFromImages as input?](https://forum.opencv.org/t/how-to-interpret-the-result-from-the-yolov3-with-blobfromimages-as-input/7636)

<div class="topic-metadata">

**Author:** [@SanSancr777](https://forum.opencv.org/u/SanSancr777)\
**Replies:** 14\
**Last updated:** [February 21, 2022, 8:13pm UTC](https://forum.opencv.org/t/how-to-interpret-the-result-from-the-yolov3-with-blobfromimages-as-input/7636 "2022-02-21T20:13:32Z")

</div>

How to use the result for each image when processing the batch of images using the blobfromimages as the input to the yolo model ? How the post processing for each image should be approached to get the bounding box val…

[Next page](https://forum.opencv.org/tag/csharp/265.md?match_all_tags=true&page=1&tags%5B%5D=csharp)
