%Question 1												(5 marks)
%a)	Write a Matlab function called 'bwcount' that accepts a binary image as an input and returns as an output two parameters:
%1.	The first parameter is the number of zeros intensity values in the image.
%2.	The second parameter is the number of ones intensity values in the image.	(3 marks)
%b)	Then in matlab command mode do the following:
%•	Read the image 'pout.tif' of class uint8.
%•	Covert this image to black and white image with 0.4 threshold.
%•	Display the obtained binary image.
%•  Call bwcount function to calculate zeros and ones in this image.		(2 marks)
function [zc oc]= bwcount (f)
[M N]= size(f);
zc =0;
oc = 0;
for x=1:M
    for y=1:N
        if (f(x,y)==0)
            zc = zc+1;
        else
            oc = oc+1;
        end
    end 
end
%i = imread ('pout.tif');					(2 marks)
%f = im2bw(i,0.4);
%imshow(f)
%[zc,oc]=bwcount(f)



