how to pass image data to a function
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
the below function is a function that calculate the texture of objects in grayscale image from its binary mask. I have boring of errors when I pass an image data to this function code. please any one can help me! how can I pass the gray scale image:-
for example, I=imread('soap105.jpg'), how can I pass this image data to the function below
function handles = MeasureTexture( handles, varargin ),where handles is a function handler
1 commentaire
Harsha Medikonda
le 4 Août 2014
If you need to pass the data read from an image to a function named “calculate”, you do it the following way
% I=imread(‘image’)
% calculate(I)
Where “image” is the image you want to read. With reference to your specific function,What are the input parameters that your function expects? What are the error messages that you are observe? For information on working with grey scale images, refer to the link below Analysing an Image For information on the using functions in MATLAB, refer to the link below Functions in MATLAB
Réponses (1)
Image Analyst
le 4 Août 2014
If MeasureTexture is a function inside your main GUI, then just get rid of varagin and replace it with some name for the image that you refer to it by in your function. For example in the callback for some pushbutton, have this:
I = imread('soap105.jpg');
handles = MeasureTexture(handles, I);
Then in the function definition for MeasureTexture:
function handles = MeasureTexture(handles, inputImage)
% Code in the function refers to "inputImage" whenever it needs to use the image variable.
0 commentaires
Voir également
Catégories
En savoir plus sur Modify Image Colors dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!