function speedd=rforce(level0_list,level0_sz,rmap,mask);

global img

[nx,ny]=size(img);
%out=zeros(nx,ny);
out=zeros(level0_sz,1);
rrmap=rmap.*mask;
tmp=find(rrmap==1);
r1=sum(img(tmp))/length(tmp);
tmp=find(rrmap==2);
r2=sum(img(tmp))/length(tmp);

for i=1:level0_sz,
	lx=round(level0_list(i,1)); ly=round(level0_list(i,2));
	%for j=lx:lx+1
	%	for k=ly:ly+1,
	%		out(lx,ly)=out(lx,ly)+(img(j,k)-r2)^2-(img(j,k)-r1)^2;
	%	end
	%end
	tmp=(img(lx,ly)+img(lx,ly+1)+img(lx+1,ly)+img(lx+1,ly+1))/4;
	out(i)=abs(tmp-r2)-abs(tmp-r1);
end
speedd=out;
