资源简介
二维矩阵卷积,两个图像大小相同
二维矩阵卷积,两个图像大小相同
代码片段和文件信息
#include “iostream“
double** Jconv(double** featurePixeldouble** featurePixel2int featureSizeYint featureSizeX)
{
int Heigth = 2 * featureSizeY - 1 ;
int Width = 2 * featureSizeX - 1 ;
double **tempPixel;
tempPixel = new double*[Heigth];
for (int a=0 ; a < Heigth ; a++ )
{
tempPixel[a] = new double[Width] ;
}
double **finalPixel;
finalPixel = new double*[featureSizeY];
for (int a=0 ; a < featureSizeY ; a++ )
{
finalPixel[a] = new double[featureSizeX] ;
}
//初始化数组
for(int i = 0 ; i < Heigth ; i++ )
{
for (int j = 0 ; j < Width ; j++ )
{
tempPixel[i][j] = 0;
}
}
for(int i = 0 ; i < featureSizeY ; i++ )
{
for (int j = 0 ; j < featureSizeX ; j++ )
{
finalPixel[i][j] = 0;
}
}
int k1 = (Heigth-1)/2;
int k2 = (Width-1)/2;
for (int m = 0; m <= k1; m++)
{
for(int n = 0 ; n<= k2; n++)
{
for (int i = 0; i<= m;i++)
{
for(int j = 0; j<=n; j++)
{
tempPixel[m][n] = tempPixel[m][n] + featurePixel[i][j] * featurePixel2[m-i][n-j] ;
}
}
}
for(int n = k2+1 ; n< Width; n++)
{
for (int i = 0; i<= m;i++)
{
for(int j = n; j {
tempPixel[m][n] = tempPixel[m][n] + featurePixel[i][j-k2] * featurePixel2[m-i][n-j+k2] ;
}
}
}
}
for (int m = k1+1; m < Heigth; m++)
{
for(int n = 0 ; n<= k2; n++)
{
for (int i = m; i< Heigth;i++)
{
for(int j = 0; j<=n; j++)
{
tempPixel[m][n] = tempPixel[m][n] + featurePixel[i-k1][j] * featurePixel2[m-i+k1][n-j] ;
}
}
}
for(int n = k2+1 ; n< Width; n++)
{
for (int i = m; i< Heigth;i++)
{
for(int j = n; j {
tempPixel[m][n] = tempPixel[m][n] + featurePixel[i-k1][j-k2] * featurePixel2[m-i+k1][n-j+k2] ;
}
}
}
}
std::cout << “ tempPixel : “ << std::endl;
for(int i = 0 ; i < Heigth ; i++ )
{
for (int j = 0 ; j < Width ; j++ )
{
std::cout << tempPixel[i][j] << “\t“;
}
std::cout << std::endl;
}
for(int i = 0 ; i < featureSizeY ; i++ )
{
for (int j = 0 ; j < featureSizeX ; j++ )
{
finalPixel[i][j] = tempPixel[i+(k1+1)/2][j+(k2+1)/2];
}
}
return finalPixel;
}
int main()
{
std::cout << “ aaa “ << std::endl;
int serachWidth = 1;
int searchHeight = 1;
int featureSizeX = 2*serachWidth+1;
int featureSizeY = 2*searchHeight+1 ;
//提取局部图像数组
double **featurePixel;
featurePixel = new double*[featureSizeY];
for (int a=0 ; a < featureSizeY ; a++ )
{
featurePixel[a] = new double[featureSizeX] ;
}
double **featurePixel2;
featurePixel2 = new double*[featureSizeY];
for (int a=0 ; a < featureSizeY ; a++ )
{
featurePixel2[a] = new double[featureSizeX] ;
}
//初始化数组
for(int i = 0 ; i < featureSizeY ; i++ )
{
for (int j = 0 ; j < featureSizeX ; j++ )
{
featurePixel[i][j] = 3*i+j+1;
std::cout << featurePixel[i][j] << “\t“;
}
std::cout << std::endl;
}
for(int i = 0 ; i < featur属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3642 2010-07-26 17:00 testConv\testConv\testConv.vcproj
文件 1427 2010-07-26 17:37 testConv\testConv\testConv.vcproj.PC-201002011245.RenYanhua.user
文件 7454 2010-07-26 17:35 testConv\testConv\Debug\BuildLog.htm
文件 175104 2010-07-26 17:35 testConv\testConv\Debug\vc90.idb
文件 217088 2010-07-26 17:35 testConv\testConv\Debug\vc90.pdb
文件 621 2010-07-26 17:35 testConv\testConv\Debug\testConv.exe.intermediate.manifest
文件 67 2010-07-26 17:35 testConv\testConv\Debug\mt.dep
文件 46706 2010-07-26 17:35 testConv\testConv\Debug\test.obj
文件 3802 2010-07-26 17:35 testConv\testConv\test.cpp
文件 1166336 2010-07-26 17:37 testConv\testConv.ncb
文件 890 2010-07-26 16:59 testConv\testConv.sln
..A..H. 9216 2010-07-26 17:37 testConv\testConv.suo
文件 378888 2010-07-26 17:35 testConv\Debug\testConv.ilk
文件 527360 2010-07-26 17:35 testConv\Debug\testConv.pdb
文件 40960 2010-07-26 17:35 testConv\Debug\testConv.exe
目录 0 2010-07-26 17:00 testConv\testConv\Debug
目录 0 2010-07-26 16:59 testConv\testConv
目录 0 2010-07-26 17:00 testConv\Debug
目录 0 2010-07-26 16:59 testConv
----------- --------- ---------- ----- ----
2579561 19
- 上一篇:usb控制注册表
- 下一篇:LabVIEW控制伺服电机详细过程以及设备明细
相关资源
- 使用卷积神经网络在e + e-对撞机上改
- 深度学习卷积神经网络可检测和分类
- 卷积神经网络的压缩和加速
- 基于深度学习的图像超分辨率算法论
- 卷积神经网络的人脸识别样本采集+
- 卷积码的viterbi维特比译码算法的FPG
- 一种基于浅层卷积神经网络的隐写分
- 论文研究-基于改进贝叶斯优化算法的
- 论文研究-基于卷积神经网络的图像隐
-
Tree-ba
sed Convolutional Neural Networks - 基于多任务卷积网络(MTCNN)和Cente
- 卷积神经网络识别手写字体,很强大
- A Guide to Convolutional Neural Networks for C
- 卷积神经网络的概述论文:分析、应
- dsp课设 :卷积Convolve算法
- 深层卷积神经网络实现超分辨重建,
- 复数版卷积神经网络,复数版CAFFE
- 卷积神经网络实现手写数字识别
- 基于CNN的手写数字识别
- 卷积反投影图象重建
- 卷积码(2_1_3)编译码课程设计
- 217卷积码的viterbi译码算法的FPGA实现内
- Keras实现经典的卷积神经网络
- 卷积码的译码的两种算法
- FCN全卷积网络必要文件MITSceneParsing.
- 李宏毅课件卷积神经网络CNN课件笔记
- 基于卷积神经网络的医学图像癌变识
- 深度卷积生成对抗网络TensorFlow代码实
- RS255239和217卷积码的级联实现代码
- Visualizing and Understanding Convolutional Ne
川公网安备 51152502000135号
评论
共有 条评论