1.1 TensorFlow简介
1.1.1 小概念
- TensorFlow:Tensor是张量,Flow指数据流图的流动。
- 张量:是在深度学习中表示数据的标准方式。简单地说,张量就是多维数组,是二维表(矩阵)到更高维度的扩展。
- TensorBoard:TensorFlow可视化工具,用于监视、调试和分析训练过程和实验。
- MNIST(Mixed National Institute of Standards and Technology):手写数字数据集。
- 神经元模型
- BP神经网络中的两个基础算法:随机梯度下降算法和最小二乘法(LS算法)。 重要的反向传播算法
1.2 TensorFlow配置与使用
可参考链接:
环境配置:
字符训练:
1.3 TensorFlow用法
2.1 OpenCV3与VS2015配置
2.2 OpenCV3函数
2.2.1 卷积核函数 filter2D
filter2D: cv2.filter2D(src, -1, kernel, dst); 其中:src是目标图片,-1指每个目标图片的通道位深数,一般要求目标图片和生成图片的位深数一样,kernel是图片所使用的卷积核矩阵。
2.2.1 连通域connectedComponentsWithStats
int cv::connectedComponentsWithStats (cv::InputArrayn image, cv::OutputArray labels, cv::OutputArray stats,cv::OutputArray centroids,int connectivity = 8, int ltype);用于过滤原始图像中轮廓分析后较小的区域,留下较大区域。
其中:
cv::InputArrayn image, // input 8-bit single-channel (binary)
cv::OutputArray labels, // output label map
cv::OutputArray stats, // Nx5 matrix (CV_32S) of statistics:
// [x0, y0, width0, height0, area0;
// ... ; x(N-1), y(N-1), width(N-1),
// height(N-1), area(N-1)]
cv::OutputArray centroids, // Nx2 CV_64F matrix of centroids:
// [ cx0, cy0; ... ; cx(N-1), cy(N-1)]
int connectivity = 8, // 4- or 8-connected components
int ltype = CV_32S // Output label type (CV_32S or CV_16U)
2.2.3 直方图函数calcHist()
图像的直方图可以用来调整图像的亮度和对比度。
2.2.4 正则化函数normalize()
2.2.5 直方图的均衡化函数:equalizeHist()
equalizeHist(image, equalizedImg)
2.2.6 图像旋转getRotationMatrix2D
Mat getRotationMatrix2D(Point2f center, double angle, double scale)
其中:
Point2f center:表示旋转的中心点
double angle:表示旋转的角度
double scale:图像缩放因子