The Image Processing algorithm is to analyze movement of People who are going out from a bus .
That was done by analyzing the differences of pixels color values between a picture of the streets which are empty from people and frames of the movies which show the movement of people. Then clusterize and get the mean value which applied to gradient colors that discribe the
hieghst and lowest changes of the movement.
Still under development
Recipe:
A) import >>>Run this Once
k= frame without people (croped the upper part)
k2= movie frames folder
kk= movie frames with people movment (croped the upper part)
k = ImageCrop[Import["C:\\t3\\10050.png"], {Full, 285}, Top];
SetDirectory["C:\\t3"]; names = FileNames[]; k2 = Import /@ names;
kk = Table[ImageCrop[k2[], {Full, 285}, Top], {t, 2, Length[k2]}];
----------------------------------------------------------------------------------------------------------------
differences [from
to
]
return >>>
b- run the next once for all the movie frames example [ 1 to 1000]
C) Run the next again for a different ranges for example [ 200 to 400 - 401 to 600 - 601 to 800 - 801 to 1000]
endframe = 1000;
firstframe = 1;
e = Colorize[
ColorNegate[
ArrayPlot[
Mean[Table[
ImageData[
MorphologicalBinarize[
ImageDifference[k, kk[[i]]], {0.05, .45}]], {i, firstframe ,
endframe}]], ImageSize -> 1017]], ColorFunction -> "Rainbow"];
Export["C:\\heatmaprender\\" <> ToString[2] <> "-" <>
ToString[endframe] <> ".png", e];
--------------------------------------------------------------------------------------------------
D) ColorReplace for purple color to be transperent in all of the output images
--------------------------------------------------------------------------------------------------
E) Combine the frames with original movie which was colored (here i converted it to grayscale) _ only in this step you can use Mathematica or any video editing software then save avi/mov ....etc