Esempio n. 1
0
    public static PImage MakeLabel(string text, double fontSize, int thickness, PColour3i labelColour)
    {
        PImage ret = new PImage(PapillonPINVOKE.PUtils_MakeLabel__SWIG_4(text, fontSize, thickness, PColour3i.getCPtr(labelColour)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 2
0
    public static PImage MakeLabel(string text, double fontSize, int thickness, PColour3i labelColour, PColour3i textColor, int border, PImage.EFont font, PImage.EPixelFormat pixelFormat)
    {
        PImage ret = new PImage(PapillonPINVOKE.PUtils_MakeLabel__SWIG_0(text, fontSize, thickness, PColour3i.getCPtr(labelColour), PColour3i.getCPtr(textColor), border, (int)font, (int)pixelFormat), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 3
0
    public PResult DrawEllipse(int x, int y, int width, int height, PColour3i color)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_DrawEllipse__SWIG_1(swigCPtr, x, y, width, height, PColour3i.getCPtr(color)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 4
0
    public static PResult DrawDetection(PImage image, PDetection detection, PColour3i colour, bool drawId, bool boundingBoxOnly, int lineWidth)
    {
        PResult ret = new PResult(PapillonPINVOKE.PUtils_DrawDetection__SWIG_0(PImage.getCPtr(image), PDetection.getCPtr(detection), PColour3i.getCPtr(colour), drawId, boundingBoxOnly, lineWidth), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 5
0
    public static PResult DrawDetection(PImage image, PDetection detection, PColour3i colour)
    {
        PResult ret = new PResult(PapillonPINVOKE.PUtils_DrawDetection__SWIG_3(PImage.getCPtr(image), PDetection.getCPtr(detection), PColour3i.getCPtr(colour)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 6
0
    public PResult FillRectangle(PRectanglei r, PColour3i color)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_FillRectangle(swigCPtr, PRectanglei.getCPtr(r), PColour3i.getCPtr(color)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 7
0
    public static PResult BlurDetection(PImage image, PDetection detection, PColour3i color, int lineWidth)
    {
        PResult ret = new PResult(PapillonPINVOKE.PUtils_BlurDetection(PImage.getCPtr(image), PDetection.getCPtr(detection), PColour3i.getCPtr(color), lineWidth), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 8
0
    public PResult DrawCircle(int x, int y, int radius, PColour3i color)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_DrawCircle__SWIG_3(swigCPtr, x, y, radius, PColour3i.getCPtr(color)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 9
0
    public PResult DrawCircle(PPoint2Df p, int radius, PColour3i color, int thickness)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_DrawCircle__SWIG_0(swigCPtr, PPoint2Df.getCPtr(p), radius, PColour3i.getCPtr(color), thickness), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 10
0
    public PResult DrawLabel(string text, PPoint2Di centre, PColour3i labelColour)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_DrawLabel__SWIG_3(swigCPtr, text, PPoint2Di.getCPtr(centre), PColour3i.getCPtr(labelColour)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 11
0
    public PResult DrawLine(int x1, int y1, int x2, int y2, PColour3i color)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_DrawLine__SWIG_1(swigCPtr, x1, y1, x2, y2, PColour3i.getCPtr(color)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 12
0
    public static PResult DrawFeatureMap(PImage image, PFeatureMap featureMap, PColour3i colour)
    {
        PResult ret = new PResult(PapillonPINVOKE.PUtils_DrawFeatureMap__SWIG_2(PImage.getCPtr(image), PFeatureMap.getCPtr(featureMap), PColour3i.getCPtr(colour)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 13
0
    public PResult DrawLabel(string text, PPoint2Di centre, PColour3i labelColour, PColour3i textColor, PImage.EFont font, double labelScale)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_DrawLabel__SWIG_0(swigCPtr, text, PPoint2Di.getCPtr(centre), PColour3i.getCPtr(labelColour), PColour3i.getCPtr(textColor), (int)font, labelScale), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 14
0
    public PResult DrawString(string text, PPoint2Di origin, PImage.EFont font, PColour3i color)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_DrawString__SWIG_1(swigCPtr, text, PPoint2Di.getCPtr(origin), (int)font, PColour3i.getCPtr(color)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 15
0
    public PResult DrawRectangle(PRectanglef r, PColour3i color, int thickness)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_DrawRectangle__SWIG_2(swigCPtr, PRectanglef.getCPtr(r), PColour3i.getCPtr(color), thickness), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 16
0
    public PResult DrawPolygon(PPolygonf p, PColour3i color)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_DrawPolygon__SWIG_3(swigCPtr, PPolygonf.getCPtr(p), PColour3i.getCPtr(color)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 17
0
    public PResult DrawString(string text, PPoint2Di origin, string fontName, int fontSize, PColour3i fontColor)
    {
        PResult ret = new PResult(PapillonPINVOKE.PImage_DrawString__SWIG_2(swigCPtr, text, PPoint2Di.getCPtr(origin), fontName, fontSize, PColour3i.getCPtr(fontColor)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 18
0
    public static PColour3i Yellow()
    {
        PColour3i ret = new PColour3i(PapillonPINVOKE.PColour3i_Yellow(), false);

        return(ret);
    }
Esempio n. 19
0
    public static PColour3i Black()
    {
        PColour3i ret = new PColour3i(PapillonPINVOKE.PColour3i_Black(), false);

        return(ret);
    }
Esempio n. 20
0
    public static PColour3i Lightgray()
    {
        PColour3i ret = new PColour3i(PapillonPINVOKE.PColour3i_Lightgray(), false);

        return(ret);
    }
Esempio n. 21
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PColour3i obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Esempio n. 22
0
    public static PColour3i Fuschia()
    {
        PColour3i ret = new PColour3i(PapillonPINVOKE.PColour3i_Fuschia(), false);

        return(ret);
    }
Esempio n. 23
0
    public static PColour3i Coral()
    {
        PColour3i ret = new PColour3i(PapillonPINVOKE.PColour3i_Coral(), false);

        return(ret);
    }
Esempio n. 24
0
    public static PResult DisplayDetection(PDetection detection, string windowTitle, float scaleFactor, PColour3i colour)
    {
        PResult ret = new PResult(PapillonPINVOKE.PUtils_DisplayDetection__SWIG_3(PDetection.getCPtr(detection), windowTitle, scaleFactor, PColour3i.getCPtr(colour)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 25
0
    public static PResult DisplayFeatureMap(PFrame frame, PFeatureMap featureMap, string windowTitle, float scaleFactor, PColour3i colour)
    {
        PResult ret = new PResult(PapillonPINVOKE.PUtils_DisplayFeatureMap__SWIG_2(PFrame.getCPtr(frame), PFeatureMap.getCPtr(featureMap), windowTitle, scaleFactor, PColour3i.getCPtr(colour)), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 26
0
        static void Main(string[] args)
        {
            PLog.OpenConsoleLogger();
            PapillonSDK.Initialise();
            string SAMPLE_DIR = PPath.Join(PUtils.GetEnv("PAPILLON_INSTALL_DIR"), "Data", "Samples");


            // 1. load an image from disk (can be JPEG, TIF, BMP or PNG) and display it on screen
            PImage image = new PImage();

            image.Load(PPath.Join(SAMPLE_DIR, "sample.jpg")).OrDie();
            image.DisplayScaled("Papillon SDK - Original");
            // 2. perform some basic manipulations
            PImage image2 = new PImage();

            image.Resize(image2, 2.0f, PImage.EInterpolation.E_INTERPOLATION_CUBIC);     // create a new image by resizing the image loaded before
            image2.ExtractSubImage(image2, 50, 50, 700, 500);                            // extract a sub-image
            image2.DrawRectangle(new PRectanglei(5, 5, 690, 490), PColour3i.Black(), 2); // draw a rectangle on top of the image
            image2.Convert(image2, PImage.EPixelFormat.E_GREY8U);                        // convert image to grayscale
            image2.Display("Papillon SDK - Some basic manipulations");                   // display the new image in another window
            PImage rotatedImage = new PImage();

            image.Rotate(rotatedImage, 0);
            rotatedImage.Display("Rotated", 1500);
            image.Rotate(rotatedImage, 90);
            rotatedImage.Display("Rotated", 1500);
            image.Rotate(rotatedImage, 270);
            rotatedImage.Display("Rotated", 1500);
            image.Rotate(rotatedImage, -90);
            rotatedImage.Display("Rotated", 1500);
            // 3. save image to JPG format with a quality set to 90%
            image.Save("img1.jpg", 90);                                                                         // quality is an optional parameter; set to 95 by default
            image2.Save("img2.png");
            // 4. apply ENHANCE BRIGHTNESS image filter if the plugin is available)
            PImageFilter brightnessFilter = new PImageFilter();
            PProperties  param            = new PProperties();

            if (PImageFilter.Create("EnhanceBrightness", param, brightnessFilter).Ok())                          // create image filter from plugin
            {
                brightnessFilter.Set("scale", new PDouble(1.5));
                brightnessFilter.Set("delta", new PDouble(20));

                PImage brightImage = new PImage();
                brightnessFilter.Apply(image, brightImage);
                brightImage.Display("Papillon SDK - Enhance brightness");

                // swap red and blue channels
                PImage brightImageSwapped = new PImage();
                brightImage.SwapRGB(brightImageSwapped);
                brightImageSwapped.Display("Papillon SDK - Enhance brightness (rgb swapped)");
            }

            // 5. apply LACE image filter (if the plugin is available)
            PImageFilter laceFilter           = new PImageFilter();
            PProperties  laceFilterParameters = new PProperties();

            laceFilterParameters.Set("strength", new PDouble(0.5));
            if (PImageFilter.Create("LACE", laceFilterParameters, laceFilter).Ok())                                             // create image filter from plugin
            {
                PImage lacedImage = new PImage();
                laceFilter.Apply(image, lacedImage);
                lacedImage.Display("Papillon SDK - LACE (strength 0.5)");
            }
            // 6. apply HISTOGRAM EQUALISATION image filter (if the plugin is available)
            PImageFilter histogramEqualisationFilter = new PImageFilter();

            if (PImageFilter.Create("HistogramEqualisation", new PProperties(), histogramEqualisationFilter).Ok())           // create image filter from plugin
            {
                PImage histogramEqualisedImage = new PImage();
                histogramEqualisationFilter.Apply(image, histogramEqualisedImage);
                histogramEqualisedImage.Display("Papillon SDK - Histogram Equalised", 1000);
            }
        }
Esempio n. 27
0
    public static PColour3i Skyblue()
    {
        PColour3i ret = new PColour3i(PapillonPINVOKE.PColour3i_Skyblue(), false);

        return(ret);
    }
Esempio n. 28
0
    public static PColour3i White()
    {
        PColour3i ret = new PColour3i(PapillonPINVOKE.PColour3i_White(), false);

        return(ret);
    }
Esempio n. 29
0
    public static PColour3i Maroon()
    {
        PColour3i ret = new PColour3i(PapillonPINVOKE.PColour3i_Maroon(), false);

        return(ret);
    }
Esempio n. 30
0
    public static PResult DisplayDetection(PDetection detection, string windowTitle, float scaleFactor, PColour3i colour, bool drawId, bool boundingBoxOnly, int lineWidth)
    {
        PResult ret = new PResult(PapillonPINVOKE.PUtils_DisplayDetection__SWIG_0(PDetection.getCPtr(detection), windowTitle, scaleFactor, PColour3i.getCPtr(colour), drawId, boundingBoxOnly, lineWidth), true);

        if (PapillonPINVOKE.SWIGPendingException.Pending)
        {
            throw PapillonPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }