See the iPython notebook link. In this notebook, you can see various image maniputaion examples using both Python extension of OpenCV2 and Scikit.Image.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import numpy as np | |
import pylab as pl | |
__author__ = 'Takuya Nairihira' | |
def compute_belonging(x, c): | |
dist_NxK = (x**2).sum(axis=1)[:,np.newaxis] - 2. * np.dot(x, c.T) + (c**2).sum(axis=1)[np.newaxis] | |
return dist_NxK.argmin(axis=1) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:85b09af85413fd379d6f77fe2b2d33945a781e80b345de143d1581b69f4d6298" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* No Copyright | |
*/ | |
#include <boost/algorithm/string.hpp> | |
#include <boost/foreach.hpp> | |
#include <boost/shared_ptr.hpp> | |
#include <boost/lexical_cast.hpp> | |
#include <iostream> // NOLINT(readability/streams) | |
#include <fstream> // NOLINT(readability/streams) | |
#include <string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{ "keys": ["ctrl+x", "["], "command": "move_to", "args": {"to": "bof", "extend": false} }, | |
{ "keys": ["ctrl+x", "]"], "command": "move_to", "args": {"to": "eof", "extend": false} }, | |
{ "keys": ["ctrl+shift+2"], "command": "sbp_set_mark" }, | |
{ "keys": ["ctrl+[", "w"], "command": "sbp_kill_ring_save" }, | |
{ "keys": ["ctrl+[", "b"], "command": "move", "args": {"by": "subwords", "forward": false} }, | |
{ "keys": ["ctrl+[", "f"], "command": "move", "args": {"by": "subword_ends", "forward": true} }, | |
{ "keys": ["ctrl+[", "d"], "command": "sbp_delete_word", "args": { "forward": true } }, | |
{ "keys": ["ctrl+[", "backspace"], "command": "sbp_delete_word", "args": { "forward": false } }, | |
{ "keys": ["ctrl+x", "ctrl+w"], "command": "prompt_save_as" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Filename: $HOME/.screenrc | |
# Purpose: Setup file for program "(GNU) screen" | |
# Latest change: Mon Jan 26 10:51:50 CET 2004 | |
# Author: Michael Prokop / <[email protected]> / www.michael-prokop.at | |
# =============================================================== | |
# | |
# =============================================================== | |
# SEE ALSO: | |
# =============================================================== | |
# SCREEN Pages: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
I saw the behaviors as follows:
threading.Thread
andmultiprocessing.Process
do not raise to the main thread.multiprocessing.Pool
andmultiprocessing.pool.ThreadPool
(this is not documented at all) leave zombie threads.
The results show that concurrent.futures
is the best choice for threading and multiprocessing in Python!
I did this experiment on Python 2.7.9, and Python 2.x does not have concurrent.futures
, so I installed it by pip command pip install futures
.
OlderNewer