Some of the legacy modules like Horn Schunck Optical Flow in OpenCV 2.4 are located in “cv” instead of “cv2″ .
To be cross-platform compatible, instead of doing
I suggest doing
from cv2 import cv
Further, in Windows running Anaconda Python 2.7 (or whatever Python 2.7 you choose), OpenCV is not installable through conda.
To install OpenCV 2.4 for Python on Windows, do the following:
download OpenCV for Windows, version 2.4
- Extract to a directory of your choice, let’s say c:\opencv and copy the file
If you’re using CPython instead of Anaconda, copy to that directory instead.
I found myself wanting a recursive pattern search in Python like GNU Find.
I made a simple implementation using os.walk and glob.
It may be possible to add more features like min/max depth of recursion, just ask me if you’d like something more.
You can use the freeimage plugin to SciPy as one method. On Windows you might see the error:
RuntimeError: Could not find a FreeImage library
To fix this, download the FreeImge DLL from
Then extract the file
to the following directory (assuming you’re using Anaconda Python)
Example code (assuming you have image stored in C-ordered 3-D array images):
from skimage.io._plugins import freeimage_plugin as freeimg
More details to come, but I was comparing the performance of OpenCV to Matlab Computer Vision Toolbox for the dense estimates of optical flow given by the Horn Schunck algorithm. I was getting a very different result with OpenCV vs. Matlab for the Optical Flow Estimation. It seemed that OpenCV was washing out fine details in the optical flow. After carefully comparing Matlab Computer Vision and OpenCV outputs for Horn Schunck optical flow, I found that the default lambda/smoothness parameter of 1.0 for cv.CalcOpticalFlowHS is not the same as what Matlab calls 1.0.
I need to quantify this further, but for now I found that in OpenCV cv.CalcOpticalFlowHS setting lambda=0.001 gives results that are much more like Matlab–I can see the fine details. This is just a rough guess, if I have time I’ll quantify it in my forthcoming article on segmenting terabtyes of aurora borealis video in an hour!
Marie, we had talked about acoustics on Thursday. I did not receive your text. Please reply via email firstname.lastname@example.org or comment here. (Comments are moderated, so only I will see). Thank you.
When using Matplotlib in Anaconda 3, and if you’re trying to use QT4Agg, you may get the error message
ImportError: No module named 'PySide'
To fix this, you can try (using your Anaconda3 pip)
pip install pyside
This will take several minutes and may require the prerequisites:
sudo apt-get install libxext-dev python-qt4 qt4-dev-tools build-essential
The current Yocto kernel distro available for the Intel Edison (version 68 by
configure_edison --version) does not include the FTDI driver. Thus when you plug a USB-serial adapter into the USB OTG host port, you’ll see it partially recognized in
dmesg tail upon plugin, but you won’t see an assignment to a /dev/ttyUSB_ device.
You need to install the FTDI kernel module first.
opkg install kernel-module-ftdi-sio
This assumes you have already setup the unofficial opkg repository.
Now when you type
dmesg tail you’ll see the line something like
usb: FTDI USB Serial Device converter now attached to ttyUSB0
You may have to update your kernel if this doesn’t work.
If you don’t have a graphical desktop, BU’s Enterprise Wifi requires the following manual settigns. The settings below are from BU’s recommended settings.
Their webpage has now been updated per my suggestion.
# nano /etc/wpa_supplicant/wpa_supplicant.conf
paste at the end
eap=TTLS PEAP MSCHAPV2
identity=”Your BU login”
password=”your Kerberos Password: be aware others can read this file!”
This results in the feedback upon successful connection:
# wpa_cli -i wlan0 status
Supplicant PAE state=AUTHENTICATED
EAP TLS cipher=DHE-RSA-AES256-SHA
EAP-TTLSv0 Phase2 method=MSCHAPV2
Short answer: Use ShareLatex
1) ShareLatex is much faster to compile. I have a 30 page journal article draft with numerous figures, and WriteLatex seems to take on the order of a minute to compile while ShareLatex was substantially less.
2) ShareLatex has far better error/warning feedback and a much better IDE overall. WriteLatex error/warnings keep disappearing and the line number with error is not clearly indicated.
3) ShareLatex is open-source. WriteLatex is NOT open source.
If you’re looking for a Python function that works like Matlab’s “findpeaks” checkout SciPy argrelmax.
If you want to do a comparison in the same code, you can call Octave findpeaks using Oct2Py, or use the Matlab Python API in Matlab R2014b