#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include "opencv2/video/tracking.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/opencv.hpp>
#include <time.h>
#include <iostream>
using namespace std;
using namespace cv;
#include <stdio.h>
//定义图像大小
#define N 32
//定义block_size
__global__ void MediaFilter(uchar* In,uchar* Out, int Width, int Height, clock_t *time)
{
uchar window[9];
unsigned int x=blockIdx.x * blockDim.x + threadIdx.x;
unsigned int y=blockIdx.y * blockDim.y + threadIdx.y;
//记录运行开始的时间
clock_t start;
if(x==0&&y==0) start = clock();
if(x>=Width && y>=Height) {printf("break %s\n","");return;}
window[0] = ( y==0 || x==0 ) ? 0 : In[( y - 1 ) * Width + x - 1];
window[1] = ( y==0 ) ? 0 : In[ ( y - 1 ) * Width + x ];
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载