Hi, I get error when I call the function for another function, the error like this 'Not enough input arguments'.

조회 수: 2 (최근 30일)
I have 2 function in my program
1. green_channel.m %%in bellow the code
function green = green_channel(im)
imGreen = im(:,:,2);
medGreen = medfilt2(imGreen, [3 3]);
medGreensize = imresize(medGreen,[583 947]);
green=imcomplement(medGreensize);
end
2.saturation_channel.m
function imgsat = saturation_channel(im)
imhsv=rgb2hsv(im);
imsaturation=imhsv(:,:,2);
medsat=medfilt2(imsaturation,[3 3]);
imre = imresize(medsat,[583 947]);
imgsat = uint8(imre); end
3. And the last name is hasil_kali.m
function imgkali = hasil_kali(green, imgsat)
imgkali = green.*imgsat;
end
I make that code in file hasil_kali.m to calling function from green_channel.m and saturation_channe.m, but I get error 'not enough input arguments'. Do I wrong call the function or how? please help me, I new learning, may more explain can help me. thanks

답변 (1개)

Image Analyst
Image Analyst 2018년 9월 21일
I assume hasil_kali() is the main function. And it needs to have green and imgsat already defined. How did you define green and imgsat prior to calling hasil_kali()? And how did you call hasil_kali()? You didn't just push the green run triangle, did you? Because that won't work. You need to call it from the command line or a script or another function because you must pass two input arguments (green and imgsat) to it.
  댓글 수: 2
Oman Wisni
Oman Wisni 2018년 9월 25일
Sir, I already have a binary image after thresholding.
how I do for mask the binary with RGB image? using "cast"

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by