2

I am trying to track a person's head with a binary fiducial printed. It can track fine when the person is moving slowly, but when they move their head quickly, it loses the track and then regains it when they stop moving. What can I do to track the person while they are moving quickly?

For reference, here is a screenshot and code:

    camera = UtilWebcamCapture.openDefault(1920, 1080);

    intrinsicParameters = new IntrinsicParameters();
    intrinsicParameters.setCx(camera.getViewSize().getWidth()/2f);
    intrinsicParameters.setCy(camera.getViewSize().getHeight()/2f);
    intrinsicParameters.setFx(1);
    intrinsicParameters.setFy(1);
    intrinsicParameters.setWidth((int)camera.getViewSize().getWidth());
    intrinsicParameters.setHeight((int)camera.getViewSize().getHeight());

    detector = FactoryFiducial.squareBinary(
            new ConfigFiducialBinary(1),
            ConfigThreshold.local(ThresholdType.LOCAL_SQUARE, 10),
            //ConfigThreshold.fixed(100),
            GrayU8.class);
    detector.setIntrinsic(intrinsicParameters);
    ...
    while (true) {
        BufferedImage image = camera.getImage();
        GrayU8 input = ConvertBufferedImage.convertFrom(image, (GrayU8) null);

        WorldToCameraToPixel transform;

        try {
            detector.detect(input);

            Se3_F64 targetToSensor = new Se3_F64();
            for (int i = 0; i < detector.totalFound(); i++) {
                detector.getFiducialToCamera(i, targetToSensor);

                transform = PerspectiveOps.createWorldToPixel(intrinsicParameters, targetToSensor);
                Point2D_F64 centre = transform.transform(
                        new Point3D_F64(0, 0, 0));

                System.out.println(centre);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Head Tracker

Thanks!

jjtjj222
  • 51
  • 4

1 Answers1

2

I solved this issue by creating an object tracker using the initial location of the fiducial, and using that when the user moves quickly.

jjtjj222
  • 51
  • 4
  • 2
    Motion blur is the most likely culprit for what's messing up the fiducial detector. The edge becomes too distorted and the image inside is unrecognizable. Your approach around this issue is good. – lessthanoptimal Oct 10 '16 at 23:47