Best Padding for Images [closed]

流过昼夜 提交于 2020-12-08 04:47:44

问题


%Padding Part%
Padding_Bottom_And_Top = zeros(round(Image_Height/2),Image_Width,3);
Side_Padding = zeros(Image_Height+2*size(Padding_Bottom_And_Top,1),Image_Width/2,3);
Padded_Image = [Padding_Bottom_And_Top; Original_Image];
Padded_Image = [Padded_Image; Padding_Bottom_And_Top];
Padded_Image = [Side_Padding Padded_Image];
Padded_Image = [Padded_Image Side_Padding];
 
[Padded_Image_Height,Padded_Image_Width,~] = size(Padded_Image);
Rotated_Image = zeros(Image_Height,Image_Width,3);

This is an classical padding code. As u see this code do same padding for all images. I need to have a padding code that just do enough amount (Enough to not cut the edges of the picture ) of padding while rotating between 0 to 45 degrees.

Padding_Bottom_And_Top = zeros(round(Image_Height/2),Image_Width,3);

For instance, in this piece of code we are taking 'image_height/2' to make a padding , so absouletly it is not gonna clip with creating a padding with same height of the image, but isn't it more than necessary.

What is the useful amount of height-width for padding ? Can u help me ?

来源:https://stackoverflow.com/questions/65012904/best-padding-for-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!