|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- void preProcess(uchar4** inputImage, unsigned char** greyImage,
- uchar4** d_rgbaImage, unsigned char** d_greyImage,
- const std::string& filename) {
- //make sure the context initializes ok
- checkCudaErrors(cudaFree(0));
- cv::Mat image;
- image = cv::imread(filename.c_str(), cv::IMREAD_COLOR);
- // image = cv::imread("test.jpg", CV_LOAD_IMAGE_COLOR);
- if (image.empty()) {
- std::cerr << "Couldn't open file: " << filename << std::endl;
- exit(1);
- }
-
- int main(int argc, char* argv[]) {
- //load input file
- //std::string input_file = argv[1];
- std::string input_file = "H:\\SZ_code\\GPU\\Cuda_scan\\Cuda_scan\\test.jpg";
- //define output file
- std::string output_file = "out.jpg";
- uchar4* h_rgbaImage, * d_rgbaImage;
- unsigned char* h_greyImage, * d_greyImage;
- //load the image and give us our input and output pointers
- preProcess(&h_rgbaImage, &h_greyImage, &d_rgbaImage, &d_greyImage, input_file);
- cleanup();
- }
复制代码
|
|