dgyoo / pa3

Recent image representation as PA3 of the computer vision class.
7 stars 0 forks source link

How to crop Image when Image size small then 224*224? #5

Open bubae opened 8 years ago

bubae commented 8 years ago

When I doing single activation step, I cropped center of image with size 224*224.

But some image (example : airport_inside_0003.jpg) size small then 224*224.

How can I crop these images?

jaeheungs commented 8 years ago

You can simply resize them using imresize. (e.g.: imresize(image, [224, 224]); This will enlarge the image.

Jaeheung Surh 20153300

BAILOOL commented 8 years ago

For single activation (part 1) you might want to consider to re-size every single image to the size 224x224. If you do only central crop of a big image you would be losing part of the scene, which is actually information we need. More information is better for image classification.

I tried both methods: central crop and re-sizing of every single image. The second one gives about 60% accuracy, while the first one - 50%.

bismex commented 8 years ago

If you want to keep the aspect ratio, you can re-size image size keeping aspect ratio. like that : row > col -> imresize(img, [row_224/col, 224], interpolation) col > row -> imresize(img, [224, col_224/row], interpolation) and then you can center crop the image with size [224, 224]

Unless you want to keep the aspect ratio, you can re-size image size [224, 224] at once.

Former method is better than latter method from the viewpoint of accuracy rate.

Thank you. Choi seok eon (20153640)