unsigned long AAtime = 0, BBtime = 0; cuda::GpuMat gpuImg, gpuImg_out; Mat img, img_out, img_out2; img = imread("2mb.jpg"); gpuImg.upload(img); AAtime = getTickCount(); cuda::bitwise_not(gpuImg, gpuImg_out); Ptr< cv::cuda::filter > filter = cuda::createSobelFilter(img.type(), img.type(), 1, 0); filter->apply(gpuImg_out, gpuImg_out); BBtime = getTickCount(); gpuImg_out.download(img_out); printf("gpu : %.2lf second \n", (BBtime - AAtime) / getTickFrequency()); AAtime = getTickCount(); bitwise_not(img, img_out2); Sobel(img_out2, img_out2, img_out2.depth(), 1, 0); BBtime = getTickCount(); printf("cpu : %.2lf second \n", (BBtime - AAtime) / getTickFrequency()); imshow("cpu_img", img_out); imshow("cpu_img", img_out2); waitKey(0);
12/16/2016
Gpu Mat, Cpu Mat example 2
Subscribe to:
Post Comments (Atom)
-
Logistic Classifier The logistic classifier is similar to equation of the plane. W is weight vector, X is input vector and y is output...
-
In past, I wrote an articel about YUV 444, 422, 411 introduction and yuv rgb converting example code. refer to this page -> http://feel...
-
To install the language pack for vs 2013, it made things worse. The error message "window program compatibility mode is on. turn i...
-
I can know all coordinate from A point to B point using "LineIterator" function in OpenCV. So this source code is applied by this...
-
//Singular value decomposition : Mat w, u, v; SVDecomp(data, w, u, v); // A = U W V^T //The flags cause U and V to be returned transpose...
-
Very Nice Convoluiton Convolution (korean) https://gaussian37.github.io/dl-concept-covolution_operation/ ✌️
-
# Step 1: Define and train a simple PyTorch CNN model import torch import torch.nn as nn import torch.optim as optim import torchvisi...
-
Image size of origin is 320*240. Processing time is 30.96 second took. The result of stitching The resul...
-
recent EEG datasets and papers from the last 5 years: OpenNeuro EEG Datasets (2020-Present) DS003190: High-density EEG during motor tasks (...
-
What is TorchOps.cpp.inc ? TorchOps.cpp.inc : This file contains implementations of the operations for the torch-mlir dialect. It is ty...
No comments:
Post a Comment