Posts

OpenCv Python Image process: Image

cv2.imread() , cv2.imshow() , cv2.imwrite() Second argument is a flag which specifies the way image should be read. cv2.IMREAD_COLOR : Loads a color image. Any transparency of image will be neglected. It is the default flag. cv2.IMREAD_GRAYSCALE : Loads image in grayscale mode cv2.IMREAD_UNCHANGED : Loads image as such including alpha channel import numpy as np import cv2 # Load an color image in grayscale img = cv2 . imread ( 'messi5.jpg' , 0 ) cv2 . imshow ( 'image' , img ) cv2 . waitKey ( 0 ) cv2 . destroyAllWindows () http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_image_display/py_image_display.html

OpenCv Python Image process: Video Capture

To capture a video, you need to create a VideoCapture object cap.read() returns a bool (True/False). cap.isOpened() . If it is True, OK. Otherwise open it using cap.open() . cap.get(propId) frame = cv2 . flip ( frame , 0 ) http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture-get http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_image_display/py_image_display.html http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_image_display/py_image_display.html import numpy as np import cv2 cap = cv2.VideoCapture(0) while(True):     # Capture frame-by-frame     ret, frame = cap.read()     # Our operations on the frame come here     gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)     # Display the resulting frame     cv2.imshow('frame',gray)     if cv2.waitKey(1) & 0xFF == ord('q'):   ...

Opencv Python Image processing: Image show example

import cv2 import numpy as np path = 'C:\Users\mvish\Pictures\Logitech Webcam\Picture 5.jpg' img  = cv2.imread(path,0) cv2.imshow('image',img) cv2.waitKey(0) cv2.destroyAllWindows()

Opencv Python

http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_setup/py_intro/py_intro.html#intro http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_image_display/py_image_display.html Numpy: http://scipy.github.io/old-wiki/pages/Numpy_Example_List

Django Processes a Request

Django Processes a Request when we run the Django development server and make requests to Web pages: The command python manage.py runserver imports a file called settings.py from the same directory. This file contains all sorts of optional configuration for this particular Django instance, but one of the most important settings is ROOT_URLCONF. The ROOT_URLCONF setting tells Django which Python module should be used as the URLconf for this Web site. Remember when django-admin.py startproject created the files settings.py and urls.py? Well, the autogenerated settings.py has a ROOT_URLCONF that points to the autogenerated urls.py. Convenient. · When a request comes in—say, a request to the URL /time/—Django loads the URLconf pointed to by the ROOT_URLCONF setting. Then it checks each of the URLpatterns in that URLconf in order, comparing the requested URL with the patterns one at a time, until it finds one that matches. When it finds one that matches, it calls the view function associa...

Python Django 2

Image
Let’s look at what startproject created: mysite/ __init__.py manage.py settings.py urls.py These files are as follows: · __init__.py: A file required for Python treat the directory as a package (i.e., a group of modules) · manage.py: A command-line utility that lets you interact with this Django project in various ways · settings.py: Settings/configuration for this Django project urls.py: The URL declarations for this Django project; a “table of contents” of your Django-powered site A URLconf is like a table of contents for your Django-powered Web site. Basically, it’s a mapping between URL patterns and the view functions that should be called for those URL patterns. It’s how you tell Django, “For this URL, call this code, and for that URL, call that code.” Remember that the view functions need to be on the Python path. urlpatterns = patterns('', (r'^time/$', current_datetime), ) The r in r'^time/$' means that '^time/$ is a ...

Python Django urls:

Django Books: https://djangobook.com/ Installation: http://www.python.org/download/ url patterns: http://www.djangoproject.com/r/python/re-module/.