How to flip a data on an image?

3 visualizzazioni (ultimi 30 giorni)
Ezz El-din Abdullah
Ezz El-din Abdullah il 2 Feb 2017
Risposto: Jan il 2 Feb 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!

Risposte (2)

Image Analyst
Image Analyst il 2 Feb 2017
Maybe use
rp = size(Ic, 1) - rp;
plot(hAxes, cp, rp, 'o');

Jan
Jan il 2 Feb 2017
Or:
hAxes.YDir = 'normal';

Categorie

Scopri di più su Images in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by