Is it possible to pass an image as an input to a function in Matlab?

Actually m writing a module which will accept the image and the filter matrix as an input and show the filtered image as output. So is it possible to write a code based on this logic or should I change my logical perception?

 채택된 답변

Dishant Arora
Dishant Arora 2013년 7월 13일
An image is nothing but a matrix, so you can pass it like any other variable.
I=imread('YourImage');
yourFunction(I)

댓글 수: 2

Can we call a function with multiple images at once? if so. how?
Write your function to have multiple inputs:
I = imread('YourImage');
J = imread('AnotherImage');
yourFunction(I,J)
And read the documentation:

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

추가 답변 (0개)

질문:

2013년 7월 13일

편집:

2015년 3월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by