you have 50.000 frames that each have a 0 or a 1 for every pixel. That means a hot pixel, ON (1) in every frame, occurs 50.000 times. You could create a sparse histogram and then you can gather the sparse entries. Or, because your image has 32x32 pixels (ie. 1024 pixels) only, at most you have 1024 results, a lot less than 50.000, and you can fill your own histogram array.
Build your own twist of a histogram function:
Declare two arrays of 1024 elements (that is the maximum number of grey values if all pixels have a different dark current). One array holds the grey values you have encountered, the other array holds the tally (count) of that grey value. So if the first five pixels have respectively the grey values 125,34,54,125, 125 your first array holds 125, 34, 54. The second array holds 3,1,1.
Now sort the first array and the second accordingly (that is, with the Array.rankPositions function, see an example here) and you have the histogram you want.
You fill the array by getting a pixel value, see if it already is in your array of encountered grey values.
If it has been seen before, you increment the tally.
If it hasn’t been seen before, you put it in the next free entry of your encountered grey values array and set the tally in the other array, at the same index, to 1.
The Array.rankPositions will, given the first array in the above example, return 1,3,2 (the 1 points to 125, the 3 points to 54 and the 2 indicates the smallest of the three is located at position 2). According counts are in the second array at postions , and .