{"id":147,"date":"2020-10-09T18:56:25","date_gmt":"2020-10-09T22:56:25","guid":{"rendered":"http:\/\/elin66.com\/?p=147"},"modified":"2025-11-07T21:39:05","modified_gmt":"2025-11-08T02:39:05","slug":"a-very-basic-camera-test-code-on-opencv","status":"publish","type":"post","link":"https:\/\/elin.website\/index.php\/2020\/10\/09\/a-very-basic-camera-test-code-on-opencv\/","title":{"rendered":"A very basic camera test code on OpenCV"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">import numpy as np\nimport cv2\n\ncap = cv2.VideoCapture(0)\ncap.set(3,640) # set Width\ncap.set(4,480) # set Height\n \nwhile(True):\n    ret, frame = cap.read()\n    \n    cv2.imshow('frame', frame)\n    \n    k = cv2.waitKey(30) &amp; 0xff\n    if k == 27: # press 'ESC' to quit\n        break\n\ncap.release()\ncv2.destroyAllWindows()<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>import numpy as np import cv2 cap = cv2.VideoCapture(0) cap.set(3,640) # set Width cap.set(4,480) # set Height while(True): ret, frame = cap.read() cv2.imshow(&#8216;frame&#8217;, frame) k = cv2.waitKey(30) &amp; 0xff if k == 27: # press &#8216;ESC&#8217; to quit break cap.release() cv2.destroyAllWindows()<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/elin.website\/index.php\/wp-json\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elin.website\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elin.website\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elin.website\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elin.website\/index.php\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":1,"href":"https:\/\/elin.website\/index.php\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":456,"href":"https:\/\/elin.website\/index.php\/wp-json\/wp\/v2\/posts\/147\/revisions\/456"}],"wp:attachment":[{"href":"https:\/\/elin.website\/index.php\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elin.website\/index.php\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elin.website\/index.php\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}