【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?

1
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:

f=figure;

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;

 

Advertisements

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

生活在西班牙

自己动手丰衣足食

BlueAsteroid

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

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

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: