Hi Henrik,
This is a very nice implementation. The advantage of using Mathematica is that solutions can be implemented using multiple approaches. Btw i have a little to offer to your code. We need to make sure that the points are in the image coordinate system. This was a mistake I made earlier when the flow-field looked queer. We can use a modified version of your code below:
images = Import["C:\\Users\\Ali Hashmi\\Desktop\\PIV\\Testpiv3.gif"];
imgDim = ImageDimensions[First@images];
windowsize = 32;
imgCorrD = First@imgDim;
img = ImageCrop[#, imgDim - (2*windowsize)] & /@ images;
gtrf = Last[FindGeometricTransform @@ img];
rpts = RandomInteger[{windowsize, windowsize+First@ImageDimensions[First@img]}, {1000, 2}];
Graphics[{Arrowheads[.01], Darker@Cyan, Arrow /@ Transpose[{Map[Abs[# - {0, imgCorrD}] &, #] &@rpts,
Map[Abs[# - {0, imgCorrD}] &, #] &@gtrf[rpts]}]}, ImageSize -> 600]
