Commit fd758521 authored by Matt Clarkson's avatar Matt Clarkson

Issue #4: Put GPU code back in.

parent 0162d462
......@@ -14,8 +14,8 @@
#include <iostream>
#include "sksGPUUtils.h"
//#include "opencv2/core/cuda.hpp"
//#include "opencv2/cudaarithm.hpp"
#include "opencv2/core/cuda.hpp"
#include "opencv2/cudaarithm.hpp"
namespace sks
{
......@@ -23,8 +23,6 @@ namespace sks
//-----------------------------------------------------------------------------
cv::Mat MultiplyTwoArrays(const cv::Mat &a, const cv::Mat &b)
{
return a;
/*
cv::cuda::GpuMat mul, src_a, src_b;
src_a.upload(a);
src_b.upload(b);
......@@ -35,16 +33,12 @@ cv::Mat MultiplyTwoArrays(const cv::Mat &a, const cv::Mat &b)
mul.download(result_host);
return result_host;
*/
}
//-----------------------------------------------------------------------------
cv::Mat GpuThreshold(const cv::Mat &input)
{
return input;
/*
cv::cuda::GpuMat dst, src;
src.upload(input);
......@@ -54,15 +48,12 @@ cv::Mat GpuThreshold(const cv::Mat &input)
dst.download(result_host);
return result_host;
*/
}
//-----------------------------------------------------------------------------
void PrintCudaDeviceInfo()
{
return;
/*
int deviceCount = cv::cuda::getCudaEnabledDeviceCount();
if (deviceCount == 0)
{
......@@ -72,7 +63,6 @@ void PrintCudaDeviceInfo()
{
cv::cuda::printCudaDeviceInfo(0);
}
*/
}
} // namespace sks
\ No newline at end of file
......@@ -7,9 +7,8 @@ import pytest
def test_gpu_thershold():
img = cv2.imread('Testing/Data/thresholding/planes-input.png', cv2.IMREAD_GRAYSCALE)
assert True
#gpu_output = skgpu.gpu_threshold(img)
#gpu_output_uint8 = gpu_output.astype(np.uint8)
gpu_output = skgpu.gpu_threshold(img)
gpu_output_uint8 = gpu_output.astype(np.uint8)
#expected = cv2.imread('Testing/Data/thresholding/planes-thresholded.png', cv2.IMREAD_GRAYSCALE)
#assert np.array_equal(gpu_output_uint8, expected)
expected = cv2.imread('Testing/Data/thresholding/planes-thresholded.png', cv2.IMREAD_GRAYSCALE)
assert np.array_equal(gpu_output_uint8, expected)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment