我尝试通过MPEG7描述符来比较图像,我发现了一个通过http://chatzichristofis.info/?page_id=19实现的方法,但是当我调用Apply()函数时,就抛出了异常。
EHD_Descriptor ehd = new EHD_Descriptor(11);
var img = new Bitmap("LargerImage.jpg");
.
.
.
descriptor = ehd.Apply(img);
descriptor = ehd.Quant(descriptor);异常
System.AccessViolationException was unhandled
HResult=-2147467261
Message=...有没有人有使用这些描述符或引用其他描述符的经验,这些描述符可以无例外地工作(我想是来自非托管代码)?
发布于 2015-01-23 21:47:43
如果有人有同样的问题,只需要处理其他图像,那么一个解决方案是:
[HandleProcessCorruptedStateExceptions]
[SecurityCritical]
private double[] DoSecurityCritical(SimpleRnd.CEDD cedd, Bitmap img) {
try {
// List<double[]> temp = locate.extract(img,600);
double [] temp = cedd.Apply(img);
return temp;
} catch (Exception) {
return null;
}
}只需对安全属性使用更强的catch即可。
https://stackoverflow.com/questions/27976036
复制相似问题