how to generate an image given 2D points coordinates and the gray intensity value
Mostrar comentarios más antiguos
hello,
i have a set of 2d points, and each point has a gray value. my goal would be to generate an image from these points.
now for the plotting i'm using the command plot.
plot3(pp_cnt(1),pp_cnt(2),pp_cnt(3),'dk','MarkerFaceColor', [P2.gr_lvl(jj) P2.gr_lvl(jj) P2.gr_lvl(jj)])
each pixel should have a 0.5x0.5 dimension.

can anyone suggest me how to procede?
how can i generate an image? how can i interpolate these points?
3 comentarios
darova
el 29 de Nov. de 2019
Did you try just fill rows and columns?
I(i,j) = 1;
luca antonioli
el 29 de Nov. de 2019
darova
el 29 de Nov. de 2019
Image pixels have rows and column (coordinates). Can't you use your coordinates to fill pixels?
for k = 1:length(x)
j = round(x - min(x)); % column
i = round(y - min(y)); % row
I(i,j) = 1;
end
imshow(I)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Image Arithmetic en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!