Android Tracker does not track


I simplified my onCameraFrame() method to minimum.

I want to track what is on camera inside my Rect. Now it just makes slight (a few px in all directions) chaotic movements, we can’t say it tracks anything. So whats wrong with this code and how to solve that?

Here is my siplified code:

public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
    dst = inputFrame.rgba();

    if (!isAfterFirstFrame) {
        roi = new Rect(new Point(0, 0), new Point(100, 100));
        tracker = TrackerMIL.create();
        tracker.init(dst, roi);

    boolean isTracking = tracker.update(dst, roi);
    Imgproc.rectangle(dst, roi, new Scalar(255, 255, 255), 1, 1);

        Log.d("tracking", "yes");
        Log.d("tracking", "no");

    isAfterFirstFrame = true;

    return dst;