mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge pull request #18516 from anna-khakimova:ak/bgr2rgb
GAPI: Addition new Color conversion kernels to CPU backend. * Add BGR2RGB kernel to CPU backend * Add BGR2I420 and RGB2I420 kernels to CPU backend * Add I4202BGR and I4202RGB kernels to CPU backend
This commit is contained in:
@@ -115,6 +115,11 @@ cv::GArray<cv::Point2f> goodFeaturesToTrack(const GMat& image, int maxCorners, d
|
||||
useHarrisDetector, k);
|
||||
}
|
||||
|
||||
GMat BGR2RGB(const GMat& src)
|
||||
{
|
||||
return imgproc::GBGR2RGB::on(src);
|
||||
}
|
||||
|
||||
GMat RGB2Gray(const GMat& src)
|
||||
{
|
||||
return imgproc::GRGB2Gray::on(src);
|
||||
@@ -160,6 +165,26 @@ GMat YUV2RGB(const GMat& src)
|
||||
return imgproc::GYUV2RGB::on(src);
|
||||
}
|
||||
|
||||
GMat BGR2I420(const GMat& src)
|
||||
{
|
||||
return imgproc::GBGR2I420::on(src);
|
||||
}
|
||||
|
||||
GMat RGB2I420(const GMat& src)
|
||||
{
|
||||
return imgproc::GRGB2I420::on(src);
|
||||
}
|
||||
|
||||
GMat I4202BGR(const GMat& src)
|
||||
{
|
||||
return imgproc::GI4202BGR::on(src);
|
||||
}
|
||||
|
||||
GMat I4202RGB(const GMat& src)
|
||||
{
|
||||
return imgproc::GI4202RGB::on(src);
|
||||
}
|
||||
|
||||
GMat NV12toRGB(const GMat& src_y, const GMat& src_uv)
|
||||
{
|
||||
return imgproc::GNV12toRGB::on(src_y, src_uv);
|
||||
|
||||
@@ -211,6 +211,46 @@ GAPI_OCV_KERNEL(GCPUGoodFeatures, cv::gapi::imgproc::GGoodFeatures)
|
||||
}
|
||||
};
|
||||
|
||||
GAPI_OCV_KERNEL(GCPUBGR2RGB, cv::gapi::imgproc::GBGR2RGB)
|
||||
{
|
||||
static void run(const cv::Mat& in, cv::Mat &out)
|
||||
{
|
||||
cv::cvtColor(in, out, cv::COLOR_BGR2RGB);
|
||||
}
|
||||
};
|
||||
|
||||
GAPI_OCV_KERNEL(GCPUBGR2I420, cv::gapi::imgproc::GBGR2I420)
|
||||
{
|
||||
static void run(const cv::Mat& in, cv::Mat &out)
|
||||
{
|
||||
cv::cvtColor(in, out, cv::COLOR_BGR2YUV_I420);
|
||||
}
|
||||
};
|
||||
|
||||
GAPI_OCV_KERNEL(GCPURGB2I420, cv::gapi::imgproc::GRGB2I420)
|
||||
{
|
||||
static void run(const cv::Mat& in, cv::Mat &out)
|
||||
{
|
||||
cv::cvtColor(in, out, cv::COLOR_RGB2YUV_I420);
|
||||
}
|
||||
};
|
||||
|
||||
GAPI_OCV_KERNEL(GCPUI4202BGR, cv::gapi::imgproc::GI4202BGR)
|
||||
{
|
||||
static void run(const cv::Mat& in, cv::Mat &out)
|
||||
{
|
||||
cv::cvtColor(in, out, cv::COLOR_YUV2BGR_I420);
|
||||
}
|
||||
};
|
||||
|
||||
GAPI_OCV_KERNEL(GCPUI4202RGB, cv::gapi::imgproc::GI4202RGB)
|
||||
{
|
||||
static void run(const cv::Mat& in, cv::Mat &out)
|
||||
{
|
||||
cv::cvtColor(in, out, cv::COLOR_YUV2RGB_I420);
|
||||
}
|
||||
};
|
||||
|
||||
GAPI_OCV_KERNEL(GCPURGB2YUV, cv::gapi::imgproc::GRGB2YUV)
|
||||
{
|
||||
static void run(const cv::Mat& in, cv::Mat &out)
|
||||
@@ -445,8 +485,13 @@ cv::gapi::GKernelPackage cv::gapi::imgproc::cpu::kernels()
|
||||
, GCPUCanny
|
||||
, GCPUGoodFeatures
|
||||
, GCPUEqualizeHist
|
||||
, GCPUBGR2RGB
|
||||
, GCPURGB2YUV
|
||||
, GCPUYUV2RGB
|
||||
, GCPUBGR2I420
|
||||
, GCPURGB2I420
|
||||
, GCPUI4202BGR
|
||||
, GCPUI4202RGB
|
||||
, GCPUNV12toRGB
|
||||
, GCPUNV12toBGR
|
||||
, GCPURGB2Lab
|
||||
|
||||
Reference in New Issue
Block a user