From: Omar on 28 Jun 2010 02:14 I have 6000 images of cats. I need 6000 images of the cat heads such that they are square images, e.g. 120 x 120 pixels. The cat images are versatile and so I cannot simply write an algorithm that crops it to HxH if H<W or then WxW if W<H, where W and H are width and height, respectively. Does anyone have any suggestions on how to speed up the manual cropping? At the moment I have written code such that an image is displayed to me, I click my desired square center and then I click a point on my desired boundary. The region is cropped, file saved, and the next image is displayed to me. For me it's just about clicking each image twice. I am using "impixel" to get the locations of wherever I click. If you don't know a faster algorithm, is there any way for me to crop by clicking once. I tried imcrop, but I cannot fix the aspect ratio to 1:1 automatically. I will have to select it from a right click menu each time - too time consuming!
From: us on 28 Jun 2010 02:32 "Omar " <omar.nadeem(a)hotmail.com> wrote in message <i09ejd$4d$1(a)fred.mathworks.com>... > I have 6000 images of cats. I need 6000 images of the cat heads such that they are square images, e.g. 120 x 120 pixels. The cat images are versatile and so I cannot simply write an algorithm that crops it to HxH if H<W or then WxW if W<H, where W and H are width and height, respectively. > > Does anyone have any suggestions on how to speed up the manual cropping? > > At the moment I have written code such that an image is displayed to me, I click my desired square center and then I click a point on my desired boundary. The region is cropped, file saved, and the next image is displayed to me. For me it's just about clicking each image twice. I am using "impixel" to get the locations of wherever I click. > > If you don't know a faster algorithm, is there any way for me to crop by clicking once. I tried imcrop, but I cannot fix the aspect ratio to 1:1 automatically. I will have to select it from a right click menu each time - too time consuming! a hint: - use a callback, which does the simple computation for you, ie - get the mouse pos... - set the rectangle... - cut the image... us
|
Pages: 1 Prev: Array functions using MATLAB Next: Opening a Image in MatLAB GUI |