예제 #1
0
        public static Pix Deskew(Pix pix, Sweep sweep, int redSearch, int threshold, out Scew scew)
        {
            float  angle, confidence;
            IntPtr p = LeptonicaNativeApi.Native.pixDeskewGeneral(pix.Reference, sweep.Reduction, sweep.Range, sweep.Delta, redSearch, threshold, out angle, out confidence);

            if (p == IntPtr.Zero)
            {
                throw new NullReferenceException("failed to deskew.");
            }
            scew = new Scew()
            {
                Angle      = angle,
                Confidence = confidence
            };
            return(Pix.Create(p));
        }
예제 #2
0
 public static Pix Deskew(Pix pix, int redSearch, out Scew scew)
 {
     return(Deskew(pix, Sweep.Default, redSearch, DefaultBinaryThreshold, out scew));
 }
예제 #3
0
 public static Pix Deskew(Pix pix, out Scew scew)
 {
     return(Deskew(pix, DefaultBinarySearchReduction, out scew));
 }