How to perform dot annotation for crowd counting in a image file using Matlab?
The Viola Jones algorithm does the face detection for you using the Cascade Object Detector. 

%Read the image
x= imread('C:\~\crowd.jpeg');
x=rgb2gray(x);

%Face detection
faceDetector = vision.CascadeObjectDetector;
bboxes = step(faceDetector,x);


The first two columns of bboxes gives the (x,y) coordinates of the faces detected

If you want to label the people in the picture:

x1 = bboxes(:,1) %x co-ordinates
x2 = bboxes(:,2) %y co-ordinates
figure;
imshow(x);
for i=1:size(x1,1)
    plot(x1(i),x2(i),'*');
end


Saving the data in a .mat format:

save('dot.mat','x1','x2');


Accessing the data:

load('dot.mat');


To save data points from a given image, you can use ginput method. First read the image and then use [x,y] = ginput(n) where n is the number of points you need to save.