Hands-On GPU-Accelerated Computer Vision with OpenCV and CUDA by Bhaumik Vaidya

Hands-On GPU-Accelerated Computer Vision with OpenCV and CUDA by Bhaumik Vaidya

Author:Bhaumik Vaidya
Language: eng
Format: epub
Tags: COM051220 - COMPUTERS / Programming / Parallel, COM051070 - COMPUTERS / Programming Languages / C++, COM012000 - COMPUTERS / Computer Graphics
Publisher: Packt Publishing
Published: 2018-09-27T05:45:28+00:00


int main (int argc, char* argv[])

{

cv::Mat h_img1 = cv::imread("images/cameraman.tif", 0);

cv::cuda::GpuMat d_result1,d_result2,d_result3,d_result4,d_result5, d_img1;

//Measure initial time ticks

int64 work_begin = getTickCount();

d_img1.upload(h_img1);

cv::cuda::threshold(d_img1, d_result1, 128.0, 255.0, cv::THRESH_BINARY);

cv::cuda::threshold(d_img1, d_result2, 128.0, 255.0, cv::THRESH_BINARY_INV);

cv::cuda::threshold(d_img1, d_result3, 128.0, 255.0, cv::THRESH_TRUNC);

cv::cuda::threshold(d_img1, d_result4, 128.0, 255.0, cv::THRESH_TOZERO);

cv::cuda::threshold(d_img1, d_result5, 128.0, 255.0, cv::THRESH_TOZERO_INV);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.