how can i creat image from data?
Mostrar comentarios más antiguos
hi I'm beginner in matlab my problem is how to get image.i have text data (row,col) and i want to create image from this data, and this image should be like fringes (dark and white line)
1 comentario
KSSV
el 22 de Ag. de 2016
Attach the data here....
Respuestas (2)
Farouk Moukaddem
el 26 de Ag. de 2016
0 votos
Hi,
Refer to the following documentation link for the "mat2gray" command that is used to convert a matrix to a grayscale image:
You will also find an example in the above link that will help you get started with Image Processing applications.
Best,
Farouk
1 comentario
Sanaa
el 26 de Ag. de 2016
Image Analyst
el 26 de Ag. de 2016
Try this (untested):
% In advance, read your text data into three vectors,
% rows and columns and grayLevels. Then...
lastRow = max(rows);
lastCol = max(columns);
grayImage = zeros(lastRow, lastCol, 'uint8');
for k = 1 : length(rows)
grayImage(rows(k), columns(k)) = grayLevels(k);
end
This assumes that rows and columns are integers.
4 comentarios
Image Analyst
el 26 de Ag. de 2016
Editada: Image Analyst
el 26 de Ag. de 2016
There is no question in your response. Should there be? Or did I answer your question successfully?
In the meantime, read this link: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup#answer_18099
Sanaa
el 26 de Ag. de 2016
Image Analyst
el 26 de Ag. de 2016
I think you overlooked the last line of my answer. Here it is again:
Not really sure why you did not attach your data -- did you just forget, or am I to just assume that you don't want us to run your code with your data?
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!