I am answering your question in 2 parts:
Since both parts require a bit of insight I kindly ask you to thumbs-up vote each part separately.
In this first answer let's find a way to count the particles, in a second answer we will find a way to analyze SNR, CNR, CIR and other parameters that ARE POSSIBLE to calculate, ignore the comment above telling you SNR is not possible here, it is, but you have to be aware of clutter and what happens when particles too close each other, too close to background noise, or simply, the initial processing splits a particle into apparent 2 or more particles, and then you have to merge them back.
Let's start with the head counting:
if you have the Image Toolbox, just check the starter tutorial that shows how to enhance contrast (imadjust grarythresh bwareaopen) and count (bwconncomp, field: NumObjects) rice grains
following, manual mode, i mean, without the image processing toolbox:
Squelch=149
A=imread('counting particles.jpg')
A2=A(:,:,1)+A(:,:,2)+A(:,:,3)
[A_sz1,A_sz2]=size(A2)
figure(1);imshow(A)
figure(1) is your original image, no need to repeat it
observe slightly increased contrast, and from a different point of view you can see the particles you want to count as peaks:
Now let's make the peaks sharper to be able to count them:
[X,Y]=meshgrid([1:1:A_sz2],[1:1:A_sz1])
A3=surface(X,Y,A2)
A4=A3.ZData
[A3_sz1,A3_sz2]=size(A3.ZData)
spots=zeros(A3_sz1,A3_sz2)
for k=1:1:A3_sz1
[pks,locs,widths,proms]=findpeaks(double(A4(k,:)),'MinPeakHeight',Squelch)
spots(k,locs)=255
end
Basically, the for loop catches peaks line by line. When plotting all the lines watching sideways we don't really see anything, like a thick bush, but for instance 20 lines sideways look like this:
Note that the function findpeaks without the option 'MinPeakHeight' set to Squelch=149 or higher, for this picture, it takes a lot of noise. Since the illumination conditions are set, or we assume you do not have control over how much light or the kind of light you use, you don't really want to count the blurred background spots that could be anything else.
If you really want to count all the particles, you have illuminate the volume with enough power to 'see' all the contours, even if overlapped, and then process the image to discern them all. If not enough light, we have to carry on eliminating small peaks too close to noise.
Play with Squelch to see what happens, I already did, Squelch<100 will catch a lot of noise
figure(6);surf(X,Y,spots,gradient(spots))
Now the peaks are sharper, but there are particles that have different isolated white pixels counting as separate particles. Let's merge close enough sharp peaks into single peaks with the following:
F=griddedInterpolant(X',Y',spots','cubic')
[K,H]=surfature(X,Y,spots)
support function surfature is available from MATLAB CENTRAL here:
<http://uk.mathworks.com/matlabcentral/fileexchange/11168-surface-curvature?s_tid=srchtitle?
There are other ways to 'drop' an envelope on really close each other peaks so they are not counted as separate peaks. Human eye can tell such dots belong to same particle. I found extrema2 really useful to such purpose:
[spots_max,imax,zmin,imin] = extrema2(spots)
[x_spots,y_spots]=ind2sub(size(spots),imax)
extrema2.m is available from MATLAB CENTRAL, it requires support function extrema.m in same folder
Now let's count peaks
part_count=size(spots_max)
part_count=part_count(1)
With Squelch=149 I count 943 particles.
Depending upon your CPU, operative system, .. the for loop may take a minute or so.
I understood the point that you said 64x64 pixel basic block, but I saved the shifting window coding that is easy to write, but takes time writing it, you can implement the 64x64 shifting window if you want, but bear in mind that it will take more than you think solving apparently small issues like avoiding repetition of points.
If you shift the window, instead of moving it 64 to 64, there may be additional delay. I repeat, If you want you can implement a smaller processing window, once you find a way to count the spots in a window regardless of window size, does it make sense?
If you find this answer of any help to solve your question, regarding the particles count, please click on the thumbs-up vote link above, thanks in advance.
I will go through the SNR request next week, approx, ok?