How to draw a white border around an image(or a group of images in a folder)
조회 수: 5 (최근 30일)
이전 댓글 표시
I have an image :-
![](/matlabcentral/answers/uploaded_files/74004/001bin.jpg)
Now i want to draw a white border around the image,such that i get this:-
![](/matlabcentral/answers/uploaded_files/74005/001bin.jpg)
How can i do this.Please help.
댓글 수: 0
답변 (1개)
Image Analyst
2017년 4월 1일
Use padarray():
padsize = 1;
padvalue = 255; % or 1 if image is single, double, or logical.
paddedImage = padarray(originalImage, padsize, padval);
댓글 수: 3
Image Analyst
2017년 4월 1일
Then just write it in yourself
grayImage(:, 1) = 255; % Make left column white.
grayImage(:, end) = 255; % Make right column white.
grayImage(1, :) = 255; % Make top row white.
grayImage(end, :) = 255; % Make bottom row white.
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!