예제 #1
0
        /// <summary>
        /// Creates a new BadPixel filter from a badpixel image.
        /// </summary>
        /// <param name="BadpixelFile">Badpixel input image: masked pixels are non-zero.</param>
        public static BitArray[] CreateFilter(Image BadpixelFile)
        {
            PositionDependentExtractor <BitArray[]> Algo = DetectSources;

            BitArray[] Mask = new BitArray[BadpixelFile.Height];
            for (int i = 0; i < BadpixelFile.Height; i++)
            {
                Mask[i] = new BitArray((int)BadpixelFile.Width);
            }
            Algo.Run(Mask, BadpixelFile, Parameters);
            return(Mask);
        }
예제 #2
0
        /// <summary>
        /// Runs the given algorithm on the input data.
        /// </summary>
        /// <typeparam name="T">Extra parameter type.</typeparam>
        /// <param name="Algorithm">Parallel algorithm.</param>
        /// <param name="Argument">Argument to be passed to all invocations.</param>
        /// <param name="Input">Input image.</param>
        /// <param name="Parameters">Parameters of the algorithm run.</param>
        public static void RunAlgorithm <T>(PositionDependentExtractor <T> Algorithm, T Argument, Image Input, AlgorithmRunParameters Parameters)
        {
            RunDetails details = new RunDetails()
            {
                Algorithm   = Algorithm,
                InputImages = new Image[] { Input },
                OutputImage = null,
                Parameters  = new object[] { Argument },
                Type        = AlgorithmType.PositionExtractor,
            };

            PrepareGeometry(ref details, Parameters);
            DefaultScheduler(details);
        }
예제 #3
0
        /// <summary>
        /// Detects light sources on the input image using hysteresis thresholding. Requires input image to be astrometrically reduced.
        /// </summary>
        /// <param name="Input">Input image.</param>
        /// <returns>A list of detections.</returns>
        public List <ImageDetection> Detect(Image Input)
        {
            Detections = new List <DotDetection>();
            PositionDependentExtractor <DotDetector> Extractor = DetectSources;

            Extractor.Run(this, Input, Parameters);

            List <ImageDetection> Mdect = Detections.Select((x) => StandardDetectionFactory.CreateDetection(Input, x.Pixels, x.PixelValues)).ToList();

            foreach (ImageDetection m in Mdect)
            {
                m.SetResetProperty(new PairingProperties()
                {
                    IsDotDetection = true
                });
            }
            return(Mdect);
        }
예제 #4
0
 public static void Run <T>(this PositionDependentExtractor <T> Algorithm, T Argument, Image Input, AlgorithmRunParameters Parameters)
 {
     RunAlgorithm(Algorithm, Argument, Input, Parameters);
 }