フィルターのクリア

how can i run multiple mfile over an image?

3 ビュー (過去 30 日間)
sara
sara 2014 年 9 月 25 日
コメント済み: sara 2014 年 9 月 25 日
I have 4 mfile,first I used im2bw and threshold the image,then I used the image result of im2bw in another mifle which labeled regions,then I save the result as jPG and used it in another mfile and find regions under 50000 area,then I used the result image which I saved as jpg in harris corner detection and find some corners,now can I do all these in one program,i mean first read the image,then find area under forexample 50000 and then lable it again and find corners,.?forexample here when I use first mfile which is im2bw in the second mfile which finds area<5000 it gives me this error: (i=imread('...'); I = im2bw(i,.64) m=rgb2gray(I); figure, imshow(m) BW = im2bw(m, graythresh(m)); CC = bwconncomp(BW); L = labelmatrix(CC);....) ERROR:(Error using rgb2gray>parse_inputs (line 80) MAP must be a m x 3 array.)

採用された回答

Image Analyst
Image Analyst 2014 年 9 月 25 日
Try calling rgb2gray after imread() but before im2bw().
originalImage = imread('...');
[rows, columns, numberOfColorChannels] = size(originalImage)
if numberOfColorChannels > 1
originalImage = rgb2gray(originalImage );
end
binaryImage = im2bw(originalImage, .64)
m=rgb2gray(binaryImage);
  1 件のコメント
sara
sara 2014 年 9 月 25 日
thank you so much,.i should read it,.and work on it,.thanx,.

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by