function Fresult = makeETCI(UID)
fileName = strcat(UID,"/TCI.png");
	%create ETCI image
		my_limit=0.5;
low_limit=0.008;
up_limit=0.992;
%----------------------------------------------------------------------
img=TCI;
[m1 n1 r1]=size(img);
%----------------------------------------------------------------------
if r1==3
    my_limit2=0.04;my_limit3=-0.04;
a = img;
try
    a=rgb2ntsc(img);
catch
	img = im2double(img);
	a=rgb2ntsc(img);
end
    mean_adjustment=my_limit2-mean(mean(a(:,:,2)));
    a(:,:,2)=a(:,:,2)+mean_adjustment*(0.596-a(:,:,2));
    mean_adjustment=my_limit3-mean(mean(a(:,:,3)));
    a(:,:,3)=a(:,:,3)+mean_adjustment*(0.523-a(:,:,3));
else
    a=double(img)./255;
end
%----------------------------------------------------------------------
mean_adjustment=my_limit-mean(mean(a(:,:,1)));
a(:,:,1)=a(:,:,1)+mean_adjustment*(1-a(:,:,1));
if r1==3
    a=ntsc2rgb(a);
end
%----------------------------------------------------------------------
img=a.*255;
%--------------------calculation of vmin and vmax----------------------
for k=1:r1
    arr=sort(reshape(img(:,:,k),m1*n1,1));
    v_min(k)=arr(ceil(low_limit*m1*n1));
    v_max(k)=arr(ceil(up_limit*m1*n1));
end
%----------------------------------------------------------------------
if r1==3

trans = [ 0.299,  0.596,  0.211; 0.587, -0.274, -0.523; 0.114, -0.322,  0.312 ];

  v_min = v_min*trans;
	v_max = v_max*trans;
end
%----------------------------------------------------------------------
%if abs(v_max(1)-v_min(1))<1e-3
%	result_status = strcat(UID,"failed1")
%                result_status2 = 'Too much black in image vmin vmax'
%	return
%end
%v_min
img=(img-v_min(1))/(v_max(1)-v_min(1));


startx=25;
endx = 900-25;
starty=181;
endy=1200-188;
TCIFilename = strcat(UID,"/ETCI.png");
Fresult =1;
return
