Unrecognized function or variable 'colorize'.

Why can't i use the 'colorize' function despite having the Image Processing Toolbox™ Hyperspectral Imaging Library installed?
Thanks

3 comentarios

KALYAN ACHARJYA
KALYAN ACHARJYA el 24 de Feb. de 2021
Editada: KALYAN ACHARJYA el 24 de Feb. de 2021
Which MATLAB version are you using?
This function is Introduced in R2020a
Fadhli Atarita
Fadhli Atarita el 24 de Feb. de 2021
I'm using R2020b
Manuel Di Raimondo
Manuel Di Raimondo el 26 de Feb. de 2021
i'm having the same problem with this function and the "selectBands" . No other functions of the toolbox/library

Iniciar sesión para comentar.

 Respuesta aceptada

Rashed Mohammed
Rashed Mohammed el 1 de Mzo. de 2021

0 votos

Before you use the colorize function, make sure you have hypercube object present in the workspace. If you are still facing issue, please share minimal code and data so that we can reproduce the issue.
Hope this helps

12 comentarios

Fadhli Atarita
Fadhli Atarita el 1 de Mzo. de 2021
Hi, thank you.
I am creating my own synthetic hyperspectral MxNxC datacube. Does it only work for hypercube inputs? But it doesn't say that the input is not compatible, it says the function is unrecognized.
I have the variable 'syn_hyp' which is a 3D 100x300x224 double array and I was just following the example from MATLAB to try to see how it works.
coloredImg = colorize(syn_hyp,"Method","rgb","ContrastStretching",true);
I also tried to define the band as a 3 vector for RGB wavelength but doesn't work either.
"Unrecognized function or variable 'colorize'."
That is the error message yet the function exists in my toolbox.
Rashed Mohammed
Rashed Mohammed el 1 de Mzo. de 2021
Thank you for getting back. As mentioned in the documentation of colorize function, the input must be a hypercube object. So first create a hypercube object from your data and then use the colorize function.
Hope this helps.
Walter Roberson
Walter Roberson el 1 de Mzo. de 2021
The reason it would say not found is that colorize is a method of a class, rather than a stand-alone function that checks its inputs to see if they are supported.
Fadhli Atarita
Fadhli Atarita el 1 de Mzo. de 2021
If that so, how can I utilize it? Can I just do as Mr. Mohammed said and use it? I am sorry I don't really understand the stuff about the so called "method of a class".
Thanks.
Walter Roberson
Walter Roberson el 1 de Mzo. de 2021
Imagine you are standing in front of a device with at least some electronics, and the device has a "Run" button. When you push the "Run" button, does the device connect somehow to a planetary computer that checks to see what kind of device it is, and makes a decision about what to do? Or is the device a member of a class of similar objects each of which has a defined meaning of "Run" built into it locally, ignorning what any other kind of object might mean by "Run" ?
Classes are sort of like objects that have built-in behavior that define what "Run" (or "colorize") mean to them, ignoring what it might mean to something else. There is no planet-wide "colorize" function that checks whether a "colorize" behavior has been defined for that particular kind of input and then executes as appropriate: hypercube objects have built-in "colorize" that do not have to check whether the input is the right kind of input because it is local behavior for that kind of device that you cannot activate for other kinds of devices. Other kinds of objects, such as hyperhairdressers, might have their own "colorize" that only has meaning in context for them.
When you define your own .m function, unless you do so in a very specific way, you create a function that has to be prepared to accept any kind of input and has to verify that the inputs are something you can work with before going ahead with whatever. But hypercube class has been defined in that very specific way that attaches a local colorize behavior to it, and that behavior will not be activated for any other kind of objects.
Fadhli Atarita
Fadhli Atarita el 2 de Mzo. de 2021
Hi,
Thanks for the explanation! So, I do need a hypercubed data to use the function after all. Is it possible to write a hypercube from a 3D array? I have been looking but haven't found any solution.
Fadhli Atarita
Fadhli Atarita el 2 de Mzo. de 2021
Nevermind guys, I figured it out. Thank you so much for all your help. I will now accept this answer.
Btw, Mr. Raimondo seems to be having similar problem (see comments).
Fadhli Atarita
Fadhli Atarita el 2 de Mzo. de 2021
I now have no problem with the 'colorized' function but funnily enough, the problem still exists for the "denoiseNGMeet' function. That's strange.
Subhadeep Koley
Subhadeep Koley el 3 de Mzo. de 2021
@Fadhli Atarita denoiseNGMeet supports both the hypercube object and 3-D numeric array. What error message are you getting while using the denoiseNGMeet function?
Fadhli Atarita
Fadhli Atarita el 3 de Mzo. de 2021
Hi,
The same error, "Unrecognized function or variable 'denoiseNGMeet'."
Walter Roberson
Walter Roberson el 3 de Mzo. de 2021
What is the class() of the data you are passing in for it?
Fadhli Atarita
Fadhli Atarita el 3 de Mzo. de 2021
Hypercube, the one that I tried colorize on and it worked for that.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2020b

Preguntada:

el 24 de Feb. de 2021

Comentada:

el 3 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by