#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Opt("MustDeclareVars", 1) #include "emgucv-autoit-bindings\cve_extra.au3" _OpenCV_DLLOpen("libemgucv-windesktop-4.5.3.4721\libs\x64\cvextern.dll") Local $img_scene = _cveImreadAndCheck("cards.jpg", $CV_IMREAD_COLOR) ; query image - scene Local $gray_scene = _cveMatCreate() _cveCvtColorMat($img_scene, $gray_scene, $CV_COLOR_BGR2GRAY) Local $Gaus_scene = _cveMatCreate() _cveGaussianBlurMat($gray_scene, $Gaus_scene, _cvSize(3,3), 0, 0) _cveThresholdMat($Gaus_scene, $Gaus_scene, 200, 255, $CV_THRESH_BINARY) Local $contoursVect = _VectorOfVectorOfPointCreate() Local $contours = _cveOutputArrayFromVectorOfVectorOfPoint($contoursVect) Local $hierarchyMat = _cveMatCreate() Local $hierarchy = _cveOutputArrayFromMat($hierarchyMat) Local $io_arr_Gaus_scene = _cveInputOutputArrayFromMat($Gaus_scene) _cveFindContours($io_arr_Gaus_scene, $contours, $hierarchy, $CV_RETR_EXTERNAL, $CV_CHAIN_APPROX_SIMPLE) Local $cnts = _VectorOfVectorOfPointGetSize($contoursVect) ConsoleWrite("Found " & $cnts & " countours" & @CRLF & @CRLF) Local $tVectorPointPtr = DllStructCreate("ptr value") Local $tPointPtr = DllStructCreate("ptr value") Local $tPoint For $i = 0 To _VectorOfVectorOfPointGetSize($contoursVect) - 1 _VectorOfVectorOfPointGetItemPtr($contoursVect, $i, $tVectorPointPtr) For $j = 0 To _VectorOfPointGetSize($tVectorPointPtr.value) - 1 _VectorOfPointGetItemPtr($tVectorPointPtr.value, $j, $tPointPtr) $tPoint = DllStructCreate($tagCvPoint, $tPointPtr.value) ConsoleWrite("$cnts[" & $i & "][" & $j & "] = (" & $tPoint.x & ", " & $tPoint.y & ")" & @CRLF) Next ConsoleWrite(@CRLF) Next _cveImshowMat("", $Gaus_scene) _cveWaitKey() _cveDestroyAllWindows() _Opencv_DLLClose()