資源簡(jiǎn)介
通過把picturebox句柄傳進(jìn)去,調(diào)用。接口非托管-托管整數(shù)類型輸入輸出可以,string類型不行(需要轉(zhuǎn)換,未完成)。
代碼片段和文件信息
//?stoame.cpp?:?定義?DLL?應(yīng)用程序的導(dǎo)出函數(shù)。
//
#include“stdafx.h“
#include
#include
#include
#include
#include
#include
#include?
#include?
#include?
//using?namespace?cv;
//using?namespace?std
extern?“C“?_declspec(dllexport)?int?Run(HWND?hWndDisplay)
{
//char?szapipath[MAX_PATH];
?//???memset(szapipath0MAX_PATH);
?//???GetModuleFileNameA(NULLszapipathMAX_PATH);
//(strrchr(szapipath‘\\‘))[0]?=?0;?
//
????
cv::Mat?srcImage?=?cv::imread(“C:\\1.png“1);
//cv::string?path?=?“C:\\Image?Processing?Test\\Image?Proc?Test?02“;
double?start?=?static_cast(cv::getTickCount());
//cv::Mat?srcImage?=?cv::imread(“C:\\1.png“1);
cv::Mat?midImage;
//imshow(“1“srcImage);
cv::cvtColor(srcImage?midImage?CV_BGR2GRAY);
GaussianBlur(midImage?midImage?cv::Size(5?5)?2?2);
cv::Mat?xldimage;
cv::vector>?contours;
cv::vector?hierarchy;
Canny(midImagexldimage702553);
//imshow(“2“xldimage);
//cv::vectorcircles;
findContours(xldimagecontourshierarchyCV_RETR_LISTCV_CHAIN_APPROX_NONEcv::Point());
for(int?i=0;i<(int)contours
評(píng)論
共有 條評(píng)論