tensorflow实现图像的翻转
from:https://blog.csdn.net/uestc_c2_403/article/details/72703097
tensorflow内部含有实现图像翻转的函数为
tf.image.flip_up_down:从上向下翻转
tf.image.flip_left_right:从左到又翻转
tf.image.transpose_image:对角线翻转
tf.image.random_flip_up_down:以一定概率从上向下翻转
tf.image.random_flip_left_right:以一定概率从左到又翻转
例如:
- import matplotlib.pyplot as plt;
- import tensorflow as tf;
- image_raw_data_jpg = tf.gfile.FastGFile('11.jpg', 'r').read()
- with tf.Session() as sess:
- img_data_jpg = tf.image.decode_jpeg(image_raw_data_jpg)
- img_data_jpg = tf.image.convert_image_dtype(img_data_jpg, dtype=tf.float32)
- img_1 = tf.image.flip_up_down(img_data_jpg)
- img_2 = tf.image.flip_left_right(img_data_jpg)
- img_3 = tf.image.transpose_image(img_data_jpg)
- plt.figure(1)
- plt.imshow(img_1.eval())
- plt.figure(2)
- plt.imshow(img_2.eval())
- plt.figure(3)
- plt.imshow(img_3.eval())
- plt.show()
输出:
tensorflow实现图像的翻转的更多相关文章
- NOI题库 09:图像旋转翻转变换
NOI题库开始的题,也是略水,当然也是大水,所以彼此彼此 09:图像旋转翻转变换 总时间限制: 1000ms 内存限制: 65536kB 描述 给定m行n列的图像各像素点灰度值,对其依次进行一系列操作 ...
- Android Things 专题6 完整的栗子:运用TensorFlow解析图像
文| 谷歌开发技术专家 (GDE) 王玉成 (York Wang) 前面絮叨了这么多.好像还没有一个整体的概念.我们怎样写一个完整的代码呢? 如今深度学习非常火,那我们就在Android Things ...
- python Tensorflow 实现图像的卷积处理
1.convolution.py import numpy as np from sklearn.datasets import load_sample_images import tensorflo ...
- TensorFlow实现图像卷积并可视化示例
图片尺寸要自己修改. 看起来好像没啥意思,不知道下一步能干什么,先卷了再说.由于weights是随机生成的(tf.random_normal作用:用于从服从指定正太分布的数值中取出随机数),所以每次卷 ...
- tensorflow 中图像的读取
1. 使用gfile读入文件内容.输入的是String,输出3-D tensor.可惜的是输入不能是tensor def decode_jpg(path): r""" 读 ...
- TensorFlow的图像NCHW与NHWC
import tensorflow as tf x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] with tf.Session() as sess: a = t ...
- TensorFlow深度学习实战---图像数据处理
图像的亮度.对比度等属性对图像的影响非常大,这些因素都会影响最后的识别结构.当然,复杂的预处理过程可能会导致训练效率的下降(利用TensorFlow中多线程处理输入数据的解决方案). 同一不同的原始数 ...
- tensorflow学习笔记——图像数据处理
喜欢摄影的盆友都知道图像的亮度,对比度等属性对图像的影响是非常大的,相同物体在不同亮度,对比度下差别非常大.然而在很多图像识别问题中,这些因素都不应该影响最后的结果.所以本文将学习如何对图像数据进行预 ...
- [LeetCode] Flipping an Image 翻转图像
Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resu ...
随机推荐
- Ubuntu 16.04中的Dock的应用顺序调整
操作步骤: 参考: https://askubuntu.com/questions/39805/is-there-an-easy-way-to-rearrange-or-move-the-icons- ...
- Java获取指定时间(转)
说明:从LocalDate的API上看,主要用于快速获取当前年月日,而DateFormatter也基本上伴随着使用.如果是操作Date对象的,主要是用于时间戳等,伴随着使用的是SimpleDateFo ...
- Parallel Database for OLTP and OLAP
Parallel Database for OLTP and OLAP Just asurvey article on materials on parallel database products ...
- mybatis学习网站
http://www.mybatis.org/mybatis-3/zh/index.html
- 100 Most Influential Books According to Stack Overflow
Please read this blog post to see why this is here. This data was created on 02/13/2012 20:00:00 All ...
- Weblogic内存溢出及常用参数配置
http://www.360doc.com/content/14/0306/14/16134804_358216319.shtml 一.WebLogic内存溢出 最近访问量门户访问量突然增大, ...
- 小白学phoneGap《构建跨平台APP:phoneGap移动应用实战》连载一(PhoneGap中的API)
之前本博连载过<构建跨平台APP:jQuery Mobile移动应用实战>一书.深受移动开发入门人员的喜爱. 从如今開始,连载它的孪生姐妹书phoneGap移动应用实战一书,希望以前是小白 ...
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'user'
1.错误描写叙述 2014-7-12 21:06:05 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager 信息: ...
- 兔子--html,js,php,ASP,ASP.NET,JSP的关系
html是超文本链接语言.是静态的.显示在client.仅仅用HTML做出来的网页是静态网页.没不论什么交互功能. JS是一种基于对象和事件驱动的脚本语言,执行在client.是一种比較简单的编程语言 ...
- 每天一个linux命令(23):Linux 目录结构(转)
对于每一个Linux学习者来说,了解Linux文件系统的目录结构,是学好Linux的至关重要的一步.,深入了解linux文件目录结构的标准和每个目录的详细功能,对于我们用好linux系统只管重要,下面 ...