回覆列表
  • 1 # esohp13030

    原因是:operatingRegion = im2bw (operatingRegion, thresh);得的資料是0和1,所以,input (32*(i-1)+1:32*i,32*(j-1)+1:32*j)也是0和1,而imshow(input)顯示的範圍是[0,255],1/255近似於0,所以,全顯示為黑色。我給你改下:[a,b] = size(input);for i = 1:a/32 for j = 1:b/32 operatingRegion = input (32*(i-1)+1:32*i,32*(j-1)+1:32*j); thresh = graythresh(operatingRegion); operatingRegion = im2bw (operatingRegion, thresh); input (32*(i-1)+1:32*i,32*(j-1)+1:32*j) = operatingRegion*255; endendimshow(input);按上面語句試試

  • 中秋節和大豐收的關聯?
  • 女朋友說婚後不要生孩子該怎麼回答?