Borrar filtros
Borrar filtros

How to extract data from image figure?

36 visualizaciones (últimos 30 días)
moose
moose el 15 de Nov. de 2015
Respondida: John el 26 de Abr. de 2021
Hello, I am using "imcontrast" to adjust contrast of figure. Then I press "adjust data". Now, my question is, how can I get a matrix variable in my work space with values of the new adjusted figure?
Thank you.

Respuestas (2)

Stephen23
Stephen23 el 15 de Nov. de 2015
You can use getimage
  3 comentarios
Stephen23
Stephen23 el 15 de Nov. de 2015
Editada: Stephen23 el 15 de Nov. de 2015
@moose: I notice that you have asked multiple questions on this forum and sometimes received quite comprehensive answers, but you have never accepted any answer. It is considered polite on this forum to accept an answer that helped resolve your query.
Image Analyst
Image Analyst el 15 de Nov. de 2015
True, getimage() will extract the image from the axes, but he had to put it in there in the first place, so the contrast-adjusted image array is still in memory, or at least it was at some time. An alternative is to pass the array around in memory using some of the techniques in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F, though admittedly getimage() is probably easier. Though there's other good stuff in the FAQ so it's worth checking out. One thing to note is that getimage() retains the bit depth of the original image so that if you put a 16 bit image into your 8/32 bit display, you will get the original 16 bits out, not 8, which is good.

Iniciar sesión para comentar.


John
John el 26 de Abr. de 2021
If in imcontrast, your min value is mn, and your max value is mx, and fn = the number of the figure window you're interested in:
h = figure(fn);
img = max(mn, min(mx, getimage(h)));

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by