I'm using ImageFeatureTrack
to track several moving simple objects in a series of images, but sometimes it will fail to track stuffs, and why it fail is always a mystery to me:
This phenomenon can be easily illustrated by the following case of tracking the four corners of a simple moving Rectangle
:
i = Table[
Rasterize[
Graphics[Rectangle[{-.9 + k .05, -.5}, {.1 + k .05, .5}],
PlotRange -> {{-1, 1}, {-1, 1}}], ImageSize -> {100, 100}], {k,
0, 16}];
ListAnimate@i
ImageFeatureTrack[
First /@ Partition[i, 4], {{6, 74}, {54, 74}, {6, 26}, {54, 26}}]
ImageFeatureTrack[{i[[1]],
i[[1]]}, {{6, 74}, {54, 74}, {6, 26}, {54, 26}}]
the first returns:
{{{6., 74.}, {54., 74.}, {6., 26.}, {54., 26.}}, {Missing[], {63.9868, 74.0008}, Missing[], {63.9875, 26.0003}}, {Missing[], {73.9786, 73.9991}, Missing[], {73.978, 26.0037}}, {Missing[], {83.9614, 73.9959}, Missing[], {83.9597, 26.0084}}}
ImageFeatureTrack
simply missed all corner 1 and 3 whill correctly tracked corner 2 and 4.
To make things wierder, in the second trial showing two IDENTICAL image, ImageFeatureTrack
missed corner 1 and 3!!!
Am I missing something or it's simply a misbehaviour of ImageFeatureTrack
?
How can I solve this problem?
MaxFeatureDisplacement -> {1, 1}
! (whatever actually these values are: {0.1,0.1} or {2,1}, ... but NOT too large like {20,20}) $\endgroup$