필터 지우기
필터 지우기

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