Effacer les filtres
Effacer les filtres

How to flip a data on an image?

2 vues (au cours des 30 derniers jours)
Ezz El-din Abdullah
Ezz El-din Abdullah le 2 Fév 2017
Réponse apportée : Jan le 2 Fév 2017
I would like to flip the blue points upside down (in the attached image):
This is my code:
hAxes = gca;
% pixLoc(): a function that gets the locations
% of the desired pixels i.e. returns their columns and rows
[cp,rp] = pixLoc(Ic,6,4,38,348);
% a black image with the same size of the image Ic
imshow(imrotate(0*Ic,90))
hold on
% plotting points that I would like to flip
% (the blue points in the figure below)
plot(hAxes,cp,rp,'o');
hAxes.YDir = 'reverse';
I don't know why it's not flipped when I reversed the y-axis. Any help will be appreciated! Thanks!

Réponses (2)

Image Analyst
Image Analyst le 2 Fév 2017
Maybe use
rp = size(Ic, 1) - rp;
plot(hAxes, cp, rp, 'o');

Jan
Jan le 2 Fév 2017
Or:
hAxes.YDir = 'normal';

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by