Transform an array into a raster

Hello,
I have a 182x121 array (csv file) that I want to transform into a jpg raster with a cell size of 30x30.
The file doesn't have any reference system so I have no Lat,Lon coordinates.
My array' cells are presenting percentages, if there is a way to put such a threshold to make only above 0.7 cells to appear in the raster, otherwise it is not a problem.
Best regards,

8 comentarios

Jan
Jan el 8 de Mzo. de 2021
Did you import the csv file already? Thenthe input is not a cvs file, but a matrix. I cannot guess, how you want to reduce the 128x121 matrix to 30x30 elements. What is a "jpg raster cell"? What does "array cells present percentages" mean? What are "0.7 cells"? Can you give an example?
YEMY
YEMY el 8 de Mzo. de 2021
Thank you for your reply.
it's not about moving from 182x121 matrix or array (as I have them both) to 30x30.
In the image below, there is an example of how my matrix is about, I want to transform it to a raster, and each record should get a cell size of 30x30 , if it not possible to get it with such a cell size, I want just a method to get a raster and then I can resize it.
The matrix presents a the probability of presence of an object, all what you see are probabilities, I want to know if I can put a threshold to mask the ones that are below 70% from the final raster (this is optional).
Jan
Jan el 8 de Mzo. de 2021
Editada: Jan el 8 de Mzo. de 2021
Please explain, what a "raster" is. What do you mean by "cell size 30x30"? cell(30, 30)?
YEMY
YEMY el 8 de Mzo. de 2021
Editada: YEMY el 8 de Mzo. de 2021
Raster is an image. the cell size that I meant is the pixel size, but it won't work as the image data that I have is not projected, so you can forget about it. So to summit up, I need that matrix to be transformed into an image, and each record in the matrix has to be transformed into a pixel
All images are matrices (Multi dimentional arrays). Load the file using readmatrix
See the image using
imshow(matrix,[])
If you wish to convert the data type to uint8, use uint8(data) function.
YEMY
YEMY el 8 de Mzo. de 2021
It doesn't work, it says: convert table to unint8 is not possible.
Jan
Jan el 8 de Mzo. de 2021
This means, that the actual question is: How to import a CSV file into a matrix?
YEMY
YEMY el 8 de Mzo. de 2021
No, my question is how to convert a matrix or an array into an image.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Images en Centro de ayuda y File Exchange.

Productos

Versión

R2020b

Etiquetas

Preguntada:

el 8 de Mzo. de 2021

Comentada:

el 8 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