Commit 9eea9835 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

switched to Input/Output Array in Color Processing

parent 6d1ec452
...@@ -57,7 +57,7 @@ namespace cv { namespace gpu { ...@@ -57,7 +57,7 @@ namespace cv { namespace gpu {
/////////////////////////// Color Processing /////////////////////////// /////////////////////////// Color Processing ///////////////////////////
//! converts image from one color space to another //! converts image from one color space to another
CV_EXPORTS void cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn = 0, Stream& stream = Stream::Null()); CV_EXPORTS void cvtColor(InputArray src, OutputArray dst, int code, int dcn = 0, Stream& stream = Stream::Null());
enum enum
{ {
...@@ -77,24 +77,24 @@ enum ...@@ -77,24 +77,24 @@ enum
COLOR_BayerRG2GRAY_MHT = 262, COLOR_BayerRG2GRAY_MHT = 262,
COLOR_BayerGR2GRAY_MHT = 263 COLOR_BayerGR2GRAY_MHT = 263
}; };
CV_EXPORTS void demosaicing(const GpuMat& src, GpuMat& dst, int code, int dcn = -1, Stream& stream = Stream::Null()); CV_EXPORTS void demosaicing(InputArray src, OutputArray dst, int code, int dcn = -1, Stream& stream = Stream::Null());
//! swap channels //! swap channels
//! dstOrder - Integer array describing how channel values are permutated. The n-th entry //! dstOrder - Integer array describing how channel values are permutated. The n-th entry
//! of the array contains the number of the channel that is stored in the n-th channel of //! of the array contains the number of the channel that is stored in the n-th channel of
//! the output image. E.g. Given an RGBA image, aDstOrder = [3,2,1,0] converts this to ABGR //! the output image. E.g. Given an RGBA image, aDstOrder = [3,2,1,0] converts this to ABGR
//! channel order. //! channel order.
CV_EXPORTS void swapChannels(GpuMat& image, const int dstOrder[4], Stream& stream = Stream::Null()); CV_EXPORTS void swapChannels(InputOutputArray image, const int dstOrder[4], Stream& stream = Stream::Null());
//! Routines for correcting image color gamma //! Routines for correcting image color gamma
CV_EXPORTS void gammaCorrection(const GpuMat& src, GpuMat& dst, bool forward = true, Stream& stream = Stream::Null()); CV_EXPORTS void gammaCorrection(InputArray src, OutputArray dst, bool forward = true, Stream& stream = Stream::Null());
enum { ALPHA_OVER, ALPHA_IN, ALPHA_OUT, ALPHA_ATOP, ALPHA_XOR, ALPHA_PLUS, ALPHA_OVER_PREMUL, ALPHA_IN_PREMUL, ALPHA_OUT_PREMUL, enum { ALPHA_OVER, ALPHA_IN, ALPHA_OUT, ALPHA_ATOP, ALPHA_XOR, ALPHA_PLUS, ALPHA_OVER_PREMUL, ALPHA_IN_PREMUL, ALPHA_OUT_PREMUL,
ALPHA_ATOP_PREMUL, ALPHA_XOR_PREMUL, ALPHA_PLUS_PREMUL, ALPHA_PREMUL}; ALPHA_ATOP_PREMUL, ALPHA_XOR_PREMUL, ALPHA_PLUS_PREMUL, ALPHA_PREMUL};
//! Composite two images using alpha opacity values contained in each image //! Composite two images using alpha opacity values contained in each image
//! Supports CV_8UC4, CV_16UC4, CV_32SC4 and CV_32FC4 types //! Supports CV_8UC4, CV_16UC4, CV_32SC4 and CV_32FC4 types
CV_EXPORTS void alphaComp(const GpuMat& img1, const GpuMat& img2, GpuMat& dst, int alpha_op, Stream& stream = Stream::Null()); CV_EXPORTS void alphaComp(InputArray img1, InputArray img2, OutputArray dst, int alpha_op, Stream& stream = Stream::Null());
////////////////////////////// Histogram /////////////////////////////// ////////////////////////////// Histogram ///////////////////////////////
......
This diff is collapsed.
...@@ -94,7 +94,7 @@ void cv::gpu::createOpticalFlowNeedleMap(const GpuMat& u, const GpuMat& v, GpuMa ...@@ -94,7 +94,7 @@ void cv::gpu::createOpticalFlowNeedleMap(const GpuMat& u, const GpuMat& v, GpuMa
CreateOpticalFlowNeedleMap_gpu(u_avg, v_avg, vertex.ptr<float>(), colors.ptr<float>(), max_flow, 1.0f / u.cols, 1.0f / u.rows); CreateOpticalFlowNeedleMap_gpu(u_avg, v_avg, vertex.ptr<float>(), colors.ptr<float>(), max_flow, 1.0f / u.cols, 1.0f / u.rows);
cvtColor(colors, colors, COLOR_HSV2RGB); gpu::cvtColor(colors, colors, COLOR_HSV2RGB);
} }
#endif /* HAVE_CUDA */ #endif /* HAVE_CUDA */
...@@ -169,7 +169,7 @@ namespace ...@@ -169,7 +169,7 @@ namespace
break; break;
default: default:
cvtColor(src, dst, code, cn); cv::cvtColor(src, dst, code, cn);
break; break;
} }
} }
......
...@@ -85,8 +85,8 @@ int main(int argc, const char* argv[]) ...@@ -85,8 +85,8 @@ int main(int argc, const char* argv[])
Mat frame0Gray, frame1Gray; Mat frame0Gray, frame1Gray;
cvtColor(frame0Color, frame0Gray, COLOR_BGR2GRAY); cv::cvtColor(frame0Color, frame0Gray, COLOR_BGR2GRAY);
cvtColor(frame1Color, frame1Gray, COLOR_BGR2GRAY); cv::cvtColor(frame1Color, frame1Gray, COLOR_BGR2GRAY);
GpuMat d_frame0(frame0Gray); GpuMat d_frame0(frame0Gray);
GpuMat d_frame1(frame1Gray); GpuMat d_frame1(frame1Gray);
......
...@@ -294,7 +294,7 @@ int main(int argc, const char *argv[]) ...@@ -294,7 +294,7 @@ int main(int argc, const char *argv[])
} }
cout << endl; cout << endl;
cvtColor(resized_cpu, frameDisp, COLOR_GRAY2BGR); cv::cvtColor(resized_cpu, frameDisp, COLOR_GRAY2BGR);
displayState(frameDisp, helpScreen, useGPU, findLargestObject, filterRects, fps); displayState(frameDisp, helpScreen, useGPU, findLargestObject, filterRects, fps);
imshow("result", frameDisp); imshow("result", frameDisp);
......
...@@ -181,7 +181,7 @@ int main(int argc, const char* argv[]) ...@@ -181,7 +181,7 @@ int main(int argc, const char* argv[])
cout << "Detection time : " << tm.getTimeMilli() << " ms" << endl; cout << "Detection time : " << tm.getTimeMilli() << " ms" << endl;
Mat out; Mat out;
cvtColor(image, out, COLOR_GRAY2BGR); cv::cvtColor(image, out, COLOR_GRAY2BGR);
for (size_t i = 0; i < position.size(); ++i) for (size_t i = 0; i < position.size(); ++i)
{ {
......
...@@ -34,7 +34,7 @@ int main(int argc, const char* argv[]) ...@@ -34,7 +34,7 @@ int main(int argc, const char* argv[])
Canny(src, mask, 100, 200, 3); Canny(src, mask, 100, 200, 3);
Mat dst_cpu; Mat dst_cpu;
cvtColor(mask, dst_cpu, COLOR_GRAY2BGR); cv::cvtColor(mask, dst_cpu, COLOR_GRAY2BGR);
Mat dst_gpu = dst_cpu.clone(); Mat dst_gpu = dst_cpu.clone();
vector<Vec4i> lines_cpu; vector<Vec4i> lines_cpu;
......
...@@ -170,9 +170,9 @@ int main(int argc, const char* argv[]) ...@@ -170,9 +170,9 @@ int main(int argc, const char* argv[])
cout << endl; cout << endl;
Mat frame0Gray; Mat frame0Gray;
cvtColor(frame0, frame0Gray, COLOR_BGR2GRAY); cv::cvtColor(frame0, frame0Gray, COLOR_BGR2GRAY);
Mat frame1Gray; Mat frame1Gray;
cvtColor(frame1, frame1Gray, COLOR_BGR2GRAY); cv::cvtColor(frame1, frame1Gray, COLOR_BGR2GRAY);
// goodFeaturesToTrack // goodFeaturesToTrack
......
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