Filter löschen
Filter löschen

How to flip a data on an image?

2 Ansichten (letzte 30 Tage)
Ezz El-din Abdullah
Ezz El-din Abdullah am 2 Feb. 2017
Beantwortet: Jan am 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!

Antworten (2)

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

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

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by