Home > other >  Pytoch image preprocessing
Pytoch image preprocessing

Time:09-20

Requirements:
Input an image, and the width reduction ratio, long narrow scale,
Output: scaled images,
Def sf (x, y, z, a, b) : # x number of channels; Y wide; Z is high; A wide ratio; B long multiple
For I in range (x) :
For j in range (y) :
For k in range (z) :
Image_new] [I, j, k=image_arr [I, j * a, k * b]

Return image_new. ToPILImage () (image_new) # tensor to PIL Image
According to the change -- --
Can be difficult for small white help bosses

CodePudding user response:


The resize (SRC, DST, Size (SRC. Cols * 0.5, SRC. Rows * 0.5));//the DST to SRC half the size of the adjustment

CodePudding user response:


OpenCV related knowledge and practical experience,

  • Related