Raysefo

Raysefo

  • 1.5k
  • 284
  • 149.8k

Interface problem?

Jul 27 2015 1:51 AM
Hello guys,
 
It's been quite a while since I wrote my  code so now I am in trouble to manage to run the code for this function below. I am trying to do some image processing and then try to OCR it via tesseract. But the problem is I couldn't find out how to run the code below.
 
Here is the method I would like to call:
http://www.emgu.com/wiki/files/3.0.0-alpha/document/html/07038386-9f0e-1fa4-8e7c-7ec31b3b2a8f.htm
 
But I couldn't manage to set the parameters successfully:
IInputArray src, 	IOutputArray dst,
Here is what I tried to do:
Emgu.CV.IInputArray[] iarr;                 
Emgu.CV.IOutputArray[] oarr;
foreach (var image in images.OrderBy(key  => key.Value.Position.X ))          {                                                             
iarr = new Emgu.CV.IInputArray[1];                     
iarr.SetValue(image.Value.img, 0);                                            oarr = new Emgu.CV.IOutputArray[1];
arr.SetValue(image.Value.img, 0);                                           
CvInvoke.CopyMakeBorder(iarr[0], oarr[0], 12, 12, 12, 12, Emgu.CV.CvEnum.BorderType.Default);
It gives error when I try to set a value because it is an Interface. So I decided to implement a class using this interface but couldn't go much further. Any help would be great.
 public class CMB : Emgu.CV.IInputArray     
{         
public InputArray[] arr;         
public InputArray GetInputArray()         
{             
return arr[0];         
}         
public void SetInputArray(Dictionary<int, ImageProperty> img)         
{                      
}      
}

Answers (1)