0

I am trying to compare images by MPEG7 descriptors and I found a implementation by http://chatzichristofis.info/?page_id=19 but when I call Apply() function so the exception is thrown.

EHD_Descriptor ehd = new EHD_Descriptor(11);
var img = new Bitmap("LargerImage.jpg");
.
. 
.
descriptor = ehd.Apply(img);
descriptor = ehd.Quant(descriptor);

Exception

System.AccessViolationException was unhandled
  HResult=-2147467261
  Message=...

Does anyone has any experiance with these descriptors or any reference to other descriptors which works without exceptions (from unmanaged code, I think)?

wolen
  • 705
  • 2
  • 8
  • 21

1 Answers1

0

If someone has a same problem and just need to proccess other images, so one solution is:

    [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;
        }
    }

Just use stronger catch with security attributes.

wolen
  • 705
  • 2
  • 8
  • 21