tf.image这个设计是个反人类的模块,很多东西绕口。在喂入模型图像数据时候,tensorflow用的是[None,w,h,c],而模型别的框架,可能是[w,h,c,None],或者是一个长度为5的形状。其中说下kears被整合到了tensorflow,而kears的格式就是和tensorflwo相反的。下面是他的操作图像的函数。
adjust_brightness(...): 调整RGB或灰度图像的亮度.
adjust_contrast(...): 调整RGB或灰度图像的对比度.
adjust_gamma(...): 对输入图像执行Gamma校正.
adjust_hue(...): 调整RGB图像的色调.
adjust_saturation(...): 调整RGB图像的饱和度.
central_crop(...): 裁剪图像的中心区域.
convert_image_dtype(...): 将图像转换为dtype,根据需要缩放其值.
crop_and_resize(...): 从输入图像张量中提取裁剪并对其进行双线性调整.
crop_to_bounding_box(...): 将图像裁剪到指定的边界框.
decode_and_crop_jpeg(...):将JPEG编码图像解码并裁剪为uint8张量.
decode_bmp(...): Decode the first frame of a BMP-encoded image to a uint8 tensor.
decode_gif(...): Decode the first frame of a GIF-encoded image to a uint8 tensor.
decode_image(...): Convenience function for decode_bmp, decode_gif, decode_jpeg,
decode_jpeg(...): Decode a JPEG-encoded image to a uint8 tensor.
decode_png(...): Decode a PNG-encoded image to a uint8 or uint16 tensor.
draw_bounding_boxes(...): Draw bounding boxes on a batch of images.
encode_jpeg(...): JPEG-encode an image.
encode_png(...): PNG-encode an image.
extract_glimpse(...): Extracts a glimpse from the input tensor.
extract_jpeg_shape(...): Extract the shape information of a JPEG-encoded image.
flip_left_right(...): Flip an image horizontally (left to right).
flip_up_down(...): Flip an image vertically (upside down).
grayscale_to_rgb(...): Converts one or more images from Grayscale to RGB.
hsv_to_rgb(...): Convert one or more images from HSV to RGB.
image_gradients(...): Returns image gradients (dy, dx) for each color channel.
is_jpeg(...): Convenience function to check if the 'contents' encodes a JPEG image.
non_max_suppression(...): Greedily selects a subset of bounding boxes in descending order of score.
pad_to_bounding_box(...): Pad image with zeros to the specified height and width.
per_image_standardization(...): Linearly scales image to have zero mean and unit norm.
psnr(...): Returns the Peak Signal-to-Noise Ratio between a and b.
random_brightness(...): Adjust the brightness of images by a random factor.
random_contrast(...): Adjust the contrast of an image by a random factor.
random_flip_left_right(...): Randomly flip an image horizontally (left to right).
random_flip_up_down(...): Randomly flips an image vertically (upside down).
random_hue(...): Adjust the hue of an RGB image by a random factor.
random_saturation(...): Adjust the saturation of an RGB image by a random factor.
resize_area(...): Resize images to size using area interpolation.
resize_bicubic(...): Resize images to size using bicubic interpolation.
resize_bilinear(...): Resize images to size using bilinear interpolation.
resize_image_with_crop_or_pad(...): Crops and/or pads an image to a target width and height.
resize_images(...): Resize images to size using the specified method.
resize_nearest_neighbor(...): Resize images to size using nearest neighbor interpolation.
rgb_to_grayscale(...): Converts one or more images from RGB to Grayscale.
rgb_to_hsv(...): Converts one or more images from RGB to HSV.
rgb_to_yiq(...): Converts one or more images from RGB to YIQ.
rgb_to_yuv(...): Converts one or more images from RGB to YUV.
rot90(...): Rotate image(s) counter-clockwise by 90 degrees.
sample_distorted_bounding_box(...): Generate a single randomly distorted bounding box for an image.
sobel_edges(...): Returns a tensor holding Sobel edge maps.
ssim(...): Computes SSIM index between img1 and img2.
ssim_multiscale(...): Computes the MS-SSIM between img1 and img2.
total_variation(...): Calculate and return the total variation for one or more images.
transpose_image(...): Transpose image(s) by swapping the height and width dimension.
yiq_to_rgb(...): Converts one or more images from YIQ to RGB.
yuv_to_rgb(...): Converts one or more images from YUV to RGB.