Wednesday, January 20, 2016

SqlAlchemy notes

Source

  1. Hybrid property/method : when invoked through an instance returns some value but for class based invocation returns sql.
  2. Alembic - for migrations
  3. Reflection - for loading table structure from DB
  4. SqlAlchemy Core - has sum/count/order by/group by etc sql equivalents.
  5. Session states for an object - Transient/Pending/Persistent/Detached
  6. session.expunge() for removing an object from session
  7. SqlAlchemy ORM is different from core
  8. (Core) ResultProxy - you can iterate through the resultset using indices or key/value both
  9. Association proxy : For e.g. many-to-many relationship in Cookie-Ingredient and you just want to create ingredients for a cookie or just want to fetch ingredients' names. With AP you can do it easily without looping through stuff.
  10. sqlacodegen - something about reflection 

Wednesday, January 6, 2016

opencv notes - circle/line detection

edge detection : Imgproc.Canny
line detection : Imgproc.HoughLinesP and Imgproc.HoughLines
circle detection : Imgproc.HoughCircles

Tuesday, January 5, 2016

OpenCV notes - Edge detection

edge detection using gaussian and-laplacian pyramids

OpenCV implements the relevant downsizing and upsizing functions as cv2.pyrDown and cv2.pyrUp.

OpenCV notes - Eulerian video magnification

A demo : http://www.extremetech.com/extreme/149623-mit-releases-open-source-software-that-reveals-invisible-motion-and-detail-in-video

Python implementation : https://github.com/brycedrennan/eulerian-magnification

Fourier transform for dummies

http://math.stackexchange.com/a/72479/13811

http://betterexplained.com/articles/an-interactive-guide-to-the-fourier-transform/

OpenCV notes - Optical Flow

Optical Flow - for e.g. tracking how far an object has moved from
current position. For e.g. tracking a nod/shake of a face.

OpenCV's calcOpticalFlowPyrLK function implements the Lucas-Kanade
method of computing optical flow.

OpenCV function called goodFeaturesToTrack, selects features based on
the algorithm described below :

As the name suggests, the Good Features to Track algorithm (also known
as the Shi-Tomasi algorithm) attempts to select features that work
well with the algorithms of tracking and the use cases of tracking.

Monday, January 4, 2016

Blog Archive