tmp = double(image_all(:,:,i)); maxv = max(tmp(:)); minv = min(tmp(:)); tmpimg = uint8(((tmp + abs(min(tmp(:))))/(abs(maxv) + abs(minv)))*255);