Add pad array for image only to top and bottom
Show older comments
I want to add pad array to a given image, for top and bottom sides only. How can I do this

**I don't want black outline it is only for illustration
I have used this code but it appears in only left and right sides only
rgbImage = imread('image path');
[heigth,width,dim] = size(rgbImage);
if heigth>width
cal=(heigth-width)/2;
calculatedWidth=double(fix(cal));
paddedImage = padarray(rgbImage,[0 calculatedWidth],255);
else
cal=(width-heigth)/2;
calculatedHeigth=double(fix(cal));
paddedImage = padarray(rgbImage,[0 calculatedHeigth],255);
end
imshow(paddedImage);
*output image that I have got

Accepted Answer
More Answers (0)
Categories
Find more on Deblurring in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!