I have a project for find a rate of people movement using a video recording. That was one of the projects that i have to submit aside my PhD research.
> The Main Objective that i had been asked to present is to visualise the data of a complex behaviour that happens in a spesific streets of (cars-busses-pedisterian).
And I tackled this point by extracting the data from a recorded video and not by mimicing the behaviour through simulations
> I didn’t focus on counting the people (even it is possiple as i tried it and still need to be developed) but aiming to return movment patterns on where the people stands/pass more in the street which can be applied in the future for redesigning the place elements (shades - seats …etc).
> and there is some impediments in this technique till now such as : if the movie had been recorded in a sunny day, the shadows will be taken into account
- If the people who wear gray, they are the same as street.
- As much height/angle of the camera as much accurate patterns … etc.
Anyway, mainly i make a differenceimage function between a frame without people in the street, and “others many frames may be 200 to 1000”, So i would like to find a way to make my code faster) how to compile this kind of Mathematica functions of “image processing” _for example
frame1 = 10050; frame2 = 10118;
f = Colorize[
ColorNegate[
ArrayPlot[
Mean[Table[
h = Import[ "C:\\MVI_5002.mov", {"ImageList", 10000}];
hh = Import[ "C:\\MVI_5002.mov", {"ImageList", t}];
hhh = ImageDifference[h, hh];
Morphh = MorphologicalBinarize[hhh, {0.1, .8}];
ImageData[Morphh],
{t, frame1, frame2}]],
ImageSize -> 1000]],
ColorFunction -> "Rainbow"];
Export["C:\\render\\" <> ToString[r1] <> "-" <> ToString[r3] <> ".tif", f];
================ UPDATE ====================
Here is the result after this discussion and my further efforts:





