function gmap = finetune(uid,fieldid,imgtype)

pkg load image
	if imgtype=='area'
		file_name = strcat(uid,'_TCI_large.png');
		a = imread(file_name);
		a = rgb2gray(a);
		size_a = size(a)
meana = mean(mean(a))
b = zeros(size_a(1),size_a(2));
for i = 1:size_a(1)
	for j = 1:size_a(2)
		kk = a(i,j);
		if kk> meana
			b(i,j) = 1;
		else
			b(i,j) = 0;
		end
	end
end
		file_name = strcat(uid,'_TCI_large_01.png');
		imwrite(b,file_name)
	else
		file_name = strcat(uid,fieldid);
		file_name = strcat(file_name,'_static_map_large.png');
                a = imread(file_name);
		%a = rgb2gray(a);
                size_a = size(a);
meana = mean(mean(a))
b = zeros(size_a(1),size_a(2));
for i = 1:size_a(1)
        for j = 1:size_a(2)
                kk = a(i,j);
                if kk> meana
                        b(i,j) = 1;
                else
                        b(i,j) = 0;
                end
        end
end
                file_name = strcat(uid,'_static_map_large_01.png');
                imwrite(b,file_name)
end
gmap = 1
return
end
