Use ginput to crop an image
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Akzeptierte Antwort
KSSV
am 19 Jun. 2020
Bearbeitet: KSSV
am 19 Jun. 2020
You need to define Rect to use the ginput points.
I = imread("image.jpeg") ;
imshow(I) ;
[Px,Py] = ginput(2) ;
Px = round(Px) ; Py = round(Py) ;
R = [Px(1) Py(1) Px(2)-Px(1) Py(2)-Py(1)] ; %[ x y W H]
I1 = imcrop(I,R) ;
figure
imshow(I1)
Play around with creating R...I am not sure whether they are correct here.
NOTE: While using imcrop also you do the same, select left top first and then bottom right. You define a rectangle.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Exploration 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!