Keep Sharp

Android Coordinates: Camera, OpenCV in JNI, Canvas

This tip is about camera related coordinate system in android. When i develop camera related apps, inside onPreviewFrame() i need to do image processing on byte[] data and show results on top of the canvas and i use OpenCV for the image processing in jni. So the whole workflows is ...

Select PyQt4 rectangle by edge/stroke

This tip is about how to make pyqt4 rectangle selectable by its edge (or you call it stroke), by default it's selectable by inner area. To achieve this, basically you need to subclass QGraphicsRectItem and overwrite its shape() function so that its shape is not an area but a ...

Update Matplotlib Plot

This tip is about how to update matplotlib plot, it is based on this great tutorial: Speeding up Matplotlib

I learned two ways of updating matplotlib plot, both require first manually change the content of objects that to be updated. For example, lineObj.set_ydata() for line object, vlinesObj.set_paths() for ...

Debug Python code using Wingdb

This tip is about using wingide 's debugger to debug your python code. Sometimes the python code can run from terminal but not from wingide ui, it mostly is because the python related environmental variable settings are different when python kernel is start from terminal and from wingide. In this ...