cv.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. // cv.cpp : 定义 DLL 的导出函数。
  2. //
  3. #include "stdafx.h"
  4. #include "framework.h"
  5. #include "cv.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #endif
  9. #ifdef _DEBUG
  10. extern void test();
  11. #endif
  12. // 唯一的应用程序对象
  13. CWinApp theApp;
  14. using namespace std;
  15. int main()
  16. {
  17. int nRetCode = 0;
  18. HMODULE hModule = ::GetModuleHandle(nullptr);
  19. if (hModule != nullptr)
  20. {
  21. // 初始化 MFC 并在失败时显示错误
  22. if (!AfxWinInit(hModule, nullptr, ::GetCommandLine(), 0))
  23. {
  24. // TODO: 在此处为应用程序的行为编写代码。
  25. _tprintf(_T("错误: MFC 初始化失败\n"));
  26. nRetCode = 1;
  27. }
  28. else
  29. {
  30. // TODO: 在此处为应用程序的行为编写代码。
  31. #ifdef _DEBUG
  32. test();
  33. #endif
  34. }
  35. }
  36. else
  37. {
  38. // TODO: 更改错误代码以符合需要
  39. _tprintf(_T("错误: GetModuleHandle 失败\n"));
  40. nRetCode = 1;
  41. }
  42. return nRetCode;
  43. }
  44. CV_API bool ReadImage(std::string strImgPath, cv::Mat& img)
  45. {
  46. // 参数有效性判断;
  47. if (!PathFileExists(strImgPath.c_str())) {
  48. #ifdef _DEBUG
  49. OutputDebugString("参数无效!");
  50. #endif
  51. return false;
  52. }
  53. // 以BGR三通道方式读取图片;
  54. img = cv::imread(strImgPath.c_str(), cv::IMREAD_COLOR);
  55. // 判断图片是否为空;
  56. if (img.empty()) {
  57. #ifdef _DEBUG
  58. OutputDebugString("读取图片失败!");
  59. #endif
  60. return false;
  61. }
  62. return true;
  63. }
  64. CV_API bool GetBinaryImage(std::string strImgPath, long nThresholdVal, long nMaxThresholdVal, cv::Mat& thresholdImg)
  65. {
  66. cv::Mat img;
  67. // 读取图片;
  68. if (!ReadImage(strImgPath, img))
  69. return false;
  70. cv::Mat grayImg;
  71. // 转成灰阶图;
  72. cv::cvtColor(img, grayImg, cv::COLOR_BGR2GRAY);
  73. // 释放对象;
  74. img.release();
  75. cv::Mat gaussImg;
  76. // 再高斯模糊处理(滤波);
  77. cv::GaussianBlur(grayImg, gaussImg, cv::Size(5, 5), 0, 0);
  78. // 释放对象;
  79. grayImg.release();
  80. // 全局化指定的阀值与返回值相等;
  81. cv::threshold(gaussImg, thresholdImg, nThresholdVal, nMaxThresholdVal, cv::THRESH_BINARY);
  82. // 释放对象;
  83. gaussImg.release();
  84. // 判断图片是否空;
  85. if (thresholdImg.empty())
  86. return false;
  87. return true;
  88. }
  89. CV_API bool GetOTSUBinaryImage(std::string strImgPath, long nThresholdVal, long nMaxThresholdVal, cv::Mat& thresholdImg)
  90. {
  91. cv::Mat img;
  92. // 读取图片;
  93. if (!ReadImage(strImgPath, img))
  94. return false;
  95. cv::Mat grayImg;
  96. // 转成灰阶图;
  97. cv::cvtColor(img, grayImg, cv::COLOR_BGR2GRAY);
  98. // 释放对象;
  99. img.release();
  100. cv::Mat gaussImg;
  101. // 再高斯模糊处理(滤波);
  102. cv::GaussianBlur(grayImg, gaussImg, cv::Size(5, 5), 0, 0);
  103. // 释放对象;
  104. grayImg.release();
  105. // OTSU,此时参数3可随意设置;
  106. cv::threshold(gaussImg, thresholdImg, nThresholdVal, nMaxThresholdVal, cv::THRESH_BINARY | cv::THRESH_OTSU);
  107. // 释放对象;
  108. gaussImg.release();
  109. // 判断图片是否空;
  110. if (thresholdImg.empty())
  111. return false;
  112. return true;
  113. }
  114. CV_API bool GetAdaptiveBinaryImage(std::string strImgPath, long nMaxThresholdVal, cv::Mat& thresholdImg)
  115. {
  116. cv::Mat img;
  117. // 读取图片;
  118. if (!ReadImage(strImgPath, img))
  119. return false;
  120. cv::Mat grayImg;
  121. // 转成灰阶图;
  122. cv::cvtColor(img, grayImg, cv::COLOR_BGR2GRAY);
  123. // 释放对象;
  124. img.release();
  125. cv::Mat gaussImg;
  126. // 再高斯模糊处理(滤波);
  127. cv::GaussianBlur(grayImg, gaussImg, cv::Size(5, 5), 0, 0);
  128. // 释放对象;
  129. grayImg.release();
  130. cv::Mat blurImg;
  131. // 自适应阀值;
  132. cv::medianBlur(gaussImg, blurImg, 3);
  133. // 释放对象;
  134. gaussImg.release();
  135. // 局部二值化;//blocksize一般取3、5、7
  136. cv::adaptiveThreshold(blurImg, thresholdImg, nMaxThresholdVal, cv::ADAPTIVE_THRESH_MEAN_C, cv::THRESH_BINARY, 3, 4.5);
  137. // 释放对象;
  138. blurImg.release();
  139. // 判断图片是否空;
  140. if (thresholdImg.empty())
  141. return false;
  142. return true;
  143. }
  144. CV_API bool GaussianBlur(cv::Mat& img, cv::Size cvSize, cv::Mat& gaussImg)
  145. {
  146. if (img.empty())
  147. return false;
  148. // 再高斯模糊处理(滤波);
  149. cv::GaussianBlur(img, gaussImg, cvSize, 0, 0);
  150. // 判断图片是否空;
  151. if (gaussImg.empty())
  152. return false;
  153. return true;
  154. }
  155. CV_API bool GaussianBlur(std::string strImgPath, cv::Size cvSize, cv::Mat& gaussImg)
  156. {
  157. cv::Mat img;
  158. // 读取图片;
  159. if (!ReadImage(strImgPath, img))
  160. return false;
  161. // 再高斯模糊处理(滤波);
  162. cv::GaussianBlur(img, gaussImg, cvSize, 0, 0);
  163. // 判断图片是否空;
  164. if (gaussImg.empty())
  165. return false;
  166. return true;
  167. }
  168. CV_API bool Color2Gray(cv::Mat& img, cv::Mat& grayImg)
  169. {
  170. if (img.empty())
  171. return false;
  172. // 再高斯模糊处理(滤波);
  173. cv::cvtColor(img, grayImg, cv::COLOR_BGR2GRAY);
  174. // 判断图片是否空;
  175. if (grayImg.empty())
  176. return false;
  177. return true;
  178. }
  179. CV_API bool Color2Gray(std::string strImgPath, cv::Mat& grayImg)
  180. {
  181. cv::Mat img;
  182. // 读取图片;
  183. if (!ReadImage(strImgPath, img))
  184. return false;
  185. // 再高斯模糊处理(滤波);
  186. cv::cvtColor(img, grayImg, cv::COLOR_BGR2GRAY);
  187. // 判断图片是否空;
  188. if (grayImg.empty())
  189. return false;
  190. return true;
  191. }
  192. CV_API bool Gray2Color(cv::Mat& img, cv::Mat& colorImg)
  193. {
  194. if (img.empty())
  195. return false;
  196. // 再高斯模糊处理(滤波);
  197. cv::cvtColor(img, colorImg, cv::COLOR_GRAY2BGR);
  198. // 判断图片是否空;
  199. if (colorImg.empty())
  200. return false;
  201. return true;
  202. }
  203. CV_API bool ErodeImg(cv::Mat& img, cv::MorphShapes kernelShape, cv::Size kernelSize, cv::Mat& erodeImg)
  204. {
  205. if (img.empty())
  206. return false;
  207. // 获取自定义核(核形状:矩形MORPH_RECT、十字架CROSS、椭圆ELLIPSE )
  208. cv::Mat element = cv::getStructuringElement(kernelShape, kernelSize);
  209. // 再高斯模糊处理(滤波);
  210. cv::erode(img, erodeImg, element);
  211. // 判断图片是否空;
  212. if (erodeImg.empty())
  213. return false;
  214. return true;
  215. }
  216. CV_API bool DilateImg(cv::Mat& img, cv::MorphShapes kernelShape, cv::Size kernelSize, cv::Mat& dilateImg)
  217. {
  218. if (img.empty())
  219. return false;
  220. // 获取自定义核(核形状:矩形MORPH_RECT、十字架CROSS、椭圆ELLIPSE )
  221. cv::Mat element = cv::getStructuringElement(kernelShape, kernelSize);
  222. // 再高斯模糊处理(滤波);
  223. cv::dilate(img, dilateImg, element);
  224. // 判断图片是否空;
  225. if (dilateImg.empty())
  226. return false;
  227. return true;
  228. }
  229. CV_API bool CutPictures(cv::Mat& img, cv::Rect cvRect, cv::Mat& roiImg)
  230. {
  231. if (img.empty())
  232. return false;
  233. if (cvRect.empty())
  234. return false;
  235. // 裁剪ROI区域;
  236. roiImg = img(cvRect);
  237. // 判断图片是否空;
  238. if (roiImg.empty())
  239. return false;
  240. return true;
  241. }
  242. CV_API bool CutPictures(std::string strImgPath, cv::Rect cvRect, cv::Mat& roiImg)
  243. {
  244. cv::Mat img;
  245. // 读取图片;
  246. if (!ReadImage(strImgPath, img))
  247. return false;
  248. if (cvRect.empty())
  249. return false;
  250. // 裁剪ROI区域;
  251. roiImg = img(cvRect);
  252. // 释放原图;
  253. img.release();
  254. // 判断图片是否空;
  255. if (roiImg.empty())
  256. return false;
  257. return true;
  258. }
  259. CV_API bool CutPictures(std::string strImgPath, cv::Rect cvRect, std::string strRoiImgPath)
  260. {
  261. cv::Mat img;
  262. // 读取图片;
  263. if (!ReadImage(strImgPath, img))
  264. return false;
  265. if (cvRect.empty())
  266. return false;
  267. cv::Mat roiImg;
  268. // 裁剪ROI区域;
  269. roiImg = img(cvRect);
  270. // 释放原图;
  271. img.release();
  272. // 判断图片是否空;
  273. if (roiImg.empty())
  274. return false;
  275. cv::imwrite(strRoiImgPath.c_str(), roiImg);
  276. roiImg.release();
  277. return true;
  278. }
  279. CV_API bool DrawContours(cv::Mat& binImg, cv::Mat& drawImg, bool InternalContour, bool bPerimeter, long nMinPerimeter, long nMaxPerimeter, bool bArea, long nMinArea, long nMaxArea)
  280. {
  281. // 图片空或都不是单通道;
  282. if (binImg.empty() || binImg.channels() > 1)
  283. return false;
  284. if (drawImg.empty()) {
  285. // 复制到目标中;
  286. binImg.copyTo(drawImg);
  287. // 再转为BGR;
  288. cv::cvtColor(drawImg, drawImg, cv::COLOR_GRAY2BGR);
  289. }
  290. // 轮廓;
  291. vector<vector<cv::Point>> contours;
  292. // 轮廓关系;
  293. vector<cv::Vec4i> hierarchy;
  294. // 获取轮廓区域;
  295. if (InternalContour)
  296. {
  297. // 所有轮廓,内外轮廓分等级;
  298. findContours(binImg, contours, hierarchy, cv::RETR_CCOMP, cv::CHAIN_APPROX_SIMPLE);
  299. // 所有轮廓,内外轮廓不分等级,独立;
  300. //findContours(m_ImgThreshold, m_contours, m_hierarchy, cv::RETR_LIST, cv::CHAIN_APPROX_SIMPLE);
  301. }
  302. else
  303. {
  304. // RETR_EXTERNAL=只检索最外面的轮廓;
  305. findContours(binImg, contours, hierarchy, cv::RETR_EXTERNAL, cv::CHAIN_APPROX_SIMPLE);
  306. }
  307. vector<vector<cv::Point>>::iterator it = contours.begin();
  308. for (int i = 0; it != contours.end(); it++, i++)
  309. {
  310. if (bPerimeter && !bArea)
  311. {
  312. if (arcLength(*it, true) < nMinPerimeter || arcLength(*it, true) > nMaxPerimeter)
  313. continue;
  314. }
  315. else if (!bPerimeter && bArea)
  316. {
  317. if (contourArea(*it) < nMinArea || contourArea(*it) > nMaxArea)
  318. continue;
  319. }
  320. else if (bArea && bPerimeter)
  321. {
  322. if ((arcLength(*it, true) < nMinPerimeter || arcLength(*it, true) > nMaxPerimeter) || (contourArea(*it) < nMinArea || contourArea(*it) > nMaxArea))
  323. continue;
  324. }
  325. // 随机色填充轮廓;
  326. cv::Scalar color = cv::Scalar(rand() % 255, rand() % 255, rand() % 255);
  327. // 输出轮廓图;
  328. cv::drawContours(drawImg, contours, i, color, cv::FILLED, 8, hierarchy);
  329. }
  330. if (drawImg.empty())
  331. return false;
  332. return true;
  333. }
  334. CV_API bool MatchSingleImage(cv::Mat& img, cv::Mat templImg, double& matchVal, cv::Rect& matchRect)
  335. {
  336. if (img.empty() || templImg.empty())
  337. return false;
  338. /*
  339. 模板匹配的匹配方式:
  340. 0:CV_TM_SQDIFF 平方差匹配法:最好匹配为0。 匹配越差,匹配值越大。
  341. 这类方法利用图像与模板各个像素差值的平方和来进行匹配,最好匹配为 0。 匹配越差,匹配值越大。
  342. 1:CV_TM_SQDIFF_NORMED 归一化平方差匹配法:最好匹配为0。 匹配越差,匹配值越大。
  343. 这个方法其实和差值平方和算法是类似的。只不过对图像和模板进行了标准化操作
  344. 2:CV_TM_CCORR 相关匹配法:0最差匹配,越接近1越完美;
  345. 这类方法采用模板和图像的互相关计算作为相似度的度量方法,所以较大的数表示匹配程度较高,0标识最坏的匹配效果。
  346. 3:CV_TM_CCORR_NORMED 归一化相关匹配法:0最差匹配,越接近1越完美;
  347. 这个方法和 标准化差值平方和匹配 类似,都是去除了亮度线性变化对相似度计算的影响。可以保证图像和模板同时变亮或变暗k倍时结果不变。
  348. 4:CV_TM_CCOEFF 相关系数匹配法:1表示完美的匹配;-1表示最差的匹配。
  349. 这种方法也叫做相关匹配,但是和上面的 CV_TM_CCORR 匹配方法还是有不通过的。简单的说,这里是把图像和模板都减去了各自的平均值,使得这两幅图像都没有直流分量
  350. 5:CV_TM_CCOEFF_NORMED 归一化相关系数匹配法:1表示完美的匹配;-1表示最差的匹配。
  351. 这是 OpenCV 支持的最复杂的一种相似度算法。
  352. 这里的相关运算就是数理统计学科的相关系数计算方法。
  353. 具体的说,就是在减去了各自的平均值之外,还要各自除以各自的方差。
  354. 经过减去平均值和除以方差这么两步操作之后,无论是我们的待检图像还是模板都被标准化了,
  355. 这样可以保证图像和模板分别改变光照亮不影响计算结果。计算出的相关系数被限制在了 -1 到 1 之间,
  356. 1 表示完全相同,-1 表示两幅图像的亮度正好相反,0 表示两幅图像之间没有线性关系。
  357. */
  358. cv::Mat resultImg;
  359. cv::matchTemplate(img, templImg, resultImg, cv::TM_CCOEFF_NORMED);
  360. if (resultImg.empty())
  361. return false;
  362. // 最小和最大匹配值;
  363. double lv_nMinVal = 0.0;
  364. double lv_nMaxVal = 0.0;
  365. // 匹配的坐标点;
  366. cv::Point lv_nMinLoc = cv::Point(0, 0);
  367. cv::Point lv_nMaxLoc = cv::Point(0, 0);
  368. cv::minMaxLoc(resultImg, &lv_nMinVal, &lv_nMaxVal, &lv_nMinLoc, &lv_nMaxLoc);
  369. // TM_CCOEFF_NORMED匹配是取最大值为匹配值;
  370. matchVal = lv_nMaxVal;
  371. // 匹配区域,使用最大区域;
  372. matchRect.x = lv_nMaxLoc.x;
  373. matchRect.y = lv_nMaxLoc.y;
  374. matchRect.width = templImg.cols;
  375. matchRect.height = templImg.rows;
  376. #ifdef _DEBUG
  377. // 在原图上框出模板位置;
  378. cv::Mat showImg;
  379. img.copyTo(showImg);
  380. cv::rectangle(showImg,
  381. cv::Point(lv_nMaxLoc.x, lv_nMaxLoc.y),
  382. cv::Point(lv_nMaxLoc.x + templImg.cols, lv_nMaxLoc.y + templImg.rows),
  383. cv::Scalar(rand() % 255, rand() % 255, rand() % 255),
  384. 2,
  385. cv::LINE_AA,
  386. 0);
  387. // 输出到文件中;
  388. imwrite("showImg.png", showImg);
  389. // 释放对象;
  390. showImg.release();
  391. #endif
  392. // 释放对象;
  393. resultImg.release();
  394. return true;
  395. }
  396. CV_API bool MatchSingleImage(cv::Mat& img, std::string strTmpImg, double& matchVal, cv::Rect& matchRect)
  397. {
  398. if (img.empty())
  399. return false;
  400. // 读取模板图片;
  401. cv::Mat templImg = imread(strTmpImg.c_str(), cv::IMREAD_COLOR);
  402. if (templImg.empty()) {
  403. return false;
  404. }
  405. cv::Mat resultImg;
  406. cv::matchTemplate(img, templImg, resultImg, cv::TM_CCOEFF_NORMED);
  407. if (resultImg.empty()) {
  408. templImg.release();
  409. return false;
  410. }
  411. // 最小和最大匹配值;
  412. double lv_nMinVal = 0.0;
  413. double lv_nMaxVal = 0.0;
  414. // 匹配的坐标点;
  415. cv::Point lv_nMinLoc = cv::Point(0, 0);
  416. cv::Point lv_nMaxLoc = cv::Point(0, 0);
  417. cv::minMaxLoc(resultImg, &lv_nMinVal, &lv_nMaxVal, &lv_nMinLoc, &lv_nMaxLoc);
  418. // TM_CCOEFF_NORMED匹配是取最大值为匹配值;
  419. matchVal = lv_nMaxVal;
  420. // 匹配区域,使用最大区域;
  421. matchRect.x = lv_nMaxLoc.x;
  422. matchRect.y = lv_nMaxLoc.y;
  423. matchRect.width = templImg.cols;
  424. matchRect.height = templImg.rows;
  425. #ifdef _DEBUG
  426. // 在原图上框出模板位置;
  427. cv::Mat showImg;
  428. img.copyTo(showImg);
  429. cv::rectangle(showImg,
  430. cv::Point(lv_nMaxLoc.x, lv_nMaxLoc.y),
  431. cv::Point(lv_nMaxLoc.x + templImg.cols, lv_nMaxLoc.y + templImg.rows),
  432. cv::Scalar(rand() % 255, rand() % 255, rand() % 255),
  433. 2,
  434. cv::LINE_AA,
  435. 0);
  436. // 输出到文件中;
  437. imwrite("showImg.png", showImg);
  438. // 释放对象;
  439. showImg.release();
  440. #endif
  441. // 释放对象;
  442. templImg.release();
  443. resultImg.release();
  444. return true;
  445. }
  446. CV_API bool MatchSingleImage(std::string strImg, std::string strTmpImg, double& matchVal, cv::Rect& matchRect)
  447. {
  448. cv::Mat img;
  449. cv::Mat templImg;
  450. if (!ReadImage(strImg.c_str(), img) )
  451. return false;
  452. if (!ReadImage(strTmpImg.c_str(), templImg)) {
  453. img.release();
  454. return false;
  455. }
  456. cv::Mat resultImg;
  457. cv::matchTemplate(img, templImg, resultImg, cv::TM_CCOEFF_NORMED);
  458. if (resultImg.empty()) {
  459. img.release();
  460. templImg.release();
  461. return false;
  462. }
  463. // 最小和最大匹配值;
  464. double lv_nMinVal = 0.0;
  465. double lv_nMaxVal = 0.0;
  466. // 匹配的坐标点;
  467. cv::Point lv_nMinLoc = cv::Point(0, 0);
  468. cv::Point lv_nMaxLoc = cv::Point(0, 0);
  469. cv::minMaxLoc(resultImg, &lv_nMinVal, &lv_nMaxVal, &lv_nMinLoc, &lv_nMaxLoc);
  470. // TM_CCOEFF_NORMED匹配是取最大值为匹配值;
  471. matchVal = lv_nMaxVal;
  472. // 匹配区域,使用最大区域;
  473. matchRect.x = lv_nMaxLoc.x;
  474. matchRect.y = lv_nMaxLoc.y;
  475. matchRect.width = templImg.cols;
  476. matchRect.height = templImg.rows;
  477. #ifdef _DEBUG
  478. // 在原图上框出模板位置;
  479. cv::Mat showImg;
  480. img.copyTo(showImg);
  481. cv::rectangle(showImg,
  482. cv::Point(lv_nMaxLoc.x, lv_nMaxLoc.y),
  483. cv::Point(lv_nMaxLoc.x + templImg.cols, lv_nMaxLoc.y + templImg.rows),
  484. cv::Scalar(rand() % 255, rand() % 255, rand() % 255),
  485. 2,
  486. cv::LINE_AA,
  487. 0);
  488. // 输出到文件中;
  489. imwrite("showImg.png", showImg);
  490. // 释放对象;
  491. showImg.release();
  492. #endif
  493. // 释放对象;
  494. img.release();
  495. templImg.release();
  496. resultImg.release();
  497. return true;
  498. }
  499. CV_API bool Mat2Bitmap(cv::Mat& img, CBitmap& bitmap)
  500. {
  501. return CV_API bool();
  502. }
  503. CV_API bool Mat2HBitmap(cv::Mat& img, HBITMAP& bitmap)
  504. {
  505. //MAT类的TYPE=(nChannels-1+ CV_8U)<<3
  506. int nChannels = (img.type() >> 3) - CV_8U + 1;
  507. int iSize = img.cols * img.rows * nChannels;
  508. bitmap = CreateBitmap(img.cols, img.rows, 1, nChannels * 8, img.data);
  509. return true;
  510. }
  511. CV_API bool Mat2GdiplusBitmap(cv::Mat& img, Gdiplus::Bitmap& bitmap)
  512. {
  513. return CV_API bool();
  514. }
  515. CV_API bool Bitmap2Mat(CBitmap& bitmap, cv::Mat& img)
  516. {
  517. return CV_API bool();
  518. }
  519. CV_API bool HBitmap2Mat(HBITMAP& bitmap, cv::Mat& img)
  520. {
  521. return CV_API bool();
  522. }
  523. CV_API bool GdiplusBitmap2Mat(Gdiplus::Bitmap& bitmap, cv::Mat& img)
  524. {
  525. return CV_API bool();
  526. }