Ads

Tampilkan postingan dengan label Tutorial Python. Tampilkan semua postingan
Tampilkan postingan dengan label Tutorial Python. Tampilkan semua postingan

Sabtu, 12 Mei 2018

Access webcam camera with OpenCV Python


Access webcam camera with OpenCV python - this time admin posts How to Access webcam cameras using openCV in python.
This tutorial is the basic of OpenCV, which is accessing the camera / webcam. Camera access is an important aspect in using opencv itself. Because opencv itself is more often to access a camera / webcam. Here the admin uses a logitech camera and uses python version 3. Can also access from laptop webcam default. Just look at the source code below.


Source Code :


import cv2 #untuk memanggil komponen opencv python

videoCam = cv2.VideoCapture(0) #webcam / kamera yang digunakan
videoCam.set(cv2.CAP_PROP_FRAME_WIDTH,720) # panjang panel kamera
videoCam.set(cv2.CAP_PROP_FRAME_HEIGHT,480) # lebar panel kamera
while True:
    cond, frame = videoCam.read() # membaca kondisi apabila frame sudah ada

    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # cara mengkonvert gambar BGR ke Mode Gray
    cv2.imshow('Original Video', frame) # menampilkan video aslinya
    cv2.imshow('Gray Video', gray) # menampilkan video asli dengan efek gray

    k = cv2.waitKey(1) & 0xff
    if k == ord('q'): # jika menekan Q maka program akan exit.
        break

videoCam.release()
cv2.destroyAllWindows()


Note :
If using 2 cameras, change the number 1 or 0 on VideoCapture (1)

Screenshot Program Result :


Senin, 26 Maret 2018

INSTALL OPENCV PYTHON IN WINDOWS

 

How to Install OpenCV Python Windows - this time the admin posts How to Install OpenCv Python easily and quickly. only use CMD on windows.
OpenCV (Open Source Computer Vision Library) is a software library aimed at real-time dynamic image processing, created by Intel, and now supported by Willow Garage and Itseez. This program is free and is under the auspices of an open source of BSD licenses. This library is a cross platform library. This program is dedicated in large part to real-time image processing. If this library finds the library of Integrated Performance Primitives from Intel in a computer system, then this program will use this routine to speed up the process of working this program automatically.
Python is a multipurpose interpretive programming language with a design philosophy that focuses on the level of code readability. Python is claimed to be a language that combines capabilities, capabilities, with very clear code syntax, and is equipped with a large and comprehensive standard library functionality. Python is also supported by a large community.
Currently python code can be run on a variety of operating system platforms, some of which are Linux / Unix, Windows, Mac OS X, Java Virtual Machine, OS / 2, Amiga, Palm, Symbian

Screenshot :



Bahan yang dibutuhkan :

  • Internet
  • Latest version of Python 2/3
  • PC / Laptop for sure
  • A cup of coffee to be excited


Download Link :
- Python
[ Download ]

How to Install :
1. Install Python Jangan lupa centang "Add Python to Path"
2. open CMD 
3. type "pip install --upgrade pip" 
4. "pip install wheel" 
5. install open cv by typing "pip install opencv-python" 
6. install contrib opencv "pip install opencv-contrib-python" 
7. done :D
8. If you are still confused, see Tutorial Video below.