Pregunta

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.

¿Fue útil?

Solución

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);

Otros consejos

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 ) 
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top