{"id":85644,"date":"2026-07-27T19:49:19","date_gmt":"2026-07-27T11:49:19","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/85644.html"},"modified":"2026-07-27T19:49:19","modified_gmt":"2026-07-27T11:49:19","slug":"opencv-python-%e5%9b%be%e5%83%8f%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/85644.html","title":{"rendered":"OpenCV-Python \u56fe\u50cf\u5904\u7406"},"content":{"rendered":"<p>OPenCV &#8212; \u8ba1\u7b97\u673a\u89c6\u89c9\u5e93&#xff0c;\u4e8e 1999 \u5e74\u5728\u82f1\u7279\u5c14&#xff08;Intel&#xff09;\u542f\u52a8&#xff0c;\u7b2c\u4e00\u4e2a\u7248\u672c\u4e8e 2000 \u5e74\u53d1\u5e03\u3002<\/p>\n<p>OpenCV \u652f\u6301\u591a\u79cd\u00a0\u7f16\u7a0b\u8bed\u8a00&#xff0c;\u5982 C&#043;&#043;\u3001Python\u3001\u00a0Java\u00a0\u7b49&#xff0c;\u5e76\u53ef\u5728\u4e0d\u540c\u5e73\u53f0\u4e0a\u8fd0\u884c&#xff0c;\u5305\u62ec Windows\u3001Linux\u3001OS X\u3001Android \u548c iOS\u3002\u57fa\u4e8e CUDA \u548c OpenCL \u7684\u9ad8\u901f GPU \u64cd\u4f5c\u63a5\u53e3\u4e5f\u5904\u4e8e\u79ef\u6781\u5f00\u53d1\u4e2d\u3002<\/p>\n<p>OpenCV-Python \u662f OpenCV \u7684 Python API&#xff0c;\u672c\u8d28\u4e0a\u662f\u539f\u59cb OpenCV C&#043;&#043; \u5b9e\u73b0\u7684 Python \u5c01\u88c5&#xff0c;\u5b83\u7ed3\u5408\u4e86 OpenCV C&#043;&#043; API \u7684\u9ad8\u6027\u80fd\u548c Python \u8bed\u8a00\u7684\u4fbf\u6377\u6027\u3002<\/p>\n<h2>\u4e00\u3001\u56fe\u50cf\u57fa\u672c\u64cd\u4f5c<\/h2>\n<h4>1. cv2.imread()<\/h4>\n<p>\u8be5\u51fd\u6570\u7528\u4e8e\u4ece\u6307\u5b9a\u6587\u4ef6\u8def\u5f84&#xff08;\u7edd\u5bf9\u8def\u5f84\u6216\u8005\u76f8\u5bf9\u8def\u5f84&#xff09;\u8bfb\u53d6\u56fe\u50cf\u6570\u636e&#xff0c;\u662f\u8ba1\u7b97\u673a\u89c6\u89c9\u548c\u56fe\u50cf\u5904\u7406\u9886\u57df\u4e2d\u6700\u57fa\u7840\u548c\u5e38\u7528\u7684\u51fd\u6570\u4e4b\u4e00\u3002<\/p>\n<p>. &#8211; \u8be5\u51fd\u6570\u901a\u8fc7\u56fe\u50cf\u5185\u5bb9\u800c\u975e\u6587\u4ef6\u6269\u5c55\u540d\u6765\u786e\u5b9a\u56fe\u50cf\u7c7b\u578b\u3002 . &#8211; \u5bf9\u4e8e\u5f69\u8272\u56fe\u50cf&#xff0c;\u89e3\u7801\u540e\u7684\u56fe\u50cf\u901a\u9053\u5c06\u6309 BGR\u00a0\u987a\u5e8f\u5b58\u50a8\u3002 . &#8211; \u4ee5\u7070\u5ea6\u56fe\u6a21\u5f0f\u8bfb\u53d6&#xff0c;\u8fd4\u56de\u7684\u662f\u5355\u901a\u90538\u4f4d\u7070\u5ea6\u56fe\u3002 . &#8211; \u4ee5\u900f\u660e\u5ea6\u6a21\u5f0f\u8bfb\u53d6&#xff0c;\u5982\u679c\u539f\u56fe\u6709A\u901a\u9053&#xff0c;\u5219\u8fd4\u56de\u7684\u56fe\u50cf\u6570\u636e\u4e3aBGRA\u56db\u901a\u9053&#xff1b;\u82e5\u539f\u56fe\u4e3aRGB\u4e09\u901a\u9053\u5f69\u8272\u56fe&#xff0c;\u5219\u8fd4\u56de\u7684\u56fe\u50cf\u6570\u636e\u4e3aBGR\u4e09\u901a\u9053\u3002 . &#8211; \u4ee5 cv2.imread() \u7684\u9ed8\u8ba4\u6a21\u5f0f\u8bfb\u53d6 RGBA \u901a\u9053\u7684 PNG \u56fe\u50cf&#xff0c;\u8fd4\u56de\u7684\u56fe\u50cf\u662fBGR 3\u901a\u9053&#xff0c;Alpha \u901a\u9053\u4f1a\u88ab\u4e22\u5f03\u3002<\/p>\n<p># \u8bfb\u53d6\u5f69\u8272\u56fe\u50cf&#xff08;\u9ed8\u8ba4&#xff09;<br \/>\nimg &#061; cv2.imread(&#039;image.jpg&#039;)<br \/>\n# \u8bfb\u53d6\u7070\u5ea6\u56fe\u50cf<br \/>\nimg &#061; cv2.imread(&#039;image.jpg&#039;, cv2.IMREAD_GRAYSCALE)<br \/>\n# \u8bfb\u53d6\u5e26\u900f\u660e\u5ea6\u7684\u56fe\u50cf<br \/>\nimg &#061; cv2.imread(&#039;image.png&#039;, cv2.IMREAD_UNCHANGED) <\/p>\n<h4>2. cv2.minMaxLoc()<\/h4>\n<p>\u8be5\u51fd\u6570\u4e0d\u9002\u7528\u4e8e\u591a\u901a\u9053\u6570\u7ec4\u3002\u5982\u679c\u9700\u8981\u67e5\u627e\u6240\u6709\u901a\u9053\u4e2d\u7684\u6700\u5c0f\u503c\u6216\u6700\u5927\u503c\u5143\u7d20&#xff0c;\u8bf7\u5148\u4f7f\u7528 Mat::reshape \u5c06\u6570\u7ec4\u91cd\u65b0\u89e3\u91ca\u4e3a\u5355\u901a\u9053\u6570\u7ec4\u3002\u6216\u8005&#xff0c;\u60a8\u53ef\u4ee5\u4f7f\u7528 extractImageCOI\u3001mixChannels \u6216 split \u63d0\u53d6\u7279\u5b9a\u901a\u9053\u3002<\/p>\n<p># \u627e\u5230\u5f53\u524d\u56fe\u50cf\u7684\u6700\u5c0f\u548c\u6700\u5927\u50cf\u7d20\u503c<br \/>\nmin_val, max_val, _, _ &#061; cv2.minMaxLoc(depth_map) <\/p>\n<h2>\u4e8c\u3001\u56fe\u50cf\u53d8\u6362<\/h2>\n<h4>1. \u53d6\u53cd cv2.bitwise_not()\u00a0<\/h4>\n<p># a mask and its inverse mask<br \/>\nmask_inv &#061; cv2.bitwise_not(mask) <\/p>\n<h4>2. \u7f29\u653e cv2.resize()<\/h4>\n<p>resize(src, dsize[, dst[, fx[, fy[, interpolation]]]]) -&gt; dst<\/p>\n<p># dsize\u8bbe\u4e3anone&#xff0c;\u6c34\u5e73\u548c\u5782\u76f4\u65b9\u5411\u7684\u7f29\u653e\u56e0\u5b50\u4e3a2&#xff0c;\u5c06\u56fe\u50cf\u5bbd\u9ad8\u653e\u5927\u5230\u539f\u56fe\u76842\u500d<br \/>\nres &#061; cv2.resize(img,None,fx&#061;2, fy&#061;2, interpolation &#061; cv.INTER_CUBIC)<\/p>\n<p># \u5c06\u56fe\u50cf\u5bbd\u9ad8\u653e\u5927\u5230\u539f\u56fe\u76842\u500d&#xff0c;\u663e\u5f0f\u6307\u5b9a\u76ee\u6807\u56fe\u50cf\u7684\u5927\u5c0f(2*width, 2*height)&#xff0c;fx\u548cfy\u88ab\u5ffd\u7565\u3002<br \/>\nheight, width &#061; img.shape[:2]<br \/>\nres &#061; cv.resize(img,(2*width, 2*height), interpolation &#061; cv.INTER_CUBIC)<\/p>\n<p>resized_img&#061;cv2.resize(img,(256,256))<\/p>\n<p>\u8be5\u51fd\u6570\u5c06\u56fe\u50cf src \u7f29\u5c0f\u6216\u653e\u5927\u5230\u6307\u5b9a\u5c3a\u5bf8\u3002\u7f29\u653e&#xff08;Scaling&#xff09;\u672c\u8d28\u4e0a\u5c31\u662f\u56fe\u50cf\u7684\u5c3a\u5bf8\u8c03\u6574\u3002dst \u4e3a\u8f93\u51fa\u56fe\u50cf&#xff0c;\u5b83\u5177\u6709 dsize \u7684\u5927\u5c0f&#xff08;\u5f53 dsize \u4e0d\u4e3a\u96f6\u65f6&#xff09;\u6216\u6839\u636e src.size()\u3001fx \u548c fy \u8ba1\u7b97\u51fa\u7684\u5927\u5c0f&#xff1b;\u7f29\u5c0f\u56fe\u50cf\u65f6&#xff0c;\u901a\u5e38\u4f7f\u7528 INTER_AREA \u63d2\u503c\u6548\u679c\u6700\u597d&#xff0c;\u800c\u653e\u5927\u56fe\u50cf\u65f6&#xff0c;\u901a\u5e38\u4f7f\u7528 INTER_CUBIC&#xff08;\u901f\u5ea6\u6162&#xff09;\u6216 INTER_LINEAR&#xff08;\u901f\u5ea6\u8f83\u5feb&#xff0c;\u4f46\u6548\u679c\u4ecd\u7136\u53ef\u4ee5\u63a5\u53d7&#xff09;\u63d2\u503c\u6548\u679c\u6700\u597d\u3002<\/p>\n<p>resize\u51fd\u6570\u9ed8\u8ba4\u4f7f\u7528\u7684\u662fINTER_LINER\u53cc\u7ebf\u6027\u63d2\u503c&#xff0c;\u53cc\u7ebf\u6027\u63d2\u503c\u7684\u6838\u5fc3\u5c31\u662f\u5411\u4e0b\u53d6\u6574&#xff08;Floor&#xff09;\u548c\u5411\u4e0a\u53d6\u6574&#xff08;Ceil&#xff09;\u6765\u6846\u5b9a\u76ee\u6807\u70b9\u6240\u5728\u7684\u201c\u683c\u5b50\u201d&#xff1a;4.3 \u4f4d\u4e8e 4 \u548c 5 \u4e4b\u95f4&#xff0c;5.7 \u4f4d\u4e8e 5 \u548c 6 \u4e4b\u95f4&#xff0c;\u6700\u7ec8\u5f97\u5230\u7684\u56db\u4e2a\u90bb\u57df\u50cf\u7d20\u5750\u6807\u4e3a\u8fd9\u51e0\u4e2a\u5750\u6807\u7684\u7ec4\u5408&#xff0c;\u5c0f\u6570\u90e8\u5206\u76f8\u4e58\u5f97\u5230\u6bcf\u4e2a\u5750\u6807\u7684\u6743\u91cd&#xff0c;\u76f8\u5e94\u5750\u6807\u7684\u50cf\u7d20\u503c\u4e58\u4ee5\u6743\u91cd\u5f97\u5230\u76ee\u6807\u50cf\u7d20\u7684\u50cf\u7d20\u503c\u3002<\/p>\n<h5>\u8865\u5145\u4ecb\u7ecd\u88c1\u5207&#xff08;Crop&#xff09;:<\/h5>\n<ul>\n<li>\n<p>\u4f7f\u7528\u88c1\u5207&#xff1a;\u5f53\u53ea\u9700\u8981\u56fe\u50cf\u4e2d\u7684\u67d0\u4e00\u90e8\u5206&#xff08;\u5982\u4eba\u8138\u68c0\u6d4b\u540e\u7684 ROI \u63d0\u53d6&#xff09;&#xff0c;\u6216\u8005\u9700\u8981\u53bb\u9664\u56fe\u50cf\u8fb9\u7f18\u7684\u4e0d\u5fc5\u8981\u80cc\u666f\u65f6\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u7f29\u653e&#xff1a;\u5f53\u9700\u8981\u7edf\u4e00\u4e0d\u540c\u5c3a\u5bf8\u56fe\u50cf\u7684\u5206\u8fa8\u7387&#xff08;\u5982\u795e\u7ecf\u7f51\u7edc\u8f93\u5165\u9884\u5904\u7406&#xff09;&#xff0c;\u6216\u8005\u9700\u8981\u8c03\u6574\u56fe\u50cf\u5927\u5c0f\u4ee5\u9002\u5e94\u663e\u793a\u5c4f\u5e55\u6216\u5b58\u50a8\u9650\u5236\u65f6\u3002<\/p>\n<\/li>\n<\/ul>\n<p>OpenCV \u4e2d\u6ca1\u6709\u540d\u4e3a\u00a0cv2.crop\u00a0\u7684\u51fd\u6570\u3002\u88c1\u5207\u901a\u5e38\u5229\u7528 Python \u4e2d NumPy \u5e93\u5bf9\u77e9\u9635\u8fdb\u884c\u5207\u7247\u64cd\u4f5c\u5b9e\u73b0&#xff0c;\u6548\u7387\u6781\u9ad8\u3002\u539f\u7406&#xff1a;\u76f4\u63a5\u8bbf\u95ee\u56fe\u50cf\u6570\u7ec4\u7684\u7279\u5b9a\u884c\u548c\u5217\u8303\u56f4<\/p>\n<p>import cv2<br \/>\nimport numpy as np<\/p>\n<p>img &#061; cv2.imread(&#039;input.jpg&#039;)<br \/>\nh,w,c &#061; img.shape      # 848 1919 3<\/p>\n<p># \u88c1\u5207&#xff1a;\u4ece y&#061;100 \u5230 y&#061;300&#xff0c;x&#061;100 \u5230 x&#061;400 \u7684\u533a\u57df<br \/>\n# \u6ce8\u610f&#xff1a;OpenCV \u56fe\u50cf\u5b58\u50a8\u4e3a (\u884c, \u5217) \u5373 (y, x) \u683c\u5f0f<br \/>\ncropped_img &#061; img[100:300, 100:400] <\/p>\n<h4>3. \u4e0a\u91c7\u6837\u3001\u4e0b\u91c7\u6837\u3001\u8d85\u91c7\u6837<\/h4>\n<p>\u4e0a\u91c7\u6837&#xff1a;\u653e\u5927\u56fe\u50cf\u5c3a\u5bf8&#xff0c;\u63d0\u9ad8\u56fe\u50cf\u5206\u8fa8\u7387\u3002\u4f7f\u7528\u63d2\u503c\u7b97\u6cd5&#xff08;\u53cc\u7ebf\u6027\u3001\u53cc\u4e09\u6b21&#xff09;&#xff0c;\u6839\u636e\u5468\u56f4\u50cf\u7d20\u7684\u989c\u8272\u6765\u8ba1\u7b97\u65b0\u50cf\u7d20\u7684\u989c\u8272\u3002\u7ecf\u5e38\u5e94\u7528\u4e8e\u56fe\u50cf\u653e\u7f29\u663e\u793a\u3001\u56fe\u50cf\u91d1\u5b57\u5854\u91cd\u5efa\u3001\u8d85\u5206\u8fa8\u7387\u6280\u672f\u3002<\/p>\n<p>\u4e0b\u91c7\u6837&#xff1a;\u7f29\u5c0f\u56fe\u50cf\u5c3a\u5bf8&#xff0c;\u964d\u4f4e\u56fe\u50cf\u5206\u8fa8\u7387\u3002\u4e3a\u4e86\u9632\u6b62\u76f4\u63a5\u4e22\u5f03\u50cf\u7d20\u5bfc\u81f4\u753b\u9762\u51fa\u73b0\u952f\u9f7f&#xff08;\u6df7\u53e0\u73b0\u8c61&#xff0c;Aliasing&#xff09;&#xff0c;\u4f20\u7edf\u7684\u4e0b\u91c7\u6837\u901a\u5e38\u9700\u8981\u201c\u5148\u4f4e\u901a\u6ee4\u6ce2&#xff08;\u9ad8\u65af\u6a21\u7cca&#xff09;&#043; \u518d\u62bd\u53d6\u50cf\u7d20\u201d&#xff0c;\u6216\u8005\u201c\u6309\u50cf\u7d20\u9762\u79ef\u6bd4\u4f8b\u6c42\u5e73\u5747\u201d&#xff0c;\u8fbe\u5230\u628a\u9ad8\u5bc6\u5ea6\u50cf\u7d20\u7f51\u683c\u538b\u7f29\u4e3a\u4f4e\u5bc6\u5ea6\u50cf\u7d20\u7f51\u683c\u7684\u76ee\u7684\u3002\u7ecf\u5e38\u5e94\u7528\u4e0e\u56fe\u50cf\u7f29\u7565\u56fe\u663e\u793a\u3001\u51cf\u5c0f\u5b58\u50a8\u7a7a\u95f4\u3001\u51cf\u8f7b CPU \/ GPU \u5904\u7406\u8d1f\u62c5\u3002<\/p>\n<p>\u8d85\u91c7\u6837&#xff1a;\u8c03\u6574\u56fe\u50cf\u5206\u8fa8\u7387&#xff0c;\u5148\u653e\u5927\u6e32\u67d3\u518d\u7f29\u5c0f\u56fe\u50cf&#xff0c;\u8fbe\u5230\u6297\u952f\u9f7f\u4e0e\u7ec6\u8282\u589e\u5f3a\u7684\u6548\u679c\u3002\u663e\u5361\u5728\u540e\u53f0\u5148\u4ee5 4K&#xff08;3840 x\u00a02160&#xff09;\u7684\u5206\u8fa8\u7387\u6e32\u67d3\u6e38\u620f\u753b\u9762&#xff0c;\u7136\u540e\u901a\u8fc7\u7b97\u6cd5\u5c06\u753b\u9762\u201c\u538b\u7f29\u201d\u4e0b\u91c7\u6837\u5230\u4f60\u7684 1080p (1920 x 1080 )\u663e\u793a\u5668\u4e0a\u3002\u56e0\u4e3a\u663e\u793a\u5668\u7684\u6bcf\u4e2a\u50cf\u7d20\u70b9\u90fd\u662f\u7531\u540e\u53f0 4 \u4e2a\u9ad8\u7cbe\u5ea6\u7684\u70b9\u878d\u5408\u8ba1\u7b97\u51fa\u6765\u7684&#xff0c;\u753b\u9762\u8fb9\u7f18\u4f1a\u53d8\u5f97\u6781\u5176\u5e73\u6ed1\u7ec6\u817b&#xff0c;\u51e0\u4e4e\u770b\u4e0d\u5230\u952f\u9f7f\u3002\u7ecf\u5e38\u5e94\u7528\u4e8e\u6e38\u620f\u4e2d\u7684 SSAA&#xff08;Supersampling Anti-Aliasing&#xff09;\u3001\u56fe\u5f62\u6e32\u67d3\u3001\u9ad8\u8d28\u91cf\u5370\u5237\u9884\u5904\u7406\u3002<\/p>\n<h5>\u57fa\u7840\u4e14\u6700\u5e38\u7528\u7684\u63a5\u53e3&#xff1a;<img decoding=\"async\" alt=\"cv2.resize()\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260727114917-6a6745bd682a7.png\" \/><\/h5>\n<p>\u53ef\u540c\u65f6\u5b9e\u73b0\u4e0a\u91c7\u6837\u548c\u4e0b\u91c7\u6837&#xff0c;\u5176\u6838\u5fc3\u5728\u4e8einterpolation&#xff08;\u63d2\u503c\u53c2\u6570&#xff09;\u7684\u9009\u62e9&#xff1a;<\/p>\n<p>import cv2<\/p>\n<p># \u8bfb\u53d6\u56fe\u50cf<br \/>\nimg &#061; cv2.imread(&#039;input.jpg&#039;)<\/p>\n<p># &#8212; 1. \u4e0b\u91c7\u6837 (\u7f29\u5c0f\u56fe\u50cf) &#8212;<br \/>\n# \u4e0b\u91c7\u6837\u5f3a\u70c8\u63a8\u8350\u4f7f\u7528 cv2.INTER_AREA&#xff08;\u533a\u57df\u91cd\u91c7\u6837&#xff09;&#xff0c;\u5b83\u57fa\u4e8e\u50cf\u7d20\u8986\u76d6\u9762\u79ef\u6c42\u5e73\u5747&#xff0c;\u80fd\u6709\u6548\u6d88\u9664\u952f\u9f7f<br \/>\ndownscaled &#061; cv2.resize(img, (640, 360), interpolation&#061;cv2.INTER_AREA)<\/p>\n<p># &#8212; 2. \u4e0a\u91c7\u6837 (\u653e\u5927\u56fe\u50cf) &#8212;<br \/>\n# \u4e0a\u91c7\u6837\u63a8\u8350\u4f7f\u7528 cv2.INTER_LINEAR (\u53cc\u7ebf\u6027) \u6216 cv2.INTER_CUBIC (\u53cc\u4e09\u6b21)<br \/>\n# INTER_CUBIC \u8ba1\u7b97\u91cf\u66f4\u5927&#xff0c;\u4f46\u8fb9\u7f18\u6bd4\u53cc\u7ebf\u6027\u66f4\u9510\u5229<br \/>\nupsampled &#061; cv2.resize(img, (3840, 2160), interpolation&#061;cv2.INTER_CUBIC)<\/p>\n<p>\u5e38\u89c1\u63d2\u503c\u6807\u5fd7\u5bf9\u6bd4&#xff1a;<\/p>\n<ul>\n<li>\n<p>INTER_NEAREST&#xff1a;\u6700\u8fd1\u90bb\u63d2\u503c&#xff08;\u901f\u5ea6\u6781\u5feb&#xff0c;\u4f46\u653e\u5927\u6709\u9a6c\u8d5b\u514b&#xff0c;\u7f29\u5c0f\u6709\u4e25\u91cd\u952f\u9f7f&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>INTER_LINEAR&#xff1a;\u53cc\u7ebf\u6027\u63d2\u503c&#xff08;\u901f\u5ea6\u4e0e\u6548\u679c\u5e73\u8861&#xff0c;OpenCV \u9ed8\u8ba4\u53c2\u6570&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>INTER_CUBIC&#xff1a;\u53cc\u4e09\u6b21\u63d2\u503c&#xff08;\u53c2\u8003 4&#215;4 \u90bb\u57df&#xff0c;\u9002\u5408\u9ad8\u8d28\u91cf\u653e\u5927&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>INTER_AREA&#xff1a;\u50cf\u7d20\u533a\u57df\u91cd\u91c7\u6837&#xff08;\u4e0b\u91c7\u6837\u4e13\u7528\u9996\u9009&#xff0c;\u6297\u952f\u9f7f\u6548\u679c\u6700\u597d&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<h5>\u91d1\u5b57\u5854\u91c7\u6837\u63a5\u53e3&#xff1a;cv2.pyrDown() \u4e0e cv2.pyrUp()<\/h5>\n<p>\u8fd9\u662f\u4e13\u4e3a\u6784\u5efa\u56fe\u50cf\u91d1\u5b57\u5854&#xff08;Image Pyramid&#xff09;\u8bbe\u8ba1\u7684\u6807\u51c6 2 \u500d\u4e0a\u4e0b\u91c7\u6837\u51fd\u6570&#xff0c;\u5e38\u7528\u4e8e\u591a\u5c3a\u5ea6\u76ee\u6807\u68c0\u6d4b\u548c\u56fe\u50cf\u7f1d\u5408\u3002<\/p>\n<p># 1. pyrDown (\u4e0b\u91c7\u6837 2 \u500d)&#xff1a;<br \/>\n# \u539f\u7406&#xff1a;\u5148\u7528 5&#215;5 \u9ad8\u65af\u6838\u5bf9\u539f\u56fe\u8fdb\u884c\u5e73\u6ed1\u6ee4\u6ce2&#xff0c;\u7136\u540e\u76f4\u63a5\u4e22\u5f03\u6240\u6709\u5076\u6570\u884c\u548c\u5076\u6570\u5217<br \/>\nlower_res &#061; cv2.pyrDown(img)  # \u5bbd\u9ad8\u5404\u53d8\u4e3a 1\/2<\/p>\n<p># 2. pyrUp (\u4e0a\u91c7\u6837 2 \u500d)&#xff1a;<br \/>\n# \u539f\u7406&#xff1a;\u5728\u6bcf\u884c\u6bcf\u5217\u4e4b\u95f4\u63d2\u5165\u96f6\u503c\u50cf\u7d20&#xff0c;\u7136\u540e\u7528\u9ad8\u65af\u6838\u8fdb\u884c\u5377\u79ef\u5e73\u6ed1&#xff08;\u586b\u5145\u7f3a\u5931\u7684\u989c\u8272&#xff09;<br \/>\nhigher_res &#061; cv2.pyrUp(img)   # \u5bbd\u9ad8\u5404\u53d8\u4e3a 2 \u500d<\/p>\n<p>\u6ce8\u610f&#xff1a; \u5148 pyrDown \u518d pyrUp&#xff0c;\u56fe\u50cf\u5c3a\u5bf8\u867d\u7136\u6062\u590d\u4e86&#xff0c;\u4f46\u4e22\u5931\u7684\u9ad8\u9891\u7ec6\u8282&#xff08;\u6a21\u7cca\u611f&#xff09;\u662f\u65e0\u6cd5\u901a\u8fc7\u666e\u901a\u9ad8\u65af\u63d2\u503c\u6062\u590d\u56de\u6765\u7684\u3002<\/p>\n<h5>AI \u6df1\u5ea6\u5b66\u4e60\u8d85\u91c7\u6837&#xff1a;cv2.dnn_superres<\/h5>\n<p>\u5982\u679c\u4f60\u60f3\u8981\u50cf DLSS \/ FSR \u90a3\u6837&#xff0c;\u628a\u4e00\u5f20\u6a21\u7cca\u7684\u5c0f\u56fe\u7528 AI \u8865\u5168\u7ec6\u8282\u653e\u5927&#xff08;\u8d85\u5206\u8fa8\u7387\u91cd\u5efa&#xff09;&#xff0c;OpenCV \u7684 dnn_superres \u6a21\u5757\u63d0\u4f9b\u4e86\u57fa\u4e8e\u6df1\u5ea6\u795e\u7ecf\u7f51\u7edc\u7684\u8d85\u91c7\u6837\u5b9e\u73b0\u3002<\/p>\n<p>import cv2<br \/>\nfrom cv2 import dnn_superres<\/p>\n<p># \u521b\u5efa\u8d85\u5206\u8fa8\u7387\u5bf9\u8c61<br \/>\nsr &#061; dnn_superres.DnnSuperResImpl_create()<\/p>\n<p># \u8bfb\u53d6\u9884\u8bad\u7ec3\u7684 AI \u6a21\u578b&#xff08;\u5982 ESPCN, EDSR, FSRCNN \u7b49&#xff09;<br \/>\npath &#061; &#034;ESPCN_x4.pb&#034;<br \/>\nsr.readModel(path)<br \/>\nsr.setModel(&#034;espcn&#034;, 4) # \u8bbe\u7f6e\u7b97\u6cd5\u548c\u653e\u5927\u500d\u6570 (4\u500d)<\/p>\n<p># \u8fdb\u884c AI \u8d85\u91c7\u6837\u91cd\u5efa<br \/>\nresult &#061; sr.upsample(img)<\/p>\n<p>\u8fd9\u79cd AI \u4e0a\u91c7\u6837\u4e0d\u4f1a\u50cf\u4f20\u7edf\u63d2\u503c\u90a3\u6837\u7b80\u5355\u5730\u6a21\u7cca\u5e73\u6ed1\u8fb9\u7f18&#xff0c;\u800c\u662f\u80fd\u201c\u9884\u6d4b\u201d\u51fa\u7b26\u5408\u81ea\u7136\u7eb9\u7406\u7684\u7ec6\u8282&#xff08;\u5982\u53d1\u4e1d\u3001\u5efa\u7b51\u5899\u9762\u7eb9\u7406&#xff09;\u3002<\/p>\n<h5>OpenCV \u7684 AI \u8d85\u5206\u8fa8\u7387\u529f\u80fd&#xff1a;<\/h5>\n<ul>\n<li>\u524d\u7f6e\u6761\u4ef6&#xff1a;\u4f7f\u7528 OpenCV \u7684\u8d85\u5206\u8fa8\u7387\u6a21\u5757(dnn_superres)<span style=\"color:#4d4d4d\">&#xff0c;\u9700\u8981\u5b89\u88c5\u6269\u5c55\u7248\u7684 OpenCV \u5305&#xff1a;<\/span> pip install opencv-contrib-python <\/li>\n<li>\n<p>\u81ea\u52a8\u5efa\u56fe\u4e0e\u6a21\u578b\u83b7\u53d6&#xff1a; \u4ee3\u7801\u4f7f\u7528\u8f7b\u91cf\u7ea7\u3001\u901f\u5ea6\u6781\u5feb\u7684 ESPCN \u7b97\u6cd5\u6a21\u578b&#xff08;\u53ea\u6709\u51e0\u767e KB&#xff09;\u3002\u9996\u6b21\u8fd0\u884c\u65f6\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u6743\u91cd\u6587\u4ef6&#xff1b;\u5982\u679c\u5728\u540c\u76ee\u5f55\u4e0b\u6ca1\u6709\u627e\u5230 test_input.jpg&#xff0c;\u5b83\u4f1a\u7528 NumPy \u73b0\u573a\u7ed8\u5236\u4e00\u5f20\u70b9\u9635\u56fe\u7247\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b97\u6cd5\u914d\u7f6e\u5173\u952e\u4e09\u6b65&#xff1a;<\/p>\n<ul>\n<li>\n<p>cv2.dnn_superres.DnnSuperResImpl_create()&#xff1a;\u5b9e\u4f8b\u5316\u8d85\u5206\u8fa8\u7387\u63a8\u65ad\u5f15\u64ce\u3002<\/p>\n<\/li>\n<li>\n<p>sr.readModel(&#034;ESPCN_x4.pb&#034;)&#xff1a;\u8f7d\u5165\u5305\u542b\u795e\u7ecf\u7f51\u7edc\u53c2\u6570\u7684\u6587\u4ef6\u3002<\/p>\n<\/li>\n<li>\n<p>sr.setModel(&#034;espcn&#034;, 4)&#xff1a;\u6ce8\u518c\u6a21\u578b\u7c7b\u578b\u4e0e\u652f\u6301\u7684\u653e\u5927\u500d\u6570\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6548\u679c\u5bf9\u6bd4&#xff1a;\u00a0\u9644\u4ef6\u4e2d\u7684\u4ee3\u7801\u4e0d\u4ec5\u751f\u6210\u4e86 AI \u653e\u5927\u540e\u7684\u56fe\u7247&#xff0c;\u8fd8\u540c\u6b65\u751f\u6210\u4e86\u4e00\u5f20\u4f7f\u7528\u4f20\u7edf \u53cc\u4e09\u6b21\u63d2\u503c&#xff08;Bicubic&#xff09; \u653e\u5927\u7684\u56fe\u7247\u3002\u4ed4\u7ec6\u89c2\u5bdf\u6587\u5b57\u6216\u7269\u4f53\u7ebf\u6761\u8fb9\u7f18&#xff0c;\u4f60\u4f1a\u53d1\u73b0 AI \u8f93\u51fa\u7684\u8fb9\u7f18\u66f4\u52a0\u5e73\u6ed1\u6d41\u7545\u3001\u65e0\u660e\u663e\u952f\u9f7f\u611f\u3002<\/p>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"100\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260727114917-6a6745bd77b23.png\" width=\"100\" \/>\u539f\u59cb\u56fe\u50cf\u5206\u8fa8\u7387\u4e3a100&#215;100&#xff0c;\u7ecf\u8d85\u5206\u5f97\u5230\u7684\u56fe\u50cf\u4e3a400&#215;400&#xff0c;\u53ef\u89c1\u4e0b\u56fe\u6548\u679c\u3002<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1290\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260727114917-6a6745bd80f2e.png\" width=\"1438\" \/><\/p>\n<\/p>\n<\/p>\n<h4>\u96441&#xff1a;\u5982\u4f55\u67e5\u770b\u67d0\u4e2aopencv\u51fd\u6570\u7684\u5177\u4f53\u7528\u6cd5&#xff1f;<\/h4>\n<p>\u65b9\u6cd5\u4e00&#xff1a;Python \u81ea\u5e26 help()&#xff08;\u63a8\u8350&#xff09;<\/p>\n<p>\u4f8b\u5982\u60f3\u770b warpAffine&#xff1a;<\/p>\n<p>import cv2<br \/>\nhelp(cv2.warpAffine) <\/p>\n<p>\u66f4\u6f02\u4eae\u4e00\u70b9&#xff0c;Python \u89e3\u91ca\u5668\u91cc\u76f4\u63a5print&#xff0c;\u8f93\u51fa\u5c31\u662f\u6587\u6863\u5b57\u7b26\u4e32\u3002<\/p>\n<p>import cv2<br \/>\nprint(cv2.warpAffine.__doc__) <\/p>\n<p>\u5728\u865a\u62df\u73af\u5883\u4e2d\u8981\u52a0\u5165python\u00a0 -c&#xff0c;\u5982\u4e0b\u56fe\u6240\u793a&#xff1a;<\/p>\n<p>(.venv)E:\\\\Project\\\\LaMa&gt; python -c &#034;import cv2; help(cv2.imread)&#034; <\/p>\n<p>\u65b9\u6cd5\u4e8c&#xff1a;\u67e5\u770b OpenCV \u5b98\u65b9\u6587\u6863&#xff08;\u63a8\u8350&#xff09;<\/p>\n<p>\u56fe\u50cf\u5904\u7406\u6a21\u5757&#xff08;\u53ef\u770b\u5177\u4f53\u53c2\u6570&#xff09; \u2014 OpenCV \u6559\u7a0b &#8211; OpenCV \u8ba1\u7b97\u673a\u89c6\u89c9\u5e93<\/p>\n<p>OpenCV \u56fe\u50cf\u5904\u7406 &#xff08;\u7528\u6cd5\u8bf4\u660e\u4e0e\u64cd\u4f5c\u793a\u4f8b&#xff09;\u2014 OpenCV \u6559\u7a0b &#8211; OpenCV \u8ba1\u7b97\u673a\u89c6\u89c9\u5e93<\/p>\n<p>\u65b9\u6cd5\u4e09&#xff1a;\u67e5\u770b\u6e90\u7801\u793a\u4f8b&#xff08;\u6700\u503c\u5f97\u5b66&#xff09;<\/p>\n<p>OpenCV \u5b98\u65b9 GitHub&#xff1a;\u4f1a\u770b\u5230\u5f88\u591a\u5b98\u65b9 Demo&#xff0c;\u5f88\u591a\u6bd4\u6559\u7a0b\u8fd8\u597d\u3002<\/p>\n<p>GitHub &#8211; opencv\/opencv: Open Source Computer Vision Library \u00b7 GitHub<\/p>\n<\/p>\n<h4>\u96442&#xff1a;Windows Photos\u5e94\u7528\u8c03\u6574\u56fe\u7247\u5927\u5c0f\u7684\u63d2\u503c\u65b9\u6cd5&#xff1f;<\/h4>\n<p>Windows Photos\u5e94\u7528\u8c03\u6574\u56fe\u7247\u5206\u8fa8\u7387\u7684\u63d2\u503c\u65b9\u6cd5-CSDN\u535a\u5ba2<\/p>\n<\/p>\n<h3>\u53c2\u8003\u6765\u6e90&#xff1a;<\/h3>\n<p>OpenCV-Python \u6559\u7a0b\u7b80\u4ecb<\/p>\n<p>\u56fe\u50cf\u5904\u7406\u6a21\u5757&#xff08;\u53ef\u770b\u5177\u4f53\u53c2\u6570&#xff09; \u2014 OpenCV \u6559\u7a0b &#8211; OpenCV \u8ba1\u7b97\u673a\u89c6\u89c9\u5e93<\/p>\n<p>OpenCV \u56fe\u50cf\u5904\u7406 &#xff08;\u7528\u6cd5\u8bf4\u660e\u4e0e\u64cd\u4f5c\u793a\u4f8b&#xff09;\u2014 OpenCV \u6559\u7a0b &#8211; OpenCV \u8ba1\u7b97\u673a\u89c6\u89c9\u5e93<\/p>\n<p>tev&#xff1a;\u7ec8\u6781HDR\u56fe\u50cf\u67e5\u770b\u5668\u4e0e\u4e13\u4e1a\u5bf9\u6bd4\u5de5\u5177\u6307\u5357-CSDN\u535a\u5ba2<\/p>\n<p>Download Beyond Compare<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OPenCV &#8212; \u8ba1\u7b97\u673a\u89c6\u89c9\u5e93&#xff0c;\u4e8e 1999 \u5e74\u5728\u82f1\u7279\u5c14&#xff08;Intel&#xff09;\u542f\u52a8&#xff0c;\u7b2c\u4e00\u4e2a\u7248\u672c\u4e8e 2000 \u5e74\u53d1\u5e03\u3002<br \/>\nOpenCV \u652f\u6301\u591a\u79cd\u00a0\u7f16\u7a0b\u8bed\u8a00&#xff0c;\u5982 C\u3001Python\u3001\u00a0Java\u00a0\u7b49&#xff0c;\u5e76\u53ef\u5728\u4e0d\u540c\u5e73\u53f0\u4e0a\u8fd0\u884c&#xff0c;\u5305\u62ec Windows\u3001Linux\u3001OS X\u3001Android \u548c iOS\u3002\u57fa\u4e8e CUDA \u548c OpenCL \u7684\u9ad8\u901f GPU \u64cd\u4f5c\u63a5\u53e3\u4e5f\u5904\u4e8e\u79ef\u6781\u5f00\u53d1\u4e2d\u3002<br \/>\nOpenCV-Pyth<\/p>\n","protected":false},"author":2,"featured_media":85641,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1460,50,3829],"topic":[],"class_list":["post-85644","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-opencv","tag-50","tag-3829"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>OpenCV-Python \u56fe\u50cf\u5904\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/85644.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OpenCV-Python \u56fe\u50cf\u5904\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"OPenCV -- \u8ba1\u7b97\u673a\u89c6\u89c9\u5e93&#xff0c;\u4e8e 1999 \u5e74\u5728\u82f1\u7279\u5c14&#xff08;Intel&#xff09;\u542f\u52a8&#xff0c;\u7b2c\u4e00\u4e2a\u7248\u672c\u4e8e 2000 \u5e74\u53d1\u5e03\u3002 OpenCV \u652f\u6301\u591a\u79cd\u00a0\u7f16\u7a0b\u8bed\u8a00&#xff0c;\u5982 C\u3001Python\u3001\u00a0Java\u00a0\u7b49&#xff0c;\u5e76\u53ef\u5728\u4e0d\u540c\u5e73\u53f0\u4e0a\u8fd0\u884c&#xff0c;\u5305\u62ec Windows\u3001Linux\u3001OS X\u3001Android \u548c iOS\u3002\u57fa\u4e8e CUDA \u548c OpenCL \u7684\u9ad8\u901f GPU \u64cd\u4f5c\u63a5\u53e3\u4e5f\u5904\u4e8e\u79ef\u6781\u5f00\u53d1\u4e2d\u3002 OpenCV-Pyth\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/85644.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-27T11:49:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260727114917-6a6745bd682a7.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/85644.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/85644.html\",\"name\":\"OpenCV-Python \u56fe\u50cf\u5904\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-27T11:49:19+00:00\",\"dateModified\":\"2026-07-27T11:49:19+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/85644.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/85644.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/85644.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OpenCV-Python \u56fe\u50cf\u5904\u7406\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OpenCV-Python \u56fe\u50cf\u5904\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/85644.html","og_locale":"zh_CN","og_type":"article","og_title":"OpenCV-Python \u56fe\u50cf\u5904\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"OPenCV -- \u8ba1\u7b97\u673a\u89c6\u89c9\u5e93&#xff0c;\u4e8e 1999 \u5e74\u5728\u82f1\u7279\u5c14&#xff08;Intel&#xff09;\u542f\u52a8&#xff0c;\u7b2c\u4e00\u4e2a\u7248\u672c\u4e8e 2000 \u5e74\u53d1\u5e03\u3002 OpenCV \u652f\u6301\u591a\u79cd\u00a0\u7f16\u7a0b\u8bed\u8a00&#xff0c;\u5982 C\u3001Python\u3001\u00a0Java\u00a0\u7b49&#xff0c;\u5e76\u53ef\u5728\u4e0d\u540c\u5e73\u53f0\u4e0a\u8fd0\u884c&#xff0c;\u5305\u62ec Windows\u3001Linux\u3001OS X\u3001Android \u548c iOS\u3002\u57fa\u4e8e CUDA \u548c OpenCL \u7684\u9ad8\u901f GPU \u64cd\u4f5c\u63a5\u53e3\u4e5f\u5904\u4e8e\u79ef\u6781\u5f00\u53d1\u4e2d\u3002 OpenCV-Pyth","og_url":"https:\/\/www.wsisp.com\/helps\/85644.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-27T11:49:19+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260727114917-6a6745bd682a7.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/85644.html","url":"https:\/\/www.wsisp.com\/helps\/85644.html","name":"OpenCV-Python \u56fe\u50cf\u5904\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-27T11:49:19+00:00","dateModified":"2026-07-27T11:49:19+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/85644.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/85644.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/85644.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"OpenCV-Python \u56fe\u50cf\u5904\u7406"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/85644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=85644"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/85644\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/85641"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=85644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=85644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=85644"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=85644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}