Borrar filtros
Borrar filtros

How can I put an image over another in a specific coordinate?

2 visualizaciones (últimos 30 días)
Mara Pereira
Mara Pereira el 16 de Mzo. de 2022
Respondida: Voss el 16 de Mzo. de 2022
How can I put an image over another in a specific coordinate?
This is what I have:
row=256;
col=256;
img=ones(row,col)
branco=imshow(img)
hold on
row1=100;
col1=100;
img1=zeros(row1,col1) this is the "black image" I need in a specific coordinate
preto=imshow(img1) (90,70)

Respuestas (3)

Image Analyst
Image Analyst el 16 de Mzo. de 2022
Editada: Image Analyst el 16 de Mzo. de 2022
See my attached demos. One copies and pastes a small image over a larger canvass image. The other sets up a small axes inside another larger axes, both holding images.

David Hill
David Hill el 16 de Mzo. de 2022
row=256;
col=256;
img=ones(row,col);
img(100:190,100:170)=0;%why not just override the image at the pixel locations
imshow(img)

Voss
Voss el 16 de Mzo. de 2022
Here is a thing you can try:
row=256;
col=256;
img=ones(row,col);
branco=imshow(img);
hold on
row1=100;
col1=100;
img1=zeros(row1,col1); % this is the "black image" I need in a specific coordinate
% specify the XData and YData of the black image to set its location:
preto = imshow(img1,'XData',90+[0 row1],'YData',70+[0 col1]); % (90,70)
% turn on the axes so you can see coordinates
set(gca(),'Visible','on')

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by