Esempio n. 1
0
def haarcascade_pipeline(haarfile):
    return \
        PipelineSequence(
            ("image", camera.READ_CAMERA_PIPELINE),
            camera.ConvertColorspacePipeline("grayscale"),
            ("cascades", camera.HaarcascadePipeline(haarfile))
        )
Esempio n. 2
0
def color_filter_pipeline(color="magenta"):
    return \
        PipelineSequence(
            camera.READ_CAMERA_PIPELINE,
            camera.ConvertColorspacePipeline(to='hsv'),
            camera.ColorThresholdPipeline(color=color),
            camera.ErodeDilatePipeline()
        )
Esempio n. 3
0
def box_tracking_pipeline(frame, bbox):
    return \
        PipelineSequence(
            camera.READ_CAMERA_PIPELINE,
            ConjunctiveParallelPipeline(
                PipelineSequence(
                    camera.ConvertColorspacePipeline(to='hsv'),
                    camera.TrackBBOXPipeline(frame, bbox),
                ),
                camera.GetImageDimensionsPipeline()
            ),
            camera.FindYDeviationPipeline()
        )
Esempio n. 4
0
def fast_color_tracking_pipeline(color="magenta"):
    return \
        PipelineSequence(
            ("image", camera.READ_CAMERA_PIPELINE),
            ConjunctiveParallelPipeline(
                PipelineSequence(
                    camera.ConvertColorspacePipeline(to='hsv'),
                    camera.ColorThresholdPipeline(color),
                    ("contour_bbox", camera.FastColorDetectionPipeline(color)),
                ),
                camera.GetImageDimensionsPipeline()
            ),
            ("y_deviation", camera.FindYDeviationPipeline())
        )
Esempio n. 5
0
def color_tracking_dbscan_pipeline(color="magenta"):
    return \
        PipelineSequence(
            ("image", camera.READ_CAMERA_PIPELINE),
            ConjunctiveParallelPipeline(
                PipelineSequence(
                    camera.ConvertColorspacePipeline(to='hsv'),
                    camera.ColorThresholdPipeline(color=color),
                    camera.ErodeDilatePipeline(),
                    ("contour_bbox", camera.DBSCANPipeline(eps=1.3, min_neighs=5))
                ),
                camera.GetImageDimensionsPipeline()
            ),
            ("y_deviation", camera.FindYDeviationPipeline())
        )
Esempio n. 6
0
def color_tracking_pipeline(color="magenta"):
    return \
        PipelineSequence(
            ("image", camera.READ_CAMERA_PIPELINE),
            ConjunctiveParallelPipeline(
                PipelineSequence(
                    ("hsv_image", camera.ConvertColorspacePipeline(to='hsv')),
                    ("threshold", camera.ColorThresholdPipeline(color=color)),
                    ("filtered", camera.ErodeDilatePipeline()),
                    ("contour_bbox", camera.GetLargestContourPipeline())
                ),
                camera.GetImageDimensionsPipeline()
            ),
            ("raw_y_deviation", camera.FindYDeviationPipeline()),
            ("y_deviation", camera.KalmanFilterPipeline())
        )