Help with improfile, profile between two selected points.

3 vues (au cours des 30 derniers jours)
Andrea Calvi
Andrea Calvi le 30 Déc 2015
Commenté : Walter Roberson le 5 Août 2017
Hi all,
Mine could be a really dumb question, but I'm having trouble in getting the image profile between two points. The two points should be provided by pairs of x and y coordinates, and, by using improfile or whatever function I'd like to have a 1d array of intensity points.
I've read the documentation, but this sentence is most obscure to me:
improfile(I,xi,yi) retrieves pixel intensity values, where I specifies an image, and xi and yi are equal-length vectors specifying the spatial coordinates of the endpoints of the line segments.
I really don't get what the function wants... I've tried something like:
profile = improfile(image,[1,1],[50,50])
But it returns me a number, insted of the intensity array between the two points 1,1 and 50,50....
Thanks in advance for your help.
Andrea

Réponse acceptée

Walter Roberson
Walter Roberson le 30 Déc 2015
Modifié(e) : Image Analyst le 30 Déc 2015
"image" is the primitive graphics function to create and display image objects. It would return the handle of the object. You should never use "image" as a variable name because of the risk that the MATLAB function might be referred to instead.
  3 commentaires
Walter Roberson
Walter Roberson le 30 Déc 2015
profile = improfile(TheImage,[1,50],[1,50])
Image Analyst
Image Analyst le 30 Déc 2015
Andrea, you can "Accept this answer" (and your prior ones) to let people know it's been solved and to give the person who helped you credit (reputation points).

Connectez-vous pour commenter.

Plus de réponses (1)

Anuj Prajapati
Anuj Prajapati le 5 Août 2017
Modifié(e) : Anuj Prajapati le 5 Août 2017
If you're improfiling a matlab .fig file, auto improfiling like improfile(I,xi,yi) will return a null graph, while freehand manual improfiling will give you results. If you save the .fig file as an image like .tiff, it will generate an RGB separated graph.
  1 commentaire
Walter Roberson
Walter Roberson le 5 Août 2017
This sounds suspicious. Could you post code to reproduce this behaviour for .fig files?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Scripts dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by