资源简介
参考网上博文(感谢)以及结合自己的想法思路进行图像均值滤波,Markdown此博文是为了记录自己的学习历程。
代码片段和文件信息
#include
#include
#include “cpuSmoothImg.h“
#include “gpuSmoothImg.h“
#include
void cpuSmoothImage(unsigned char* srcData unsigned char* dstData int width int height int winSize){
// copy srcData to dstData
// memcpy(dstData srcData width * height * sizeof(unsigned char));
int nAnchor = 0;
nAnchor = winSize / 2;
for(int i = 0; i < height; i++){
float rowPixel = 0;
for(int j = 0; j < width - 2*nAnchor; j++){
if(j == 0){
for(int k = 0; k < winSize; k++){
rowPixel += srcData[i * width + k];
}
dstData[i * width + j + nAnchor] = rowPixel / winSize;
}
else{
rowPixel = rowPixel - srcData[i * width + j - 1] + srcData[i * width + j - 1 + winSize];
dstData[i * width + j + nAnchor] = rowPixel / winSize;
}
}
}
unsigned char* cpyData = NULL;
cpyData = (unsigned char*)malloc(height * width * sizeof(unsigned char));
memcpy(cpyData dstData width * height * sizeof(unsigned char));
for(int x = nAnchor; x < width - nAnchor; x++){
float colPixel = 0;
for(int y = 0; y < height - 2*nAnchor; y++){
if(y == 0){
for(int z = 0; z < winSize; z++){
colPixel += cpyData[z * width + x];
}
dstData[(nAnchor + y) * width + x] = colPixel / winSize;
}
else{
colPixel = colPixel - cpyData[(y - 1) * width + x] + cpyData[(y- 1 + winSize) * width + x];
dstData[(nAnchor + y) * width + x] = colPixel / winSize;
}
}
}
free(cpyData);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-11-27 02:32 meanFilter\
文件 1848 2019-11-26 04:36 meanFilter\green.jpg
文件 122903 2019-11-22 06:20 meanFilter\sample.jpeg
文件 811 2019-11-21 07:56 meanFilter\.project
文件 12353 2019-11-22 07:20 meanFilter\.cproject
文件 643545 2019-11-18 07:42 meanFilter\homePage.jpg
目录 0 2019-11-26 09:28 meanFilter\src\
文件 1457 2019-11-27 09:10 meanFilter\src\cpuSmoothImg.cpp
文件 264 2019-11-25 07:31 meanFilter\src\cpuSmoothImg.h
文件 2743 2019-11-27 07:53 meanFilter\src\main.cpp
文件 2885 2019-11-27 09:23 meanFilter\src\gpuSmoothImg.cu
文件 349 2019-11-27 07:50 meanFilter\src\gpuSmoothImg.h
目录 0 2019-11-27 09:23 meanFilter\Debug\
文件 221 2019-11-27 09:23 meanFilter\Debug\nsightbuilddata
文件 552 2019-11-27 09:23 meanFilter\Debug\sources.mk
文件 298 2019-11-27 09:23 meanFilter\Debug\ob
文件 1875 2019-11-27 09:23 meanFilter\Debug\makefile
文件 1262336 2019-11-27 09:23 meanFilter\Debug\meanFilter
目录 0 2019-11-27 09:23 meanFilter\Debug\src\
文件 40504 2019-11-27 09:23 meanFilter\Debug\src\cpuSmoothImg.o
文件 1467 2019-11-27 09:23 meanFilter\Debug\src\subdir.mk
文件 8826 2019-11-27 09:23 meanFilter\Debug\src\cpuSmoothImg.d
文件 100144 2019-11-27 09:23 meanFilter\Debug\src\gpuSmoothImg.o
文件 12032 2019-11-27 09:23 meanFilter\Debug\src\gpuSmoothImg.d
文件 20300 2019-11-27 07:53 meanFilter\Debug\src\main.d
文件 821016 2019-11-27 07:53 meanFilter\Debug\src\main.o
文件 1297078 2019-11-27 07:26 meanFilter\cpu.bmp
文件 1297078 2019-11-27 07:26 meanFilter\gpu.bmp
相关资源
- CUDA并行排序(1)——整数
- CUDA和OPENCL遥感影像正射校正
- cuda 权威指南习题答案及coda
- 解决GTX970、980等不能用CUDA转码的问题
- cuda 常用dll库
- DMA+多路ADC+定时器+均值滤波.zip
- CUDA学习资料
- CUDA for Engineers An Introduction to High Per
- OpenCL in Action.pdf
- CUDA并行程序设计:GPU编程指南
- cuda8.0-windows10-64 桌面版离线安装包
- 高性能CUDA应用设计与开发方法与最佳
- Programming Massively Parallel Processors_ A H
- opencv3.4+opencv_contrib3.4+cuda10.0+tbb+win10
- cudnn-11.0-windows-x64-v8.0.2.39.zip
- cudnn-10.0-windows10-x64-v7.6.5.32.zip
- cudnn-9.1-windows7-x64-v7.1.3.zip
- CUDA并行程序设计 GPU编程指南-中文扫
- cudnn-10.0-windows10-x64-v7.6.0.64.rar
- cublas64_92.dll
- Cuda C 编程指南程润伟
- cudnn7.4+cuda10.0+tensorflwo1.4亲测,此文件
- cuDNN v7.1.2 (Mar 21 2018) for CUDA 9.0
- cudnn-9.0-windows10-x64-v7.2.1.38
- GPU高性能编程CUDA实战中文版.pdf
- cuda by examples 中文版
- 大规模并行处理器编程实战(中文版
- GPU高性能编程CUDA实战中文
- CUDA实现的直方图均衡化算法
- 基于FPGA的均值滤波本人上传所有资源
评论
共有 条评论