質問

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