Android Question determining black and white image from an rgb image by ability to changing threshold value

Tt1993

Member
Hi everyone, I'm new in b4a. I want to determine black and white image of a rgb image by adjusting a threshold value in b4a. In the other words, by changing the threshold value, some pixels will be changed( black or white). like this matlab code:
threshold=132;
for(i=1:image_width)
for(j=1:image_height)
if(image(i,j)>threshold)
out(i,j)=255;
else
out(i,j)=0;
and
end
end
 
Top