mmcv.image¶
mmcv.image
IO¶
Read an image from bytes. |
|
Read an image. |
|
Write image to file. |
|
Select a backend for image decoding. |
Color Space¶
Convert a BGR image to grayscale image. |
|
Convert a BGR image to HLS |
|
Convert a BGR image to HSV |
|
Convert a BGR image to RGB |
|
Convert a BGR image to YCbCr image. |
|
Convert a grayscale image to BGR image. |
|
Convert a grayscale image to RGB image. |
|
Convert a HLS image to BGR |
|
Convert a HSV image to BGR |
|
Convert an image from the src colorspace to dst colorspace. |
|
Convert a RGB image to BGR |
|
Convert a RGB image to grayscale image. |
|
Convert a RGB image to YCbCr image. |
|
Convert a YCbCr image to BGR image. |
|
Convert a YCbCr image to RGB image. |
Geometric¶
Randomly cut out a rectangle from the original img. |
|
Crop image patches. |
|
Flip an image horizontally or vertically. |
|
Pad the given image to a certain shape or pad on all sides with specified padding mode and padding value. |
|
Pad an image to ensure each edge to be multiple to some number. |
|
Resize image while keeping the aspect ratio. |
|
Resize image to a given size. |
|
Resize image to the same size of a given image. |
|
Resize image according to a given size or scale factor and then rounds up the the resized or rescaled image size to the nearest value that can be divided by the divisor. |
|
Rotate an image. |
|
Shear an image. |
|
Translate an image. |
|
Calculate the new size to be rescaled to. |
Photometric¶
Adjust image brightness. |
|
It blends the source image and its gray image: |
|
Adjust image contrast. |
|
Adjust hue of an image. |
|
AlexNet-style PCA jitter. |
|
Adjust image sharpness. |
|
Auto adjust image contrast. |
|
Use CLAHE method to process the image. |
|
Equalize the image histogram. |
|
Invert (negate) an image. |
|
Normalize an image with mean and std. |
|
Transform array by look-up table. |
|
Posterize an image (reduce the number of bits for each color channel) |
|
Solarize an image (invert all pixel values above a threshold) |
Miscellaneous¶
Convert tensor to 3-channel images or 1-channel gray images. |