How to represent numbers as characters in an image
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have a file which contains numbers which are the coefficients obtained from wavelet thresholding of a data/signal by issuing the command signal_coeff=cwt(signal,1:32,'sym2','plot');colormap jet;surf(signal_coeff); .How do I convert this data of numbers to characters based on maximum entropy thresholding and then as an image(24 bit RGB) using a grid like visual representation where each square contains a letter. Should I use num2str or char(coeff) and how do I go about it.Please note that my knowledge in matlab is very limited and as such I could not understand how to do all these steps. Any help would be appreciated.
0 comentarios
Respuestas (1)
Walter Roberson
el 13 de En. de 2012
Your question is difficult for me to understand.
If you have a number, then if you use num2str() you would end up with multiple characters unless the number was exactly one of 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. If you use char() on a number then you would end up with one character if the number was an integer in the range 0 to 65535, and you would get warnings if you had negative values or you had any fractions.
Once you have your character or characters, you could arrange them in a matrix, but a matrix of characters cannot be used as an image by any MATLAB routine that I can think of. The MATLAB display routines or image-saving routines require matrices which are of the data type uint8, uint16, or double (some might permit single)
The connection between the numbers in the file and the conversion to characters "based upon maximum entropy thresholding" is not something I do not understand. You said that the coefficients were generated from "a data/signal", which implies that the data was not originally character, so I do not know why you want to output as character.
It would make more sense to me if you had not referred to characters at all, and had instead said that you needed to create a matrix of uint8.
1 comentario
Ver también
Categorías
Más información sobre AI for Signals and 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!