コード例 #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;
                }
            }
コード例 #2
0
ファイル: TangraCore.cs プロジェクト: hpavlov/tangra3
            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;
                }
            }