문제

I have this matlab function which is supposed to label connected components in an image. Here is the question: How can I give input to this function?

function [ component_num, c ] = i4mat_components ( m, n, a )  

If you are confused, you can easily open the given link and read more information there.

도움이 되었습니까?

해결책

You simply need something along the lines of:

a = imread('my_epicly_awesome_picture.jpg');

EDIT

To clarify, you can call your function like so:

a = imread('tiger.jpg');
%If your input image is RGB and you want grayscale:
%a = rgb2gray(a);
[m, n] = size(a);
[component_num, c] = i4mat_components(m, n, a);

다른 팁

Though this would be quite strange, it appears that the function requires both the image and its size as inputs.

So suppose your image is called myimage, then the functioncall would be:

[component_num,c] = i4mat_components (size(myimage,1), size(myimage,2),myimage ) 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top