Не удалось импортировать EmguCV в Python - PullRequest
0 голосов
/ 13 июля 2020

Я пытался импортировать Emgu.CV, но не смог.

среда: Ubuntu 20.04, pytho nnet, mono

Вот код:

import numpy as np
from PIL import Image
import clr
clr.AddReference('Emgu.CV')
from Emgu.CV import *

а затем вот сообщение об ошибке:

Unhandled Exception:
System.TypeLoadException: Could not resolve type with token 01000019 from typeref (expected class 'System.Drawing.Size' in assembly 'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo.get_method_info(intptr,System.Reflection.MonoMethodInfo&)
  at System.Reflection.MonoMethodInfo.GetMethodInfo (System.IntPtr handle) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at System.Reflection.MonoMethodInfo.GetDeclaringType (System.IntPtr handle) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at System.Reflection.RuntimeMethodInfo.get_DeclaringType () [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at Python.Runtime.ClassManager.GetClassInfo (System.Type type) [0x00035] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ClassManager.InitClassBase (System.Type type, Python.Runtime.ClassBase impl) [0x00000] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ClassManager.GetClass (System.Type type) [0x00028] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ModuleObject.GetAttribute (System.String name, System.Boolean guess) [0x0008e] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ModuleObject.GetAttribute (System.String name, System.Boolean guess) [0x00130] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ModuleObject.LoadNames () [0x00047] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ImportHook.__import__ (System.IntPtr self, System.IntPtr args, System.IntPtr kw) [0x00301] in <5796c913ef894471b5861e1a904d8918>:0 
  at (wrapper native-to-managed) Python.Runtime.ImportHook.__import__(intptr,intptr,intptr)
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not resolve type with token 01000019 from typeref (expected class 'System.Drawing.Size' in assembly 'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo.get_method_info(intptr,System.Reflection.MonoMethodInfo&)
  at System.Reflection.MonoMethodInfo.GetMethodInfo (System.IntPtr handle) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at System.Reflection.MonoMethodInfo.GetDeclaringType (System.IntPtr handle) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at System.Reflection.RuntimeMethodInfo.get_DeclaringType () [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at Python.Runtime.ClassManager.GetClassInfo (System.Type type) [0x00035] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ClassManager.InitClassBase (System.Type type, Python.Runtime.ClassBase impl) [0x00000] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ClassManager.GetClass (System.Type type) [0x00028] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ModuleObject.GetAttribute (System.String name, System.Boolean guess) [0x0008e] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ModuleObject.GetAttribute (System.String name, System.Boolean guess) [0x00130] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ModuleObject.LoadNames () [0x00047] in <5796c913ef894471b5861e1a904d8918>:0 
  at Python.Runtime.ImportHook.__import__ (System.IntPtr self, System.IntPtr args, System.IntPtr kw) [0x00301] in <5796c913ef894471b5861e1a904d8918>:0 
  at (wrapper native-to-managed) Python.Runtime.ImportHook.__import__(intptr,intptr,intptr)
...