Copy RGB image pixel value to another white background
1 次查看(过去 30 天)
显示 更早的评论
I have an image with dimension 785*1300. I want to convert this image to 1300*1300. Here I created a 1300*1300 white image and i want to copy previous image into this image. How can I do this with matlab.
0 个评论
采纳的回答
Image Analyst
2016-7-10
For your specific case here, you can simply use padarray() to pad white on the right and left sides. See the help. Let me know if you can't figure it out, otherwise you can Accept this answer.
4 个评论
Image Analyst
2016-7-17
编辑:Image Analyst
2016-7-17
Yes, that should work. Doesn't it? This works fine for me:
colorImage = imread('peppers.png');
subplot(1, 2, 1);
imshow(colorImage);
padding = 100;
paddedImage = padarray(colorImage, [0, padding], 255);
subplot(1, 2, 2);
imshow(paddedImage);
更多回答(1 个)
Image Analyst
2016-7-10
Just copy and paste. See my attached demo.
5 个评论
Image Analyst
2016-7-12
The parts of image2 going from row1 to row2, and from column 1 to column 2 will be replaced by image1.
另请参阅
类别
在 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!