OpenCV (Open source Computer Vision) 是一個開放原始碼的跨平台電腦視覺函式庫, 最早是 Intel 於 1999 年開始研發, 後來以 BSD 授權開源 (可免費做商業應用), 主要用來做即時影像處理與辨識, 支援 Nvidia 的 CUDA 函式庫, 廣泛應用在人臉偵測與物體辨識等領域, 其核心以 C/C++ 開發, 但提供 Python, Java, 以及 MALAB 等主流程式語言之介面, 參考 :
No.1 這本是 OpenCV 專書, 很完整地說明 OpenCV 的用法 (大推), No.2 則較專注於 Linux 環境, 特別是有介紹如何在樹莓派中從 OpenCV 原始碼編譯為 Python 可執行檔的方法 (可使用到 OpenCV 的專利演算法).
一. 本機 Python 執行環境 :
在本機執行 OpenCV 須安裝 opencv-python 套件, 可用 pip install 直接安裝 (約 38.6 MB) :
pip install opencv-python
D:\python\test>pip install opencv-python
Collecting opencv-python
Downloading opencv_python-4.9.0.80-cp37-abi3-win_amd64.whl.metadata (20 kB)
Requirement already satisfied: numpy>=1.21.2 in c:\users\tony1\appdata\roaming\python\python310\site-packages (from opencv-python) (1.24.3)
Downloading opencv_python-4.9.0.80-cp37-abi3-win_amd64.whl (38.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.6/38.6 MB 4.3 MB/s eta 0:00:00
Installing collected packages: opencv-python
Successfully installed opencv-python-4.9.0.80
如果要測試物體追蹤與人臉辨識等進階功能還要安裝 opencv_contrib_python 套件 (約 45.3 MB), 同樣可用 pip install 直接安裝 :
pip install opencv_contrib_python
D:\python\test>pip install opencv_contrib_python
Collecting opencv_contrib_python
Downloading opencv_contrib_python-4.9.0.80-cp37-abi3-win_amd64.whl.metadata (20 kB)
Requirement already satisfied: numpy>=1.21.2 in c:\users\tony1\appdata\roaming\python\python310\site-packages (from opencv_contrib_python) (1.24.3)
Downloading opencv_contrib_python-4.9.0.80-cp37-abi3-win_amd64.whl (45.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.3/45.3 MB 7.8 MB/s eta 0:00:00
Installing collected packages: opencv_contrib_python
Successfully installed opencv_contrib_python-4.9.0.80
注意, 使用 OpenCV 要匯入的模組名稱是 cv2, 例如 :
>>> import cv2
>>> cv2.__version__
'4.9.0'
二. Colab 雲端執行環境 :
谷歌雲端的 Colab 已經預先安裝 OpenCV 可直接使用 (目前版本 v4.8) :
三. 檢視 OpenCV 函式庫內容 :
雖然利用 dir() 就可辦到, 但其輸出不好閱讀, 所以改用自訂的 members.py 模組來做這件事, 它可以過濾出模組或套件裡面有哪些類別或函式 :
# members.py
import inspect
def varname(x):
return [k for k,v in inspect.currentframe().f_back.f_locals.items() if v is x][0]
def list_members(parent_obj):
members=dir(parent_obj)
parent_obj_name=varname(parent_obj)
for mbr in members:
child_obj=eval(parent_obj_name + '.' + mbr)
if not mbr.startswith('_'):
print(mbr, type(child_obj))
只要將上面函式存成 members.py, 然後匯入其 list_members() 函式即可 :
>>> from members import list_members
>>> list_members(cv2)
... (略) ...
absdiff <class 'builtin_function_or_method'>
accumulate <class 'builtin_function_or_method'>
accumulateProduct <class 'builtin_function_or_method'>
accumulateSquare <class 'builtin_function_or_method'>
accumulateWeighted <class 'builtin_function_or_method'>
adaptiveThreshold <class 'builtin_function_or_method'>
add <class 'builtin_function_or_method'>
addText <class 'builtin_function_or_method'>
addWeighted <class 'builtin_function_or_method'>
applyColorMap <class 'builtin_function_or_method'>
approxPolyDP <class 'builtin_function_or_method'>
arcLength <class 'builtin_function_or_method'>
arrowedLine <class 'builtin_function_or_method'>
aruco <class 'module'>
aruco_ArucoDetector <class 'type'>
aruco_Board <class 'type'>
aruco_CharucoBoard <class 'type'>
aruco_CharucoDetector <class 'type'>
aruco_CharucoParameters <class 'type'>
aruco_DetectorParameters <class 'type'>
aruco_Dictionary <class 'type'>
aruco_EstimateParameters <class 'type'>
aruco_GridBoard <class 'type'>
aruco_RefineParameters <class 'type'>
barcode <class 'module'>
barcode_BarcodeDetector <class 'type'>
batchDistance <class 'builtin_function_or_method'>
bgsegm <class 'module'>
bgsegm_BackgroundSubtractorCNT <class 'type'>
bgsegm_BackgroundSubtractorGMG <class 'type'>
bgsegm_BackgroundSubtractorGSOC <class 'type'>
bgsegm_BackgroundSubtractorLSBP <class 'type'>
bgsegm_BackgroundSubtractorLSBPDesc <class 'type'>
bgsegm_BackgroundSubtractorMOG <class 'type'>
bgsegm_SyntheticSequenceGenerator <class 'type'>
bilateralFilter <class 'builtin_function_or_method'>
bioinspired <class 'module'>
bioinspired_Retina <class 'type'>
bioinspired_RetinaFastToneMapping <class 'type'>
bioinspired_TransientAreasSegmentationModule <class 'type'>
bitwise_and <class 'builtin_function_or_method'>
bitwise_not <class 'builtin_function_or_method'>
bitwise_or <class 'builtin_function_or_method'>
bitwise_xor <class 'builtin_function_or_method'>
blendLinear <class 'builtin_function_or_method'>
blur <class 'builtin_function_or_method'>
bootstrap <class 'function'>
borderInterpolate <class 'builtin_function_or_method'>
boundingRect <class 'builtin_function_or_method'>
boxFilter <class 'builtin_function_or_method'>
boxPoints <class 'builtin_function_or_method'>
broadcast <class 'builtin_function_or_method'>
buildOpticalFlowPyramid <class 'builtin_function_or_method'>
calcBackProject <class 'builtin_function_or_method'>
calcCovarMatrix <class 'builtin_function_or_method'>
calcHist <class 'builtin_function_or_method'>
calcOpticalFlowFarneback <class 'builtin_function_or_method'>
calcOpticalFlowPyrLK <class 'builtin_function_or_method'>
calibrateCamera <class 'builtin_function_or_method'>
calibrateCameraExtended <class 'builtin_function_or_method'>
calibrateCameraRO <class 'builtin_function_or_method'>
calibrateCameraROExtended <class 'builtin_function_or_method'>
calibrateHandEye <class 'builtin_function_or_method'>
calibrateRobotWorldHandEye <class 'builtin_function_or_method'>
calibrationMatrixValues <class 'builtin_function_or_method'>
cartToPolar <class 'builtin_function_or_method'>
ccm <class 'module'>
ccm_ColorCorrectionModel <class 'type'>
checkChessboard <class 'builtin_function_or_method'>
checkHardwareSupport <class 'builtin_function_or_method'>
checkRange <class 'builtin_function_or_method'>
circle <class 'builtin_function_or_method'>
clipLine <class 'builtin_function_or_method'>
colorChange <class 'builtin_function_or_method'>
colored_kinfu <class 'module'>
colored_kinfu_ColoredKinFu <class 'type'>
colored_kinfu_Params <class 'type'>
compare <class 'builtin_function_or_method'>
compareHist <class 'builtin_function_or_method'>
completeSymm <class 'builtin_function_or_method'>
composeRT <class 'builtin_function_or_method'>
computeCorrespondEpilines <class 'builtin_function_or_method'>
computeECC <class 'builtin_function_or_method'>
connectedComponents <class 'builtin_function_or_method'>
connectedComponentsWithAlgorithm <class 'builtin_function_or_method'>
connectedComponentsWithStats <class 'builtin_function_or_method'>
connectedComponentsWithStatsWithAlgorithm <class 'builtin_function_or_method'>
contourArea <class 'builtin_function_or_method'>
convertFp16 <class 'builtin_function_or_method'>
convertMaps <class 'builtin_function_or_method'>
convertPointsFromHomogeneous <class 'builtin_function_or_method'>
convertPointsToHomogeneous <class 'builtin_function_or_method'>
convertScaleAbs <class 'builtin_function_or_method'>
convexHull <class 'builtin_function_or_method'>
convexityDefects <class 'builtin_function_or_method'>
copyMakeBorder <class 'builtin_function_or_method'>
copyTo <class 'builtin_function_or_method'>
cornerEigenValsAndVecs <class 'builtin_function_or_method'>
cornerHarris <class 'builtin_function_or_method'>
cornerMinEigenVal <class 'builtin_function_or_method'>
cornerSubPix <class 'builtin_function_or_method'>
correctMatches <class 'builtin_function_or_method'>
countNonZero <class 'builtin_function_or_method'>
createAffineTransformer <class 'builtin_function_or_method'>
createAlignMTB <class 'builtin_function_or_method'>
createBackgroundSubtractorKNN <class 'builtin_function_or_method'>
createBackgroundSubtractorMOG2 <class 'builtin_function_or_method'>
createButton <class 'builtin_function_or_method'>
createCLAHE <class 'builtin_function_or_method'>
createCalibrateDebevec <class 'builtin_function_or_method'>
createCalibrateRobertson <class 'builtin_function_or_method'>
createChiHistogramCostExtractor <class 'builtin_function_or_method'>
createEMDHistogramCostExtractor <class 'builtin_function_or_method'>
createEMDL1HistogramCostExtractor <class 'builtin_function_or_method'>
createGeneralizedHoughBallard <class 'builtin_function_or_method'>
createGeneralizedHoughGuil <class 'builtin_function_or_method'>
createHanningWindow <class 'builtin_function_or_method'>
createHausdorffDistanceExtractor <class 'builtin_function_or_method'>
createLineSegmentDetector <class 'builtin_function_or_method'>
createMergeDebevec <class 'builtin_function_or_method'>
createMergeMertens <class 'builtin_function_or_method'>
createMergeRobertson <class 'builtin_function_or_method'>
createNormHistogramCostExtractor <class 'builtin_function_or_method'>
createShapeContextDistanceExtractor <class 'builtin_function_or_method'>
createThinPlateSplineShapeTransformer <class 'builtin_function_or_method'>
createTonemap <class 'builtin_function_or_method'>
createTonemapDrago <class 'builtin_function_or_method'>
createTonemapMantiuk <class 'builtin_function_or_method'>
createTonemapReinhard <class 'builtin_function_or_method'>
createTrackbar <class 'builtin_function_or_method'>
cubeRoot <class 'builtin_function_or_method'>
cuda <class 'module'>
cuda_BufferPool <class 'type'>
cuda_DeviceInfo <class 'type'>
cuda_Event <class 'type'>
cuda_GpuData <class 'type'>
cuda_GpuMat <class 'type'>
cuda_GpuMatND <class 'type'>
cuda_GpuMat_Allocator <class 'type'>
cuda_HostMem <class 'type'>
cuda_SURF_CUDA <class 'type'>
cuda_Stream <class 'type'>
cuda_TargetArchs <class 'type'>
cvtColor <class 'builtin_function_or_method'>
cvtColorTwoPlane <class 'builtin_function_or_method'>
data <class 'module'>
datasets <class 'module'>
dct <class 'builtin_function_or_method'>
decolor <class 'builtin_function_or_method'>
decomposeEssentialMat <class 'builtin_function_or_method'>
decomposeHomographyMat <class 'builtin_function_or_method'>
decomposeProjectionMatrix <class 'builtin_function_or_method'>
demosaicing <class 'builtin_function_or_method'>
denoise_TVL1 <class 'builtin_function_or_method'>
destroyAllWindows <class 'builtin_function_or_method'>
destroyWindow <class 'builtin_function_or_method'>
detail <class 'module'>
detailEnhance <class 'builtin_function_or_method'>
detail_AffineBasedEstimator <class 'type'>
detail_AffineBestOf2NearestMatcher <class 'type'>
detail_BestOf2NearestMatcher <class 'type'>
detail_BestOf2NearestRangeMatcher <class 'type'>
detail_Blender <class 'type'>
detail_BlocksChannelsCompensator <class 'type'>
detail_BlocksCompensator <class 'type'>
detail_BlocksGainCompensator <class 'type'>
detail_BundleAdjusterAffine <class 'type'>
detail_BundleAdjusterAffinePartial <class 'type'>
detail_BundleAdjusterBase <class 'type'>
detail_BundleAdjusterRay <class 'type'>
detail_BundleAdjusterReproj <class 'type'>
detail_CameraParams <class 'type'>
detail_ChannelsCompensator <class 'type'>
detail_DpSeamFinder <class 'type'>
detail_Estimator <class 'type'>
detail_ExposureCompensator <class 'type'>
detail_FeatherBlender <class 'type'>
detail_FeaturesMatcher <class 'type'>
detail_GainCompensator <class 'type'>
detail_GraphCutSeamFinder <class 'type'>
detail_HomographyBasedEstimator <class 'type'>
detail_ImageFeatures <class 'type'>
detail_MatchesInfo <class 'type'>
detail_MultiBandBlender <class 'type'>
detail_NoBundleAdjuster <class 'type'>
detail_NoExposureCompensator <class 'type'>
detail_NoSeamFinder <class 'type'>
detail_PairwiseSeamFinder <class 'type'>
detail_ProjectorBase <class 'type'>
detail_SeamFinder <class 'type'>
detail_SphericalProjector <class 'type'>
detail_Timelapser <class 'type'>
detail_TimelapserCrop <class 'type'>
detail_VoronoiSeamFinder <class 'type'>
determinant <class 'builtin_function_or_method'>
dft <class 'builtin_function_or_method'>
dilate <class 'builtin_function_or_method'>
displayOverlay <class 'builtin_function_or_method'>
displayStatusBar <class 'builtin_function_or_method'>
distanceTransform <class 'builtin_function_or_method'>
distanceTransformWithLabels <class 'builtin_function_or_method'>
divSpectrums <class 'builtin_function_or_method'>
divide <class 'builtin_function_or_method'>
dnn <class 'module'>
dnn_ClassificationModel <class 'type'>
dnn_DetectionModel <class 'type'>
dnn_DictValue <class 'type'>
dnn_Image2BlobParams <class 'type'>
dnn_KeypointsModel <class 'type'>
dnn_Layer <class 'type'>
dnn_Model <class 'type'>
dnn_Net <class 'type'>
dnn_SegmentationModel <class 'type'>
dnn_TextDetectionModel <class 'type'>
dnn_TextDetectionModel_DB <class 'type'>
dnn_TextDetectionModel_EAST <class 'type'>
dnn_TextRecognitionModel <class 'type'>
dnn_registerLayer <class 'builtin_function_or_method'>
dnn_superres <class 'module'>
dnn_superres_DnnSuperResImpl <class 'type'>
dnn_unregisterLayer <class 'builtin_function_or_method'>
dpm <class 'module'>
dpm_DPMDetector <class 'type'>
dpm_DPMDetector_ObjectDetection <class 'type'>
drawChessboardCorners <class 'builtin_function_or_method'>
drawContours <class 'builtin_function_or_method'>
drawFrameAxes <class 'builtin_function_or_method'>
drawKeypoints <class 'builtin_function_or_method'>
drawMarker <class 'builtin_function_or_method'>
drawMatches <class 'builtin_function_or_method'>
drawMatchesKnn <class 'builtin_function_or_method'>
dynafu <class 'module'>
dynafu_DynaFu <class 'type'>
edgePreservingFilter <class 'builtin_function_or_method'>
eigen <class 'builtin_function_or_method'>
eigenNonSymmetric <class 'builtin_function_or_method'>
ellipse <class 'builtin_function_or_method'>
ellipse2Poly <class 'builtin_function_or_method'>
empty_array_desc <class 'builtin_function_or_method'>
empty_gopaque_desc <class 'builtin_function_or_method'>
empty_scalar_desc <class 'builtin_function_or_method'>
equalizeHist <class 'builtin_function_or_method'>
erode <class 'builtin_function_or_method'>
error <class 'type'>
estimateAffine2D <class 'builtin_function_or_method'>
estimateAffine3D <class 'builtin_function_or_method'>
estimateAffinePartial2D <class 'builtin_function_or_method'>
estimateChessboardSharpness <class 'builtin_function_or_method'>
estimateTranslation3D <class 'builtin_function_or_method'>
exp <class 'builtin_function_or_method'>
extractChannel <class 'builtin_function_or_method'>
face <class 'module'>
face_BIF <class 'type'>
face_BasicFaceRecognizer <class 'type'>
face_EigenFaceRecognizer <class 'type'>
face_FaceRecognizer <class 'type'>
face_Facemark <class 'type'>
face_FacemarkAAM <class 'type'>
face_FacemarkKazemi <class 'type'>
face_FacemarkLBF <class 'type'>
face_FacemarkTrain <class 'type'>
face_FisherFaceRecognizer <class 'type'>
face_LBPHFaceRecognizer <class 'type'>
face_MACE <class 'type'>
face_PredictCollector <class 'type'>
face_StandardCollector <class 'type'>
fastAtan2 <class 'builtin_function_or_method'>
fastNlMeansDenoising <class 'builtin_function_or_method'>
fastNlMeansDenoisingColored <class 'builtin_function_or_method'>
fastNlMeansDenoisingColoredMulti <class 'builtin_function_or_method'>
fastNlMeansDenoisingMulti <class 'builtin_function_or_method'>
fillConvexPoly <class 'builtin_function_or_method'>
fillPoly <class 'builtin_function_or_method'>
filter2D <class 'builtin_function_or_method'>
filterHomographyDecompByVisibleRefpoints <class 'builtin_function_or_method'>
filterSpeckles <class 'builtin_function_or_method'>
find4QuadCornerSubpix <class 'builtin_function_or_method'>
findChessboardCorners <class 'builtin_function_or_method'>
findChessboardCornersSB <class 'builtin_function_or_method'>
findChessboardCornersSBWithMeta <class 'builtin_function_or_method'>
findCirclesGrid <class 'builtin_function_or_method'>
findContours <class 'builtin_function_or_method'>
findEssentialMat <class 'builtin_function_or_method'>
findFundamentalMat <class 'builtin_function_or_method'>
findHomography <class 'builtin_function_or_method'>
findNonZero <class 'builtin_function_or_method'>
findTransformECC <class 'builtin_function_or_method'>
fisheye <class 'module'>
fitEllipse <class 'builtin_function_or_method'>
fitEllipseAMS <class 'builtin_function_or_method'>
fitEllipseDirect <class 'builtin_function_or_method'>
fitLine <class 'builtin_function_or_method'>
flann <class 'module'>
flann_Index <class 'type'>
flip <class 'builtin_function_or_method'>
flipND <class 'builtin_function_or_method'>
floodFill <class 'builtin_function_or_method'>
ft <class 'module'>
gapi <class 'module'>
gapi_GNetPackage <class 'type'>
gapi_GNetParam <class 'type'>
gapi_ie_PyParams <class 'type'>
gapi_onnx_PyParams <class 'type'>
gapi_onnx_ep_CUDA <class 'type'>
gapi_onnx_ep_CoreML <class 'type'>
gapi_onnx_ep_DirectML <class 'type'>
gapi_onnx_ep_OpenVINO <class 'type'>
gapi_onnx_ep_TensorRT <class 'type'>
gapi_ot_ObjectTrackerParams <class 'type'>
gapi_ov_PyParams <class 'type'>
gapi_streaming_queue_capacity <class 'type'>
gapi_wip_GOutputs <class 'type'>
gapi_wip_IStreamSource <class 'type'>
gapi_wip_draw_Circle <class 'type'>
gapi_wip_draw_Image <class 'type'>
gapi_wip_draw_Line <class 'type'>
gapi_wip_draw_Mosaic <class 'type'>
gapi_wip_draw_Poly <class 'type'>
gapi_wip_draw_Rect <class 'type'>
gapi_wip_draw_Text <class 'type'>
gapi_wip_gst_GStreamerPipeline <class 'type'>
gemm <class 'builtin_function_or_method'>
getAffineTransform <class 'builtin_function_or_method'>
getBuildInformation <class 'builtin_function_or_method'>
getCPUFeaturesLine <class 'builtin_function_or_method'>
getCPUTickCount <class 'builtin_function_or_method'>
getDefaultNewCameraMatrix <class 'builtin_function_or_method'>
getDerivKernels <class 'builtin_function_or_method'>
getFontScaleFromHeight <class 'builtin_function_or_method'>
getGaborKernel <class 'builtin_function_or_method'>
getGaussianKernel <class 'builtin_function_or_method'>
getHardwareFeatureName <class 'builtin_function_or_method'>
getLogLevel <class 'builtin_function_or_method'>
getNumThreads <class 'builtin_function_or_method'>
getNumberOfCPUs <class 'builtin_function_or_method'>
getOptimalDFTSize <class 'builtin_function_or_method'>
getOptimalNewCameraMatrix <class 'builtin_function_or_method'>
getPerspectiveTransform <class 'builtin_function_or_method'>
getRectSubPix <class 'builtin_function_or_method'>
getRotationMatrix2D <class 'builtin_function_or_method'>
getStructuringElement <class 'builtin_function_or_method'>
getTextSize <class 'builtin_function_or_method'>
getThreadNum <class 'builtin_function_or_method'>
getTickCount <class 'builtin_function_or_method'>
getTickFrequency <class 'builtin_function_or_method'>
getTrackbarPos <class 'builtin_function_or_method'>
getValidDisparityROI <class 'builtin_function_or_method'>
getVersionMajor <class 'builtin_function_or_method'>
getVersionMinor <class 'builtin_function_or_method'>
getVersionRevision <class 'builtin_function_or_method'>
getVersionString <class 'builtin_function_or_method'>
getWindowImageRect <class 'builtin_function_or_method'>
getWindowProperty <class 'builtin_function_or_method'>
gin <class 'function'>
goodFeaturesToTrack <class 'builtin_function_or_method'>
goodFeaturesToTrackWithQuality <class 'builtin_function_or_method'>
grabCut <class 'builtin_function_or_method'>
groupRectangles <class 'builtin_function_or_method'>
hasNonZero <class 'builtin_function_or_method'>
haveImageReader <class 'builtin_function_or_method'>
haveImageWriter <class 'builtin_function_or_method'>
haveOpenVX <class 'builtin_function_or_method'>
hconcat <class 'builtin_function_or_method'>
hfs <class 'module'>
hfs_HfsSegment <class 'type'>
idct <class 'builtin_function_or_method'>
idft <class 'builtin_function_or_method'>
illuminationChange <class 'builtin_function_or_method'>
imcount <class 'builtin_function_or_method'>
imdecode <class 'builtin_function_or_method'>
imdecodemulti <class 'builtin_function_or_method'>
imencode <class 'builtin_function_or_method'>
img_hash <class 'module'>
img_hash_AverageHash <class 'type'>
img_hash_BlockMeanHash <class 'type'>
img_hash_ColorMomentHash <class 'type'>
img_hash_ImgHashBase <class 'type'>
img_hash_MarrHildrethHash <class 'type'>
img_hash_PHash <class 'type'>
img_hash_RadialVarianceHash <class 'type'>
importlib <class 'module'>
imread <class 'builtin_function_or_method'>
imreadmulti <class 'builtin_function_or_method'>
imshow <class 'builtin_function_or_method'>
imwrite <class 'builtin_function_or_method'>
imwritemulti <class 'builtin_function_or_method'>
inRange <class 'builtin_function_or_method'>
initCameraMatrix2D <class 'builtin_function_or_method'>
initInverseRectificationMap <class 'builtin_function_or_method'>
initUndistortRectifyMap <class 'builtin_function_or_method'>
inpaint <class 'builtin_function_or_method'>
insertChannel <class 'builtin_function_or_method'>
integral <class 'builtin_function_or_method'>
integral2 <class 'builtin_function_or_method'>
integral3 <class 'builtin_function_or_method'>
intensity_transform <class 'module'>
intersectConvexConvex <class 'builtin_function_or_method'>
invert <class 'builtin_function_or_method'>
invertAffineTransform <class 'builtin_function_or_method'>
ipp <class 'module'>
isContourConvex <class 'builtin_function_or_method'>
kinfu <class 'module'>
kinfu_KinFu <class 'type'>
kinfu_Params <class 'type'>
kinfu_Volume <class 'type'>
kinfu_VolumeParams <class 'type'>
kinfu_detail_PoseGraph <class 'type'>
kmeans <class 'builtin_function_or_method'>
large_kinfu <class 'module'>
large_kinfu_LargeKinfu <class 'type'>
large_kinfu_Params <class 'type'>
legacy <class 'module'>
legacy_MultiTracker <class 'type'>
legacy_Tracker <class 'type'>
legacy_TrackerBoosting <class 'type'>
legacy_TrackerCSRT <class 'type'>
legacy_TrackerKCF <class 'type'>
legacy_TrackerMIL <class 'type'>
legacy_TrackerMOSSE <class 'type'>
legacy_TrackerMedianFlow <class 'type'>
legacy_TrackerTLD <class 'type'>
line <class 'builtin_function_or_method'>
line_descriptor <class 'module'>
line_descriptor_BinaryDescriptor <class 'type'>
line_descriptor_BinaryDescriptorMatcher <class 'type'>
line_descriptor_DrawLinesMatchesFlags <class 'type'>
line_descriptor_KeyLine <class 'type'>
line_descriptor_LSDDetector <class 'type'>
line_descriptor_LSDParam <class 'type'>
linearPolar <class 'builtin_function_or_method'>
linemod <class 'module'>
linemod_ColorGradient <class 'type'>
linemod_DepthNormal <class 'type'>
linemod_Detector <class 'type'>
linemod_Feature <class 'type'>
linemod_Match <class 'type'>
linemod_Modality <class 'type'>
linemod_QuantizedPyramid <class 'type'>
linemod_Template <class 'type'>
load_config_py3 <class 'module'>
log <class 'builtin_function_or_method'>
logPolar <class 'builtin_function_or_method'>
magnitude <class 'builtin_function_or_method'>
matMulDeriv <class 'builtin_function_or_method'>
mat_wrapper <class 'module'>
matchShapes <class 'builtin_function_or_method'>
matchTemplate <class 'builtin_function_or_method'>
max <class 'builtin_function_or_method'>
mcc <class 'module'>
mcc_CChecker <class 'type'>
mcc_CCheckerDetector <class 'type'>
mcc_CCheckerDraw <class 'type'>
mcc_DetectorParameters <class 'type'>
mean <class 'builtin_function_or_method'>
meanShift <class 'builtin_function_or_method'>
meanStdDev <class 'builtin_function_or_method'>
medianBlur <class 'builtin_function_or_method'>
merge <class 'builtin_function_or_method'>
min <class 'builtin_function_or_method'>
minAreaRect <class 'builtin_function_or_method'>
minEnclosingCircle <class 'builtin_function_or_method'>
minEnclosingTriangle <class 'builtin_function_or_method'>
minMaxLoc <class 'builtin_function_or_method'>
misc <class 'module'>
mixChannels <class 'builtin_function_or_method'>
ml <class 'module'>
ml_ANN_MLP <class 'type'>
ml_Boost <class 'type'>
ml_DTrees <class 'type'>
ml_EM <class 'type'>
ml_KNearest <class 'type'>
ml_LogisticRegression <class 'type'>
ml_NormalBayesClassifier <class 'type'>
ml_ParamGrid <class 'type'>
ml_RTrees <class 'type'>
ml_SVM <class 'type'>
ml_SVMSGD <class 'type'>
ml_StatModel <class 'type'>
ml_TrainData <class 'type'>
moments <class 'builtin_function_or_method'>
morphologyEx <class 'builtin_function_or_method'>
motempl <class 'module'>
moveWindow <class 'builtin_function_or_method'>
mulSpectrums <class 'builtin_function_or_method'>
mulTransposed <class 'builtin_function_or_method'>
multicalib <class 'module'>
multiply <class 'builtin_function_or_method'>
namedWindow <class 'builtin_function_or_method'>
norm <class 'builtin_function_or_method'>
normalize <class 'builtin_function_or_method'>
numpy <class 'module'>
ocl <class 'module'>
ocl_Device <class 'type'>
ocl_OpenCLExecutionContext <class 'type'>
ogl <class 'module'>
omnidir <class 'module'>
optflow <class 'module'>
optflow_DenseRLOFOpticalFlow <class 'type'>
optflow_DualTVL1OpticalFlow <class 'type'>
optflow_GPCDetails <class 'type'>
optflow_GPCPatchDescriptor <class 'type'>
optflow_GPCPatchSample <class 'type'>
optflow_GPCTrainingSamples <class 'type'>
optflow_GPCTree <class 'type'>
optflow_OpticalFlowPCAFlow <class 'type'>
optflow_PCAPrior <class 'type'>
optflow_RLOFOpticalFlowParameter <class 'type'>
optflow_SparseRLOFOpticalFlow <class 'type'>
os <class 'module'>
parallel <class 'module'>
patchNaNs <class 'builtin_function_or_method'>
pencilSketch <class 'builtin_function_or_method'>
perspectiveTransform <class 'builtin_function_or_method'>
phase <class 'builtin_function_or_method'>
phaseCorrelate <class 'builtin_function_or_method'>
phase_unwrapping <class 'module'>
phase_unwrapping_HistogramPhaseUnwrapping <class 'type'>
phase_unwrapping_HistogramPhaseUnwrapping_Params <class 'type'>
phase_unwrapping_PhaseUnwrapping <class 'type'>
plot <class 'module'>
plot_Plot2d <class 'type'>
pointPolygonTest <class 'builtin_function_or_method'>
polarToCart <class 'builtin_function_or_method'>
pollKey <class 'builtin_function_or_method'>
polylines <class 'builtin_function_or_method'>
pow <class 'builtin_function_or_method'>
ppf_match_3d <class 'module'>
ppf_match_3d_ICP <class 'type'>
ppf_match_3d_PPF3DDetector <class 'type'>
ppf_match_3d_Pose3D <class 'type'>
ppf_match_3d_PoseCluster3D <class 'type'>
preCornerDetect <class 'builtin_function_or_method'>
projectPoints <class 'builtin_function_or_method'>
putText <class 'builtin_function_or_method'>
pyrDown <class 'builtin_function_or_method'>
pyrMeanShiftFiltering <class 'builtin_function_or_method'>
pyrUp <class 'builtin_function_or_method'>
quality <class 'module'>
quality_QualityBRISQUE <class 'type'>
quality_QualityBase <class 'type'>
quality_QualityGMSD <class 'type'>
quality_QualityMSE <class 'type'>
quality_QualityPSNR <class 'type'>
quality_QualitySSIM <class 'type'>
randShuffle <class 'builtin_function_or_method'>
randn <class 'builtin_function_or_method'>
randu <class 'builtin_function_or_method'>
rapid <class 'module'>
rapid_GOSTracker <class 'type'>
rapid_OLSTracker <class 'type'>
rapid_Rapid <class 'type'>
rapid_Tracker <class 'type'>
readOpticalFlow <class 'builtin_function_or_method'>
recoverPose <class 'builtin_function_or_method'>
rectangle <class 'builtin_function_or_method'>
rectangleIntersectionArea <class 'builtin_function_or_method'>
rectify3Collinear <class 'builtin_function_or_method'>
redirectError <class 'builtin_function_or_method'>
reduce <class 'builtin_function_or_method'>
reduceArgMax <class 'builtin_function_or_method'>
reduceArgMin <class 'builtin_function_or_method'>
reg <class 'module'>
reg_Map <class 'type'>
reg_MapAffine <class 'type'>
reg_MapProjec <class 'type'>
reg_MapShift <class 'type'>
reg_MapTypeCaster <class 'type'>
reg_Mapper <class 'type'>
reg_MapperGradAffine <class 'type'>
reg_MapperGradEuclid <class 'type'>
reg_MapperGradProj <class 'type'>
reg_MapperGradShift <class 'type'>
reg_MapperGradSimilar <class 'type'>
reg_MapperPyramid <class 'type'>
remap <class 'builtin_function_or_method'>
repeat <class 'builtin_function_or_method'>
reprojectImageTo3D <class 'builtin_function_or_method'>
resize <class 'builtin_function_or_method'>
resizeWindow <class 'builtin_function_or_method'>
rgbd <class 'module'>
rgbd_DepthCleaner <class 'type'>
rgbd_FastICPOdometry <class 'type'>
rgbd_ICPOdometry <class 'type'>
rgbd_Odometry <class 'type'>
rgbd_OdometryFrame <class 'type'>
rgbd_RgbdFrame <class 'type'>
rgbd_RgbdICPOdometry <class 'type'>
rgbd_RgbdNormals <class 'type'>
rgbd_RgbdOdometry <class 'type'>
rgbd_RgbdPlane <class 'type'>
rotate <class 'builtin_function_or_method'>
rotatedRectangleIntersection <class 'builtin_function_or_method'>
saliency <class 'module'>
saliency_MotionSaliency <class 'type'>
saliency_MotionSaliencyBinWangApr2014 <class 'type'>
saliency_Objectness <class 'type'>
saliency_ObjectnessBING <class 'type'>
saliency_Saliency <class 'type'>
saliency_StaticSaliency <class 'type'>
saliency_StaticSaliencyFineGrained <class 'type'>
saliency_StaticSaliencySpectralResidual <class 'type'>
samples <class 'module'>
sampsonDistance <class 'builtin_function_or_method'>
scaleAdd <class 'builtin_function_or_method'>
seamlessClone <class 'builtin_function_or_method'>
segmentation <class 'module'>
segmentation_IntelligentScissorsMB <class 'type'>
selectROI <class 'builtin_function_or_method'>
selectROIs <class 'builtin_function_or_method'>
sepFilter2D <class 'builtin_function_or_method'>
setIdentity <class 'builtin_function_or_method'>
setLogLevel <class 'builtin_function_or_method'>
setMouseCallback <class 'builtin_function_or_method'>
setNumThreads <class 'builtin_function_or_method'>
setRNGSeed <class 'builtin_function_or_method'>
setTrackbarMax <class 'builtin_function_or_method'>
setTrackbarMin <class 'builtin_function_or_method'>
setTrackbarPos <class 'builtin_function_or_method'>
setUseOpenVX <class 'builtin_function_or_method'>
setUseOptimized <class 'builtin_function_or_method'>
setWindowProperty <class 'builtin_function_or_method'>
setWindowTitle <class 'builtin_function_or_method'>
solve <class 'builtin_function_or_method'>
solveCubic <class 'builtin_function_or_method'>
solveLP <class 'builtin_function_or_method'>
solveP3P <class 'builtin_function_or_method'>
solvePnP <class 'builtin_function_or_method'>
solvePnPGeneric <class 'builtin_function_or_method'>
solvePnPRansac <class 'builtin_function_or_method'>
solvePnPRefineLM <class 'builtin_function_or_method'>
solvePnPRefineVVS <class 'builtin_function_or_method'>
solvePoly <class 'builtin_function_or_method'>
sort <class 'builtin_function_or_method'>
sortIdx <class 'builtin_function_or_method'>
spatialGradient <class 'builtin_function_or_method'>
split <class 'builtin_function_or_method'>
sqrBoxFilter <class 'builtin_function_or_method'>
sqrt <class 'builtin_function_or_method'>
stackBlur <class 'builtin_function_or_method'>
startWindowThread <class 'builtin_function_or_method'>
stereo <class 'module'>
stereoCalibrate <class 'builtin_function_or_method'>
stereoCalibrateExtended <class 'builtin_function_or_method'>
stereoRectify <class 'builtin_function_or_method'>
stereoRectifyUncalibrated <class 'builtin_function_or_method'>
stereo_MatchQuasiDense <class 'type'>
stereo_PropagationParameters <class 'type'>
stereo_QuasiDenseStereo <class 'type'>
structured_light <class 'module'>
structured_light_GrayCodePattern <class 'type'>
structured_light_SinusoidalPattern <class 'type'>
structured_light_SinusoidalPattern_Params <class 'type'>
structured_light_StructuredLightPattern <class 'type'>
stylization <class 'builtin_function_or_method'>
subtract <class 'builtin_function_or_method'>
sumElems <class 'builtin_function_or_method'>
sys <class 'module'>
text <class 'module'>
text_BaseOCR <class 'type'>
text_ERFilter <class 'type'>
text_ERFilter_Callback <class 'type'>
text_OCRBeamSearchDecoder <class 'type'>
text_OCRBeamSearchDecoder_ClassifierCallback <class 'type'>
text_OCRHMMDecoder <class 'type'>
text_OCRHMMDecoder_ClassifierCallback <class 'type'>
text_OCRTesseract <class 'type'>
text_TextDetector <class 'type'>
text_TextDetectorCNN <class 'type'>
textureFlattening <class 'builtin_function_or_method'>
threshold <class 'builtin_function_or_method'>
trace <class 'builtin_function_or_method'>
transform <class 'builtin_function_or_method'>
transpose <class 'builtin_function_or_method'>
transposeND <class 'builtin_function_or_method'>
triangulatePoints <class 'builtin_function_or_method'>
typing <class 'module'>
undistort <class 'builtin_function_or_method'>
undistortImagePoints <class 'builtin_function_or_method'>
undistortPoints <class 'builtin_function_or_method'>
undistortPointsIter <class 'builtin_function_or_method'>
useOpenVX <class 'builtin_function_or_method'>
useOptimized <class 'builtin_function_or_method'>
utils <class 'module'>
utils_ClassWithKeywordProperties <class 'type'>
utils_nested_ExportClassName <class 'type'>
utils_nested_ExportClassName_Params <class 'type'>
validateDisparity <class 'builtin_function_or_method'>
vconcat <class 'builtin_function_or_method'>
version <class 'module'>
videoio_registry <class 'module'>
videostab <class 'module'>
waitKey <class 'builtin_function_or_method'>
waitKeyEx <class 'builtin_function_or_method'>
warpAffine <class 'builtin_function_or_method'>
warpPerspective <class 'builtin_function_or_method'>
warpPolar <class 'builtin_function_or_method'>
watershed <class 'builtin_function_or_method'>
wechat_qrcode <class 'module'>
wechat_qrcode_WeChatQRCode <class 'type'>
writeOpticalFlow <class 'builtin_function_or_method'>
xfeatures2d <class 'module'>
xfeatures2d_AffineFeature2D <class 'type'>
xfeatures2d_BEBLID <class 'type'>
xfeatures2d_BoostDesc <class 'type'>
xfeatures2d_BriefDescriptorExtractor <class 'type'>
xfeatures2d_DAISY <class 'type'>
xfeatures2d_FREAK <class 'type'>
xfeatures2d_HarrisLaplaceFeatureDetector <class 'type'>
xfeatures2d_LATCH <class 'type'>
xfeatures2d_LUCID <class 'type'>
xfeatures2d_MSDDetector <class 'type'>
xfeatures2d_PCTSignatures <class 'type'>
xfeatures2d_PCTSignaturesSQFD <class 'type'>
xfeatures2d_SURF <class 'type'>
xfeatures2d_StarDetector <class 'type'>
xfeatures2d_TBMR <class 'type'>
xfeatures2d_TEBLID <class 'type'>
xfeatures2d_VGG <class 'type'>
ximgproc <class 'module'>
ximgproc_AdaptiveManifoldFilter <class 'type'>
ximgproc_ContourFitting <class 'type'>
ximgproc_DTFilter <class 'type'>
ximgproc_DisparityFilter <class 'type'>
ximgproc_DisparityWLSFilter <class 'type'>
ximgproc_EdgeAwareInterpolator <class 'type'>
ximgproc_EdgeBoxes <class 'type'>
ximgproc_EdgeDrawing <class 'type'>
ximgproc_EdgeDrawing_Params <class 'type'>
ximgproc_FastBilateralSolverFilter <class 'type'>
ximgproc_FastGlobalSmootherFilter <class 'type'>
ximgproc_FastLineDetector <class 'type'>
ximgproc_GuidedFilter <class 'type'>
ximgproc_RFFeatureGetter <class 'type'>
ximgproc_RICInterpolator <class 'type'>
ximgproc_RidgeDetectionFilter <class 'type'>
ximgproc_ScanSegment <class 'type'>
ximgproc_SparseMatchInterpolator <class 'type'>
ximgproc_StructuredEdgeDetection <class 'type'>
ximgproc_SuperpixelLSC <class 'type'>
ximgproc_SuperpixelSEEDS <class 'type'>
ximgproc_SuperpixelSLIC <class 'type'>
ximgproc_segmentation_GraphSegmentation <class 'type'>
ximgproc_segmentation_SelectiveSearchSegmentation <class 'type'>
ximgproc_segmentation_SelectiveSearchSegmentationStrategy <class 'type'>
ximgproc_segmentation_SelectiveSearchSegmentationStrategyColor <class 'type'>
ximgproc_segmentation_SelectiveSearchSegmentationStrategyFill <class 'type'>
ximgproc_segmentation_SelectiveSearchSegmentationStrategyMultiple <class 'type'>
ximgproc_segmentation_SelectiveSearchSegmentationStrategySize <class 'type'>
ximgproc_segmentation_SelectiveSearchSegmentationStrategyTexture <class 'type'>
xphoto <class 'module'>
xphoto_GrayworldWB <class 'type'>
xphoto_LearningBasedWB <class 'type'>
xphoto_SimpleWB <class 'type'>
xphoto_TonemapDurand <class 'type'>
xphoto_WhiteBalancer <class 'type'>
哇, 功能真的非常多啊! 其中最常用的是圖檔讀寫相關的函式 :
- imread() : 讀取圖檔
- imwrite() : 將圖形物件輸出為圖檔
- imshow() : 顯示圖檔
- waitKey() : 控制顯示視窗關閉時機
- destroyAllWindows() : 關閉全部 cv2 開啟的圖形視窗
沒有留言 :
張貼留言