【Problem today】automatic cropping

  1. database images have the black boundries
  2. cropping of the query image boundar
  3. image is numberplate

Problem 1:

I’m creating a figure with the imshow command, then using the ‘print’ command with the -djpeg90 option to create a jpeg file of the image in the figure window.

When I do this, the generated jpeg has a large white border around it, which I would like to eliminate or, if this
not possible, reduce the size of it (essentially cropping a jpeg). I know I can use an image editing program to do this, but is there anyway to do this in the Matlab environment? Or is there an option that I can use to reduce the size of the border that is created with the ‘print’ command?

I thought I had it figured out with the “iptsetpref(‘imshowborder’,’tight’);” command, but not so.

Also, the “imcrop” command does not do exactly what I’d like, since I’d rather not have to read the .jpeg file back into memory.

solution 1:


subplot(‘Position’, [0 0 1 1]); axis off;  image(im);

 print(f, ‘-djpeg90’, ‘1.jpg’);

2 3



Problem 2:

print figure to jpg( too large resolution!!)

solution 2:

printing figures to emf files at set resolution, e.g.

  • print(‘-dpsc2′,’-zbuffer’,’-r200′, ‘picture1’) ===800*100  prints the current figure with a resolution of 100
  • print(‘-dpsc2′,’-zbuffer’,’-r200′)  ===1600*1200
  • print(‘-depsc’,’-tiff’,’-r300′,’picture1′) ==== 2400* 1800  sets the output resolution to 300 dots per inch.
  • -r0 =====using screen resolution
  • -r40 ==== 320*240

Problem 3:

differences between imagesc, image, and imshow

  • How can we make the image() imitate the imshow()?

Resolution 3: 

  • imshow(<pic>)

figure window automatically modifies itself so that the pictures aspect ratio are preserved and the image does not look stretched out or it does not necessarily fill the axis created initially by the figure window.

  • image(<pic>)

picture accomodates itself in the figures axis and the aspect ratio and the original resolution is lost.

figure,image(I); truesize;



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......







Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision


Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness



Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: