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
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import cm | |
def get_transfer_mat(N, p, q): | |
""" | |
Calculating the transition matrix P with shape (N, N). | |
P_ij: the transition probability of two states: |
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
sudo rm -rf Python-3.8.6 | |
tar -xzf Python-3.8.6.tgz | |
cd Python-3.8.6 | |
export LD_LIBRARY_PATH=/usr/local/lib | |
export LD_RUN_PATH=/usr/local/lib | |
./configure --enable-optimizations --prefix=/usr/local\ | |
--enable-shared --enable-loadable-sqlite-extensions\ | |
CPPFLAGS="-I/usr/local/include -I/usr/local/include/openssl"\ | |
LDFLAGS="-L/usr/local/lib -L/usr/local/lib/openssl" |
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
import numpy as np | |
from scipy import ndimage | |
import matplotlib.pyplot as plt | |
x = np.zeros((30, 30)) | |
x[10, 10] = 1 | |
x[20, 10] = 1 | |
x[10, 20] = 1 |
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
p1 = np.random.random((100, 2)) # feature points in camera 1 | |
p2 = np.random.random((100, 2)) # feature points in camera 1 | |
# camera matrices | |
k1 = np.random.random((3, 3)) | |
k2 = np.random.random((3, 3)) | |
# Method 1: calculate essential matrix (E) from the fundamental matrix (F) |
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
#!/usr/bin/env python3 | |
""" | |
This script demonstrated the way to link positions into trajectories | |
and then calculate the MSD | |
""" | |
import numpy as np | |
import trackpy as tp | |
from itertools import product | |
import matplotlib.pyplot as plt | |
import pandas as pd |
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
#!/usr/bin/env python3 | |
""" | |
This script demonstrated the way to use low-level `link_iter` api | |
from `trackpy` to link two successive frames. | |
""" | |
import numpy as np | |
import trackpy as tp | |
from itertools import product | |
import matplotlib.pyplot as plt | |
from matplotlib import cm |
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 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 <iostream> | |
#include <vector> | |
using namespace std; | |
using VVI = vector<vector<int>>; | |
template<class T> | |
void recursive_product( | |
const vector<vector<T>>& arrays, vector<vector<T>>& result, int idx=0 |
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
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options | |
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full. | |
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}… | |
Getting help: | |
-h — print basic options | |
-h long — print more options | |
-h full — print all options (including all format and codec specific options, very long) |
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
import json | |
import base64 | |
import numpy as np | |
from io import BytesIO | |
# save data to the binary string | |
a = np.random.uniform(0, 255, (1500, 1500)).astype(np.uint8) | |
f = BytesIO() | |
np.savez_compressed(f, data=a) |
NewerOlder