Beispiel #1
0
            public static void PreProcessingGetConfig(out PreProcessingInfo preProcessingInfo)
            {
                preProcessingInfo = new PreProcessingInfo();

                bool usesPreProcessing = false;

                PreProcessingUsesPreProcessing(ref usesPreProcessing);

                if (usesPreProcessing)
                {
                    preProcessingInfo.PreProcessing = true;

                    PreProcessingType preProcessingType = PreProcessingType.None;
                    ushort            fromValue         = 0;
                    ushort            toValue           = 0;
                    int brigtness = 0;
                    int contrast  = 0;
                    TangraConfig.PreProcessingFilter filter = 0;
                    float          gamma = 0;
                    int            reversedCameraResponse = 0;
                    ushort         darkPixelsCount        = 0;
                    ushort         flatPixelsCount        = 0;
                    ushort         biasPixelsCount        = 0;
                    RotateFlipType rotateFlipType         = 0;
                    ushort         hotPixelsPosCount      = 0;

                    PreProcessingGetConfig(ref preProcessingType, ref fromValue, ref toValue, ref brigtness, ref contrast, ref filter, ref gamma, ref reversedCameraResponse, ref darkPixelsCount, ref flatPixelsCount, ref biasPixelsCount, ref rotateFlipType, ref hotPixelsPosCount);

                    preProcessingInfo.PreProcessingType = preProcessingType;
                    preProcessingInfo.RotateFlipType    = rotateFlipType;

                    if (preProcessingType == PreProcessingType.BrightnessContrast)
                    {
                        preProcessingInfo.Brigtness = brigtness;
                        preProcessingInfo.Contrast  = contrast;
                    }
                    else if (preProcessingType == PreProcessingType.Stretching)
                    {
                        preProcessingInfo.StretchingFrom = fromValue;
                        preProcessingInfo.StretchingTo   = toValue;
                    }
                    else if (preProcessingType == PreProcessingType.Clipping)
                    {
                        preProcessingInfo.ClippingFrom = fromValue;
                        preProcessingInfo.ClippingTo   = toValue;
                    }

                    preProcessingInfo.GammaCorrection        = gamma;
                    preProcessingInfo.ReversedCameraResponse = (TangraConfig.KnownCameraResponse)reversedCameraResponse;
                    preProcessingInfo.Filter            = filter;
                    preProcessingInfo.DarkFrameBytes    = darkPixelsCount;
                    preProcessingInfo.FlatFrameBytes    = flatPixelsCount;
                    preProcessingInfo.BiasFrameBytes    = biasPixelsCount;
                    preProcessingInfo.HotPixelsPosCount = hotPixelsPosCount;
                }
            }
Beispiel #2
0
 private static extern int PreProcessingGetConfig(
     [In, Out] ref PreProcessingType preProcessingType,
     [In, Out] ref ushort fromValue,
     [In, Out] ref ushort toValue,
     [In, Out] ref int brigtness,
     [In, Out] ref int contrast,
     [In, Out] ref TangraConfig.PreProcessingFilter filter,
     [In, Out] ref float gamma,
     [In, Out] ref int reversedCameraResponse,
     [In, Out] ref ushort darkPixelsCount,
     [In, Out] ref ushort flatPixelsCount,
     [In, Out] ref ushort biasPixelsCount,
     [In, Out] ref RotateFlipType rotateFlipType,
     [In, Out] ref ushort hotPixelsPosCount);