Change image canvas size in Matlab -


I have a picture in the canvas / shape and I can increase the height and width of the canvas / shape without resizing the photo Want (for example, display the image in a big "canvas") How can I do this?

Thank you.

Use the above comments borrowed in response to Luis Mendo, you say it like that, seeing that Your image is stored in im :

  out = padarray (im, [colle cols], padval, 'both'); Set the  

rows and the cols pixel border that you want the pad in your image, which will match the The account flag padval is the value that you want to keep on the border, when you are moving the canvas size, you can either make any price that corresponds to the type of image you have Believe it. For example, you can type 0 for black, 255 for white, white and 128 . For example, if you want a 10 pixel wide border for rows and a 5-pixel wide border of gray for your column, do this:

  Exclude = Pader (IM, [10 5]], 128, 'both');  

This is an example in the onion.png image stored in the MATLAB system path:

  im = imread ('onion .png '); Outside = padarar (im, [10 5], 128, 'both'); Imshow (outside);  

I get it:

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -