So I am trying to create a function that takes in an image and for every rgb value less than 128, it will change its value to zero, otherwise, it will change its value to 255. However whenever I try using my code, I just get a white, blank image. I am a self taught learner
function newimage = extremecontrast(inimg)[r,c,l]= size(inimg);for i = 1:r for j= 1:c for k = 1:l if inimg<128 inimg = 0; else inimg = 255; end end endendnewimage = inimg[i,j,k];end
Best Answer