| 97 | // ---------------------------------------------------------------------------------------- |
| 98 | |
| 99 | void bind_correlation_tracker(py::module &m) |
| 100 | { |
| 101 | { |
| 102 | typedef correlation_tracker type; |
| 103 | py::class_<type>(m, "correlation_tracker", "This is a tool for tracking moving objects in a video stream. You give it \n\ |
| 104 | the bounding box of an object in the first frame and it attempts to track the \n\ |
| 105 | object in the box from frame to frame. \n\ |
| 106 | This tool is an implementation of the method described in the following paper: \n\ |
| 107 | Danelljan, Martin, et al. 'Accurate scale estimation for robust visual \n\ |
| 108 | tracking.' Proceedings of the British Machine Vision Conference BMVC. 2014.") |
| 109 | .def(py::init()) |
| 110 | .def("start_track", &::start_track, py::arg("image"), py::arg("bounding_box"), "\ |
| 111 | requires \n\ |
| 112 | - image is a numpy ndarray containing either an 8bit grayscale or RGB image. \n\ |
| 113 | - bounding_box.is_empty() == false \n\ |
| 114 | ensures \n\ |
| 115 | - This object will start tracking the thing inside the bounding box in the \n\ |
| 116 | given image. That is, if you call update() with subsequent video frames \n\ |
| 117 | then it will try to keep track of the position of the object inside bounding_box. \n\ |
| 118 | - #get_position() == bounding_box") |
| 119 | .def("start_track", &::start_track_rec, py::arg("image"), py::arg("bounding_box"), "\ |
| 120 | requires \n\ |
| 121 | - image is a numpy ndarray containing either an 8bit grayscale or RGB image. \n\ |
| 122 | - bounding_box.is_empty() == false \n\ |
| 123 | ensures \n\ |
| 124 | - This object will start tracking the thing inside the bounding box in the \n\ |
| 125 | given image. That is, if you call update() with subsequent video frames \n\ |
| 126 | then it will try to keep track of the position of the object inside bounding_box. \n\ |
| 127 | - #get_position() == bounding_box") |
| 128 | .def("update", &::update, py::arg("image"), "\ |
| 129 | requires \n\ |
| 130 | - image is a numpy ndarray containing either an 8bit grayscale or RGB image. \n\ |
| 131 | - get_position().is_empty() == false \n\ |
| 132 | (i.e. you must have started tracking by calling start_track()) \n\ |
| 133 | ensures \n\ |
| 134 | - performs: return update(img, get_position())") |
| 135 | .def("update", &::update_guess, py::arg("image"), py::arg("guess"), "\ |
| 136 | requires \n\ |
| 137 | - image is a numpy ndarray containing either an 8bit grayscale or RGB image. \n\ |
| 138 | - get_position().is_empty() == false \n\ |
| 139 | (i.e. you must have started tracking by calling start_track()) \n\ |
| 140 | ensures \n\ |
| 141 | - When searching for the object in img, we search in the area around the \n\ |
| 142 | provided guess. \n\ |
| 143 | - #get_position() == the new predicted location of the object in img. This \n\ |
| 144 | location will be a copy of guess that has been translated and scaled \n\ |
| 145 | appropriately based on the content of img so that it, hopefully, bounds \n\ |
| 146 | the object in img. \n\ |
| 147 | - Returns the peak to side-lobe ratio. This is a number that measures how \n\ |
| 148 | confident the tracker is that the object is inside #get_position(). \n\ |
| 149 | Larger values indicate higher confidence.") |
| 150 | .def("update", &::update_guess_rec, py::arg("image"), py::arg("guess"), "\ |
| 151 | requires \n\ |
| 152 | - image is a numpy ndarray containing either an 8bit grayscale or RGB image. \n\ |
| 153 | - get_position().is_empty() == false \n\ |
| 154 | (i.e. you must have started tracking by calling start_track()) \n\ |
| 155 | ensures \n\ |
| 156 | - When searching for the object in img, we search in the area around the \n\ |
no test coverage detected