Find Xmin and Ymin to Imcrop an image in Matlab
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to crop my image. Cropping of the image using coding is as follow I = imcrop(I,[xmin ymin width height]). I know the width and height of image, but I donot know how to find xmin and ymin cordinates of an image from the different pixels values of an image. sum() or any() or find() function can be used, but I donot know how to apply these functions I donot the basic concept, how xmin and ymin value are chosen from thousands of values image have.
2 commentaires
Réponses (2)
Thomas Koelen
le 30 Avr 2015
xmin is the x coordinate of the lower left corner of the cut you want to make in the image,
ymin is the y coordinate of the lower left corner of the cut you want to make in the image,
width is the width of the cut you want to make,
height is the height of the cut you want to make.
1 commentaire
Harold Getenga
le 12 Déc 2017
I am more of a newbie in Matlab,but I would think since the spatial co-ordinates in Matlab are given from top-to-bottom for the y-axis, then that would make the ymin to be (at least visually) the y-co-ordinate of the top left corner of the cut you want to make.
Image Analyst
le 1 Mai 2015
Why don't you just call imcrop() with no input arguments and interactively make your cropping box?
2 commentaires
fatima-zahra achbah
le 25 Oct 2017
But I need coordination of the cropped image, I need to know xmin ymin ... after cropping it
Image Analyst
le 25 Oct 2017
Documentation says
[___,rect2] = imcrop(_) returns the cropping rectangle in rect2, a four-element position vector, in addition to the cropped image.
So, did you actually supply a second output argument, rect, when you called it? My guess is no. So why don't you do that?
Voir également
Catégories
En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!