Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

what does imloadfunc do?

2 visualizaciones (últimos 30 días)
kitty varghese
kitty varghese el 17 de Ag. de 2017
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I 'm working on non-negative matrix factorization. I have come across a GitHub code for the same. Here, they have used global imloadfunc .im unable to understand why it is been used.

Respuestas (1)

Guillaume
Guillaume el 17 de Ag. de 2017
That global variable imloadfunc is s switch that tells which function to use to read images. If it is set to 'pgma_read', then it'll use that function. In any other case, it'll use the standard imread function.
It's a bad way of programming, there a much better mechanism in matlab for this such as getpref. Hopefully, that global variable is set by whatever starting code there is as if it does not exist your linked function will error.
If it's not set, you can always do:
global imloadfunc;
imloadfunc = ''; %to use default imread
at the command prompt.
  4 comentarios
kitty varghese
kitty varghese el 17 de Ag. de 2017
Editada: Guillaume el 17 de Ag. de 2017
im getting
val ''
Guillaume
Guillaume el 17 de Ag. de 2017
Maybe, you're on an older version where '' is not acceptable for switch. A bit odd. You can use any non-empty value,e.g.:
global imloadfunc;
imloadfunc = 'x';

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by