{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import cv2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "cap=cv2.VideoCapture(0)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(True, array([[[ 30, 31, 27],\n", " [ 30, 31, 27],\n", " [ 28, 30, 30],\n", " ...,\n", " [165, 165, 165],\n", " [165, 165, 165],\n", " [165, 165, 165]],\n", " \n", " [[ 26, 30, 29],\n", " [ 26, 30, 29],\n", " [ 28, 30, 30],\n", " ...,\n", " [165, 165, 165],\n", " [165, 165, 165],\n", " [165, 165, 165]],\n", " \n", " [[ 30, 33, 24],\n", " [ 30, 33, 24],\n", " [ 30, 30, 30],\n", " ...,\n", " [165, 165, 165],\n", " [157, 166, 164],\n", " [157, 166, 164]],\n", " \n", " ...,\n", " \n", " [[ 80, 80, 81],\n", " [ 80, 80, 81],\n", " [ 81, 81, 81],\n", " ...,\n", " [125, 137, 141],\n", " [116, 130, 128],\n", " [114, 128, 126]],\n", " \n", " [[ 81, 81, 82],\n", " [ 81, 81, 82],\n", " [ 82, 82, 82],\n", " ...,\n", " [ 91, 103, 107],\n", " [ 91, 105, 103],\n", " [102, 116, 114]],\n", " \n", " [[ 83, 81, 82],\n", " [ 84, 82, 83],\n", " [ 84, 83, 79],\n", " ...,\n", " [ 97, 100, 110],\n", " [ 83, 106, 103],\n", " [ 82, 105, 102]]], dtype=uint8))" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "frame=cap.read()\n", "frame" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "while(True):\n", " ret,frame=cap.read()\n", " cv2.imshow('frame',frame)\n", " if(27==cv2.waitKey(25)):\n", " break\n", "# cap.release()\n", "cv2.destroyAllWindows()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.4" } }, "nbformat": 4, "nbformat_minor": 2 }