C
C#ā€¢2y ago
VRose

āœ… Installing Emgu CV

I've been trying installing Emgu.CV from NuGet but I've been facing this error, I've tried changing the .net framework but this error still occurs...any ideas how to solve it?
35 Replies
Nisay
Nisayā€¢2y ago
Hi, i am beginner programming in the c# Help me...
VRose
VRoseOPā€¢2y ago
I need help myself šŸ˜…
Nisay
Nisayā€¢2y ago
Yes, i need help myself... I am adding a button for updating, deleting and examining the data retrieved via web form and sql server. How do we establish the id button relationship so that the relevant buttons reach the relevant records? Thank you.
Buddy
Buddyā€¢2y ago
Do not hijack someone else's thread @Nisay !
Buddy
Buddyā€¢2y ago
Make your own thread in #help by pressing this button
Nisay
Nisayā€¢2y ago
Thanks...
VRose
VRoseOPā€¢2y ago
Thank you....
Buddy
Buddyā€¢2y ago
To bring back the original question
MODiX
MODiXā€¢2y ago
VRose#1239
I've been trying installing Emgu.CV from NuGet but I've been facing this error, I've tried changing the .net framework but this error still occurs...any ideas how to solve it?
Quoted by
<@!203166497198047232> from #Installing Emgu CV (click here)
From VRose#1239
React with āŒ to remove this embed.
Klarth
Klarthā€¢2y ago
What versions did you try for .NET Framework? 4.61 would be the absolute min for that package, but realistically there's no reason to not use .NET Framework 4.8+. Ideally, you would be on .NET instead of .NET Framework. https://www.nuget.org/packages/Emgu.CV#supportedframeworks-body-tab is what should be supported.
VRose
VRoseOPā€¢2y ago
Nvm, I was using an old version and it didn't work but I tried the last .NET version and the library installed sucessfully šŸ‘ However, I still can't figure out how to use it. I've Emgu CV 4.6.0.5131 but I don't know an up to date examples of how to get started with this library. Most of the old tutorials point to installing the library manually, however even doing that didn't help since in the tutorials, installing the library manually gives them a bin that has all of the necessary .dll files but I'm not getting that when I successfully install Emgu CV manually Also, when I try to use the project that has the library installed through NuGet, I get the following error:
System.EntryPointNotFoundException: 'Unable to find an entry point named 'cveVideoCaptureReadToMat' in DLL 'cvextern'.'
System.EntryPointNotFoundException: 'Unable to find an entry point named 'cveVideoCaptureReadToMat' in DLL 'cvextern'.'
From the following code:
public partial class FacialRecognitionTest : Form
{


private VideoCapture _cameraCapture;
private LBPHFaceRecognizer _faceRecognition;
private CascadeClassifier _faceDetector;
private Timer timer;
IInputArray image;


public FacialRecognitionTest()
{
InitializeComponent();

// Initialize the camera capture
_cameraCapture = new VideoCapture();
_cameraCapture.Start();

// Start the timer to process frames from the camera feed
timer = new Timer();
timer.Interval = 1000;
timer.Tick += new EventHandler(timer_Tick);
timer.Start();

}

private void timer_Tick(object sender, EventArgs e)
{

// Capture a frame from the camera
var cameraFrame = _cameraCapture.QueryFrame();
cameraBox.Image = cameraFrame.ToImage<Bgr, byte>().ToBitmap();
}
public partial class FacialRecognitionTest : Form
{


private VideoCapture _cameraCapture;
private LBPHFaceRecognizer _faceRecognition;
private CascadeClassifier _faceDetector;
private Timer timer;
IInputArray image;


public FacialRecognitionTest()
{
InitializeComponent();

// Initialize the camera capture
_cameraCapture = new VideoCapture();
_cameraCapture.Start();

// Start the timer to process frames from the camera feed
timer = new Timer();
timer.Interval = 1000;
timer.Tick += new EventHandler(timer_Tick);
timer.Start();

}

private void timer_Tick(object sender, EventArgs e)
{

// Capture a frame from the camera
var cameraFrame = _cameraCapture.QueryFrame();
cameraBox.Image = cameraFrame.ToImage<Bgr, byte>().ToBitmap();
}
I'm not sure if I need to do add any references although I've installed it through NuGet + I don't have any .dll when installing the library manually...Also, I'm not quite sure if my code is correct or not šŸ˜… @Klarth
Klarth
Klarthā€¢2y ago
Were you trying to upgrade/update an existing project? Or are you starting a new project with EmguCV?
VRose
VRoseOPā€¢2y ago
I installed the library on an existing project but I started by installing Emgu CV through NuGet
Klarth
Klarthā€¢2y ago
So this is a project that previously didn't have any EmguCV-related code in it?
VRose
VRoseOPā€¢2y ago
Yep
Klarth
Klarthā€¢2y ago
Klarth
Klarthā€¢2y ago
It looks like it manages native dependencies by separate packages. I'm not exactly sure how you're supposed to manage that per-build on your side.
VRose
VRoseOPā€¢2y ago
Its documentation is really awful as well...
Klarth
Klarthā€¢2y ago
Stuff like Avalonia pulls everything and then filters, AFAIK. But it's probably too large for OpenCV. šŸ¤·ā€ā™‚ļø That's pretty much to be expected for science/AI-related stuff in .NET.
VRose
VRoseOPā€¢2y ago
Are there any simpler or at least more well documented computer vision libraries for .NET? One that supports facial recognition? Or perhaps I should use "IronPython" to integrate a python script that does this into my .NET application?
Klarth
Klarthā€¢2y ago
I'd almost rather walk into a nest of spiders.
VRose
VRoseOPā€¢2y ago
šŸ˜…
Klarth
Klarthā€¢2y ago
Install the actual runtime dependencies you need. See what happens. Cascade classifiers are pretty old tech. I'm not sure if they're really used anymore in the application. šŸ¤·ā€ā™‚ļø
VRose
VRoseOPā€¢2y ago
I'm not even using that yet, I'm trying to just display the camera in a picturebox but this is not even working...It's opening the camera but then I get the error I shared earlier
VRose
VRoseOPā€¢2y ago
Tried installing
Emgu.CV.runtime.windows
Emgu.CV.runtime.windows
but got the following error:
Klarth
Klarthā€¢2y ago
Your choices are basically: 1. EmguCV. 2. ML.NET (via YOLO trained ONNX model https://learn.microsoft.com/en-us/dotnet/machine-learning/tutorials/object-detection-onnx) 3. Maybe TensorFlow/PyTorch bindings? šŸ¤·ā€ā™‚ļø ARM?
VRose
VRoseOPā€¢2y ago
I'm programming this on a x64 windows 11 computer, but weirdly the
Emgu.CV.runtime.ubuntu-x64
Emgu.CV.runtime.ubuntu-x64
got installed successfully šŸ˜…
Klarth
Klarthā€¢2y ago
catsweat
VRose
VRoseOPā€¢2y ago
You mean installing Emgu.TF?
Klarth
Klarthā€¢2y ago
Installs for me on Win10 / .NET 7
Klarth
Klarthā€¢2y ago
No, I mean finding some facial recognition model for python that's trained. Then port the prediction side to .NET's TensorFlow bindings. Also, if you're doing facial recognition (ie. "this face is Dave") with cascade classifiers, you're going to have a bad time. Facial tracking (ie. "this is a face") is about the best that tech could do, sometimes some facial features like position of eyes, nose, etc.
VRose
VRoseOPā€¢2y ago
Alright but first I'd like to figure out how to display the camera feed in the first place so I deal with face detection & recognition later on
Klarth
Klarthā€¢2y ago
But that approach died when convolution neural networks came along.
VRose
VRoseOPā€¢2y ago
Hmm so I'll try to find a way to achieve this using CNN instead, thank you for your advice
Accord
Accordā€¢2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server