Octave im2bw关键字在八度音阶中不起作用

Octave im2bw关键字在八度音阶中不起作用,octave,Octave,使用im2bw进行图像阈值处理时出现问题 im2bw:阈值必须是间隔[0 1]中的字符串或标量 错误:从调用 MO = imread('test.jpg'); M = rgb2gray (MO); M3 = im2bw(M,127); imshow(M3); 根据im2bw(重点矿山)的文件: 我认为错误是不言自明的:“THRESHOLD必须是间隔[01]中的字符串或标量”。阈值的值为127。这不是介于0和1之间。我建议将你的阈值除以255。这可能会给你带来你期望的结果。 The inpu

使用im2bw进行图像阈值处理时出现问题

im2bw:阈值必须是间隔[0 1]中的字符串或标量 错误:从调用

MO = imread('test.jpg'); 
M = rgb2gray (MO);

M3 = im2bw(M,127);
imshow(M3);

根据im2bw(重点矿山)的文件:


我认为错误是不言自明的:“THRESHOLD必须是间隔[01]中的字符串或标量”。阈值的值为127。这不是介于0和1之间。我建议将你的阈值除以255。这可能会给你带来你期望的结果。 The input image IMG can either be a grayscale or RGB image. In the later case, IMG is first converted to grayscale with 'rgb2gray'. Input can also be an indexed image X in which case the colormap CMAP needs to be specified. The value of THRESHOLD should be in the range [0,1] independently of the class of IMG. Values from other classes can be converted to the correct value with 'im2double': bw = im2bw (img_of_class_uint8, im2double (thresh_of_uint8_class));