-
Download OpenCV pre-built binaried from SourceForge;
-
Set the output path of self-extracting archive to
D:\Bin
, and all the files will be extracted toD:\Bin\opencv
; -
Copy
cv2.pyd
from%OPENCV%\build\python\2.7
to%PYTHON%\Lib\site-packages
. Link in the OpenCV official site. Run Python to check whether it's been installed:Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32
This file contains hidden or 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
It's a pita. |
This file contains hidden or 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
function runGui() | |
chosenFile = ''; | |
defScalingStr = {'2.0', '3.0', '4.0'}; | |
function btnLoad_click(hObj, event) | |
[fileName, pathName] = uigetfile({ ... | |
'*.bmp; *.png', 'Image Files (*.bmp,*.png)'; ... | |
'*.*', 'All Files (*.*)'}, ... | |
'Select an image'); |
Here is the note for how I configured Matlab to build mex C/C++ extensions on 64-bit Windows 8:
At first, mex
failed to find a compiler:
>> mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? y
In cmd.exe
,
> set CABAL="D:\Program Files (x86)\Haskell Platform\2013.2.0.0\lib\extralibs\bin"
> cd %CABAL%
> cabal install hakyll
cabal: The program ghc version >=6.4 is required but it could not be found.
That didn't make sense as the Haskell Platform on this computer was newly installed:
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
/******** | |
func(1, 1); -> 1 | |
func(1, 3); -> 1 2 3 2 1 | |
func(1, 6); -> 1 2 3 4 5 6 5 4 3 2 1 | |
`func` should be implemented without any loop, if-statement or | |
conditional operation. |
This file contains hidden or 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
xRange = [2, 3] | |
yRange = [4..6] | |
lComprehension = [[(x, y) | y <- yRange] | x <- xRange] | |
lOperator = xRange >>= (\x -> [yRange >>= \y -> [(x, y)]]) | |
lNestedDo = do | |
x <- xRange | |
return $ do | |
y <- yRange |
This file contains hidden or 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
{ | |
"cmd": ["D:\\Program Files\\Sublime Text 2.0.2\\Data\\Packages\\Haskell\\run-ghci.bat", "$file"], | |
"file_regex": "^(...*?):([0-9]*):?([0-9]*)", | |
"shell":true, | |
"selector": "source.haskell" | |
} |
This file contains hidden or 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
% The inner matrix can be computed by double centering the | |
% squared distance matrix. | |
% This script verifies this inner matrix actually refers to the | |
% centroid of all points as the origin. | |
approxeq = @(A, B) sum(sum(abs(A - B))) < 1e-6; | |
nDims = 5; | |
n = 4; | |
X = rand(nDims, n); |
This file contains hidden or 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
% Generates test data | |
nPoints = 20; | |
nBins = 6; | |
nImages = 72; | |
shapeContexts = cell(nImages, 1); | |
for i = 1:nImages | |
sc = zeros(nPoints, nBins); | |
for j = 1:nPoints |