def test_square_image(self):
     config_detector = pb.ConfigFiducialImage()
     config_threshold = pb.ConfigThreshold.create_fixed(50.0)
     pb.FactoryFiducial(np.uint8).square_image(config_detector,
                                               config_threshold)
Beispiel #2
0
#!/usr/bin/env python3

import pyboof as pb
import numpy as np
import os

data_path = "../data/example/fiducial/image/examples/"

# Load the camera parameters
intrinsic = pb.CameraPinhole()
intrinsic.load(os.path.join(data_path, "intrinsic.yaml"))

configFiducial = pb.ConfigFiducialImage()
configThreshold = pb.ConfigThreshold.create_local(pb.ThresholdType.LOCAL_MEAN,
                                                  10)

print("Configuring detector")
detector = pb.FactoryFiducial(np.uint8).square_image(configFiducial,
                                                     configThreshold)
detector.set_intrinsic(intrinsic)
detector.add_pattern(pb.load_single_band(
    data_path + "../patterns/pentarose.png", np.uint8),
                     side_length=4.0)
detector.add_pattern(pb.load_single_band(data_path + "../patterns/yu.png",
                                         np.uint8),
                     side_length=4.0)

print("Detecting image")
detector.detect(
    pb.load_single_band(os.path.join(data_path, "image00.jpg"), np.uint8))