I have a set of 2700 consecutive png images (8bit, 2048*2048 pixels).
I would like to visualize the intensity variation of each pixel vs. image number.
Here is an example of 10 images: http://goo.gl/52McV3
At first I wanted to store the intensity of each pixel in each image into an array. Unfortunately the code below does not work properly. What am I doing wrong?
ChoiceDialog[{FileNameSetter[Dynamic[imageDir], "Directory"],
Dynamic[imageDir]}];
SetDirectory[imageDir];
fNames = FileNames["*.png"];
numFiles = Length[fNames];
SetSharedVariable[pixelIntensity];
pixelIntensity = Array[0 &, {2048, 2048, numFiles , 1}];
ParallelTable[
image = Import[fNames[[i]]];
ParallelTable[
pixelIntensity[[r, c, i]] =
ImageData[ImageTake[image, {r, r}, {c, c}]],
{r, 1, 2048}, {c, 1, 2048}
],
{i, 1, numFiles}
];
I have RAM problems when many images (2700) have to be processed
Import[]
swamps the time of everything else. If you want to load the data just do something like this:Transpose[ImageData@Import[#] & /@ fNames, {3, 2, 1}]
$\endgroup$