gpt4 book ai didi

c# - 如何让 SourceAFIS 在 Ubuntu 上运行?

转载 作者:行者123 更新时间:2023-12-04 18:46:19 28 4
gpt4 key购买 nike

我正在尝试在带有单声道的 Ubuntu 上使用 SourceAFIS 1.7.0 并遇到一些错误。

1.

$ mono DatabaseAnalyzer.exe

Scanning folder TestDatabase

Running extractor benchmark

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

File name: 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

at DatabaseAnalyzer.DatabaseAnalyzer.RunExtractorBenchmark () <0x40674790 + 0x00033> in :0 at DatabaseAnalyzer.DatabaseAnalyzer.RunMatcherBenchmark () <0x40674600 + 0x000eb> in :0

at DatabaseAnalyzer.DatabaseAnalyzer.Run () <0x40642a40 + 0x000bf> in :0

at DatabaseAnalyzer.DatabaseAnalyzer.Main (System.String[] args) <0x4063bd50 + 0x00037> in :0

[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

File name: 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at DatabaseAnalyzer.DatabaseAnalyzer.RunExtractorBenchmark () <0x40674790 + 0x00033> in :0 at DatabaseAnalyzer.DatabaseAnalyzer.RunMatcherBenchmark () <0x40674600 + 0x000eb> in :0

at DatabaseAnalyzer.DatabaseAnalyzer.Run () <0x40642a40 + 0x000bf> in :0

at DatabaseAnalyzer.DatabaseAnalyzer.Main (System.String[] args) <0x4063bd50 + 0x00037> in :0



根据 https://sourceforge.net/p/sourceafis/discussion/1051112/thread/dd8df289/#a006 ,这里应该应用WinForms而不是WPF,并使用bitmap类来代替WPF的bitmapimage类,但是我不知 Prop 体怎么做。有人有这样的经历吗?

这是使用 WPF 位图类的原始函数

  static MyPerson Enroll(string filename, string name)
{
Console.WriteLine("Enrolling {0}...", name);

// Initialize empty fingerprint object and set properties
MyFingerprint fp = new MyFingerprint();
fp.Filename = filename;
// Load image from the file
Console.WriteLine(" Loading image from {0}...", filename);
BitmapImage image = new BitmapImage(new Uri(filename, UriKind.RelativeOrAbsolute));
fp.AsBitmapSource = image;
// Above update of fp.AsBitmapSource initialized also raw image in fp.Image
// Check raw image dimensions, Y axis is first, X axis is second
Console.WriteLine(" Image size = {0} x {1} (width x height)", fp.Image.GetLength(1), fp.Image.GetLength(0));

// Initialize empty person object and set its properties
MyPerson person = new MyPerson();
person.Name = name;
// Add fingerprint to the person
person.Fingerprints.Add(fp);

// Execute extraction in order to initialize fp.Template
Console.WriteLine(" Extracting template...");
Afis.Extract(person);
// Check template size
Console.WriteLine(" Template size = {0} bytes", fp.Template.Length);

return person;
}


  • $ mono SourceAFIS.FingerprintAnalysis.exe
    The entry point method could not be loaded


  • 我怎样才能用更有意义的异常(exception)来解决这个问题?

    最佳答案

    WinForms should be applied here instead of WPF and use bitmap class to replace the bitmapimage class of WPF, but I don't know how to do it exactly. Does anybody have such experience?



    你知道如何用 C# 语言编程吗?他们在那个论坛中的意思是您需要更改代码以不使用 WPF 库,而是使用 Windows 窗体 UI 工具包。

    如果您在运行时尝试加载“PresentationCore”时遇到异常,则意味着它仍在尝试加载 WPF。

    关于c# - 如何让 SourceAFIS 在 Ubuntu 上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37827003/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com