{"id":12453,"date":"2021-08-12T12:35:03","date_gmt":"2021-08-12T12:35:03","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=12453"},"modified":"2021-09-02T12:53:26","modified_gmt":"2021-09-02T12:53:26","slug":"dcm900-digital-camera-for-microscope","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=12453","title":{"rendered":"DCM900 Digital Camera for Microscope"},"content":{"rendered":"<h3>OpenCV Enumerate Cameras<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/34197825\/c-opencv-2-4-11-list-all-cameras\">C++ OpenCV 2.4.11: List all cameras<\/a><br \/>\n<a href=\"https:\/\/github.com\/opencv\/opencv\/issues\/4269\">Add API to enumerate cameras #4269<\/a><\/p>\n<h3>VLC DirectShow<\/h3>\n<table>\n<tr>\n<td>\n<a href=\"http:\/\/blog.bachi.net\/wp-content\/uploads\/2021\/08\/directshow.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.bachi.net\/wp-content\/uploads\/2021\/08\/directshow-300x245.png\" alt=\"\" width=\"300\" height=\"245\" class=\"alignleft size-medium wp-image-12458\" srcset=\"https:\/\/blog.bachi.net\/wp-content\/uploads\/2021\/08\/directshow-300x245.png 300w, https:\/\/blog.bachi.net\/wp-content\/uploads\/2021\/08\/directshow.png 530w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n<\/td>\n<\/tr>\n<\/table>\n<h3>Python DirectShow<\/h3>\n<p><a href=\"https:\/\/github.com\/andreaschiavinato\/python_grabber\">github.com\/andreaschiavinato\/python_grabber<\/a><br \/>\n<a href=\"https:\/\/www.codeproject.com\/Articles\/1274094\/Capturing-Images-from-Camera-using-Python-and-Dire\">Capturing Images from Camera using Python and DirectShow<\/a><\/p>\n<p><a href=\"https:\/\/www.codeproject.com\/Articles\/5163142\/List-Capture-Devices-for-Python-OpenCV-on-Windows\">List Capture Devices for Python OpenCV on Windows<\/a><\/p>\n<h4>ULARGE_INTEGER<\/h4>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/48440040\/what-ctypes-types-to-use-with-word-and-dword-definitions\">What ctypes types to use with WORD and DWORD definitions<\/a><\/p>\n<h3>Python OpenCV<\/h3>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport numpy as np\r\nimport cv2\r\n\r\ndef show_pic():\r\n\r\n    i: int = 0\r\n\r\n    while True:\r\n        cap = cv2.VideoCapture(i)\r\n\r\n        if not cap.isOpened():\r\n            print(f&quot;Cannot open camera {i}&quot;)\r\n\r\n        else:\r\n            while True:\r\n                ret, frame = cap.read()\r\n\r\n                if not ret:\r\n                    print(f&quot;Can't receive frame (stream end?) from camera {i}. Exiting ...&quot;)\r\n                    break\r\n                else:\r\n                    print(f&quot;Frame receive from camera {i}&quot;)\r\n                    break\r\n\r\n        cap.release()\r\n        i += 1\r\n\r\n        if i &gt; 20:\r\n            break\r\n\r\nif __name__ == '__main__':\r\n    show_pic()\r\n\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nCannot open camera 0\r\nCannot open camera 1\r\nCannot open camera 2\r\nCannot open camera 3\r\nCannot open camera 4\r\nCannot open camera 5\r\nCannot open camera 6\r\nCannot open camera 7\r\nCannot open camera 8\r\nFrame receive from camera 9\r\nCannot open camera 10\r\nCannot open camera 11\r\nCannot open camera 12\r\nCannot open camera 13\r\nFrame receive from camera 14\r\nCannot open camera 15\r\nCannot open camera 16\r\nCannot open camera 17\r\nCannot open camera 18\r\nCannot open camera 19\r\nCannot open camera 20\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;\r\n  0: 'ScopeTek DCM130BW',\r\n  1: 'ScopeTek DCM130E',\r\n  2: 'ScopeTek DCM200',\r\n  3: 'ScopeTek DCM310', \r\n  4: 'ScopeTek DCM35E',\r\n  5: 'ScopeTek DCM500',\r\n  6: 'ScopeTek DCM500BW',\r\n  7: 'ScopeTek DCM510',\r\n  8: 'ScopeTek DCM800',\r\n  9: 'ScopeTek DCM900',\r\n 10: 'ScopeTek MDC140BW',\r\n 11: 'ScopeTek MDC200',\r\n 12: 'ScopeTek MDC320',\r\n 13: 'ScopeTek MDC560',\r\n 14: 'OBS Virtual Camera'\r\n]\r\n<\/pre>\n<h3>Linux<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nidVendor=0547 idProduct=4d90\r\n\r\n0547  Anchor Chips, Inc.\r\n\t4d90  AmScope MD1900 camera\r\n<\/pre>\n<p><a href=\"http:\/\/www.linux-usb.org\/usb.ids\">usb.ids<\/a><br \/>\n<a href=\"https:\/\/siliconpr0n.org\/wiki\/doku.php?id=microscope:start\">microscope:start<\/a><br \/>\nAmScope\/TopuTek\/ScopeTek does provide libusb drivers though, so you could make a custom application.<\/p>\n<p><a href=\"https:\/\/github.com\/JohnDMcMaster\/uvscada\/\">github.com\/JohnDMcMaster\/uvscada\/<\/a><\/p>\n<h3>v4l2<\/h3>\n<p><a href=\"https:\/\/gist.github.com\/fernandoremor\/8d9efb81e25360ab38245c8e96d870c8\">python v4l2 webcam capture test<\/a><br \/>\n<a href=\"http:\/\/trac.gateworks.com\/wiki\/linux\/v4l2\">Linux Video4Linux2 API (v4l2)<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/4290834\/how-to-get-a-list-of-video-capture-devices-web-cameras-on-linux-ubuntu-c\">How to get a list of video capture devices (web cameras) on linux ( ubuntu )? (C\/C++)<\/a><br \/>\n<a href=\"https:\/\/developer.ridgerun.com\/wiki\/index.php?title=How_to_Capture_Frames_from_Camera_with_OpenCV_in_Python\">How to Capture Frames from Camera with OpenCV in Python<\/a><\/p>\n<h3>keyboard<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nconda install -c conda-forge keyboard\r\n<\/pre>\n<h3>pygame<\/h3>\n<p><a href=\"https:\/\/www.pygame.org\/docs\/tut\/CameraIntro.html\">Camera Module Introduction<\/a><\/p>\n<p><a href=\"https:\/\/anaconda.org\/cogsci\/pygame\">anaconda.org\/cogsci\/pygame<\/a><br \/>\n<a href=\"https:\/\/anaconda.org\/jiayi_anaconda\/pygame\">anaconda.org\/jiayi_anaconda\/pygame<\/a><\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/19636480\/installation-of-pygame-with-anaconda\">Installation of pygame with Anaconda<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/pygame\/pygame\/issues\/1953\">Conda Support for 1.9.6 and 2.0.0.dev10 #1953<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npython -m pip install -U pygame --user\r\npython -m pip uninstall pygame\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>OpenCV Enumerate Cameras C++ OpenCV 2.4.11: List all cameras Add API to enumerate cameras #4269 VLC DirectShow Python DirectShow github.com\/andreaschiavinato\/python_grabber Capturing Images from Camera using Python and DirectShow List Capture Devices for Python OpenCV on Windows ULARGE_INTEGER What ctypes types to use with WORD and DWORD definitions Python OpenCV import numpy as np import cv2 [&hellip;]<\/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-12453","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/12453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12453"}],"version-history":[{"count":12,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/12453\/revisions"}],"predecessor-version":[{"id":12660,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/12453\/revisions\/12660"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}