Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Maui Video Surveillance is not working #897

Open
Hardikzinzala opened this issue Nov 20, 2023 · 8 comments
Open

[BUG]Maui Video Surveillance is not working #897

Hardikzinzala opened this issue Nov 20, 2023 · 8 comments
Assignees

Comments

@Hardikzinzala
Copy link

Hardikzinzala commented Nov 20, 2023

Describe the bug
Maui Video Surveillance is not working that give this Error
"OpenCV: The library is compiled without video support. To use this module, please switch to the full Emgu CV runtime."

** .Net version **
Windows (.Net Maui Version-7)
"Emgu.CV" Version="4.8.1.5350"
"Emgu.CV.Bitmap" Version="4.8.1.5350"
"Emgu.CV.Models" Version="4.8.1.5350"
"Emgu.CV.runtime.maui.mini" Version="4.8.1.5350"
"Emgu.CV.runtime.windows" Version="4.8.1.5350"
"Emgu.CV.UI" Version="4.8.1.5350"

CPU Architecture
Any CPU

@codewithriza
Copy link

Solution Implemented:
Hi @Hardikzinzala,

I encountered a similar issue and managed to resolve it by following these steps:

  1. Downgrade .Net Framework: From the project properties, I downgraded the .Net Framework to version 4.6.
  2. Uninstall Emgu.CV: Identified and uninstalled Emgu.CV and related packages, as prompted in the Errors List.
  3. Install Emgu.CV.runtime.windows: Used the Solution Nuget Manager to install Emgu.CV.runtime.windows (this step should proceed smoothly now).
  4. Upgrade .Net Framework: After successful installation, upgraded the .Net Framework back to version 4.8.
  5. Install Emgu.CV 4.5.1 and Emgu.CV.UI 4.5.1: Installed the latest versions of Emgu.CV and Emgu.CV.UI. Emgu.CV.Bitmwp was automatically installed in my case.

With these steps completed, I was able to utilize bitmap.ToImage<Bgr,Byte>(). Please note that Image<Bgr,byte>(bitmap) no longer functions after this update.

These steps might help in resolving the issue you're experiencing with Maui Video Surveillance. Feel free to give it a try and let me know if you encounter any difficulties or need further assistance.

@Hardikzinzala
Copy link
Author

Hardikzinzala commented Nov 20, 2023

this not working

@codewithriza
Copy link

Solution Update:

@Hardikzinzala, considering the issue persists, let's recheck some crucial steps and ensure the correct setup:

1. Check Emgu.CV Installation:

  • Ensure Emgu.CV and related packages are correctly installed. Use the Package Manager Console or Package Manager UI to reinstall or update the Emgu.CV package:
   Install-Package Emgu.CV -Version 4.5.1
   Install-Package Emgu.CV.UI -Version 4.5.1

-Verify that these versions are compatible with your .NET Maui project.

2. Confirm Dependencies:

  • Check for any conflicting dependencies by reviewing the installed packages in your project. Ensure that all dependencies are compatible and up-to-date.

3. Sample Code for Emgu.CV Initialization:

Here's an example of how you can initialize Emgu.CV within your .NET Maui application:

using Emgu.CV;
using Emgu.CV.UI;

// Initialize Emgu.CV
CvInvoke.UseOpenCL = false;

Review Error Messages:

  • If you're encountering specific error messages, please share them here. This information will be helpful in diagnosing the issue more accurately.
    -Please execute these steps and ensure they align with your project setup. If you encounter any errors or need further assistance, please provide details on where you're experiencing issues.

Feel free to engage with the community for additional insights or share any updates.

@Hardikzinzala
Copy link
Author

Hardikzinzala commented Nov 20, 2023

I try all of them In .Net Maui again same issue appear
"OpenCV: The library is compiled without video support. To use this module, please switch to the full Emgu CV runtime."

@codewithriza
Copy link

@Hardikzinzala,

To better assist you with the issue related to "OpenCV: The library is compiled without video support. To use this module, please switch to the full Emgu CV runtime," could you please share relevant code snippets or configurations associated with your usage of Emgu.CV for video processing?

Understanding the sections of your code or configurations interacting with Emgu.CV will greatly help in diagnosing the problem accurately. It will enable us to pinpoint potential areas requiring adjustments to resolve this issue.

Could you kindly paste excerpts of code pertaining to Emgu.CV initialization or any segments invoking video support functions? This will allow for a more focused analysis of the specific problem you're encountering.

@Hardikzinzala
Copy link
Author

CvInvoke.UseOpenCL = false;
Button videoSurveillanceButton = new Button();
videoSurveillanceButton.Text = "Video Surveillance";
buttonList.Add(videoSurveillanceButton);

videoSurveillanceButton.Clicked += (sender, args) =>
{
ProcessAndRenderPage videoPage = new ProcessAndRenderPage(
new VideoSurveillanceModel(),
"Open Camera",
null,
"");
videoPage.HasCameraOption = true;
this.Navigation.PushAsync(videoPage);
};

Video Model Code:-

private static IBackgroundSubtractor _fgDetector;
_fgDetector = new BackgroundSubtractorMOG2();

@codewithriza
Copy link

@Hardikzinzala

Thank you for sharing the code snippet.

The provided code appears to initiate a video surveillance action using Emgu.CV. The error, "OpenCV: The library is compiled without video support," suggests that the Emgu.CV runtime might lack necessary video-related components.

To potentially resolve this issue, consider the following steps:

1. Ensure Emgu.CV Configuration:

  • Confirm that Emgu.CV was installed with video support enabled. Recheck the installation configuration and make sure it includes video-related functionalities.

2. Check Emgu.CV Initialization:

  • Verify the initialization of Emgu.CV components. The code snippet you provided seems to start a video surveillance process. Review the initialization of 'VideoSurveillanceModel()' and its interaction with Emgu.CV.

3. Dependency Check:

  • Ensure all necessary dependencies for video support are correctly included and referenced within your project. Check if the 'BackgroundSubtractorMOG2()' function requires specific video-related dependencies that might be missing.

4. Emgu.CV Configuration Adjustments:

  • Consider reviewing the Emgu.CV configurations or settings related to video support. It might involve additional setup or configurations specific to enabling video functionalities.

Could you please provide additional code segments or configurations related to the 'VideoSurveillanceModel()' initialization or any sections interacting with video processing within Emgu.CV? This will help in pinpointing the exact area causing the issue.

Additionally, it might be beneficial to double-check the installation steps and configurations related to Emgu.CV to ensure proper integration of video support.

Feel free to provide more details or code snippets, as this will aid in diagnosing the problem accurately. We'll do our best to assist further once more information is available.

This is all I can do. Thank you.

@emgucv
Copy link
Owner

emgucv commented Nov 20, 2023

You are using the mini runtime for MAUI:
"Emgu.CV.runtime.maui.mini" Version="4.8.1.5350"

The mini runtime is only compiled with the Open CV Core and Imgproc module. It is not compiled with VideoSurveillance.

The full "Emgu.CV.runtime.maui" package has the VideoSurveillance, the full runtime is only available under the commercial license.

If you have the commercial license, you can setup to use the commercial nuget server by following this instructions:
https://www.emgu.com/wiki/index.php/Download_And_Installation#Commercial_Release

Once the commercial nuget repository is setup, you can install the "Emgu.CV.runtime.maui" nuget pacakge (please remove Emgu.CV.runtime.maui.mini" package first). Once the full runtime package is installed, the error message

"OpenCV: The library is compiled without video support. To use this module, please switch to the full Emgu CV runtime."

will disapear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants