Draw a border around an image

Draws a colored border around an image.
4,4K Downloads
Aktualisiert 31. Dez 2009

Lizenz anzeigen

ADDBORDER draws a border around an image.

NEWIMG = ADDBORDER(IMG, T, C, S) adds a border to the image IMG with thickness T, in pixels. C specifies the color, and should match the color format of the image (e.g., RGB or indexed). STROKE is a string indicating the position of the border:

'inner' - border is added to the inside of the image. The dimensions of OUT will be the same as IMG.

'outer' - the border sits completely outside of the image, and does not obscure any portion of it.

'center' - the border straddles the edges of the image.

Example:

load mandrill
X2 = addborder(X, 20, 62, 'center');
image(X2);
colormap(map);
axis off
axis image

Zitieren als

Eric Johnson (2024). Draw a border around an image (https://www.mathworks.com/matlabcentral/fileexchange/21005-draw-a-border-around-an-image), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2008a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Display Image finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
1.2.0.0

None

1.0.0.0