Skip to content

Instantly share code, notes, and snippets.

@osolmaz
osolmaz / gist:cc5a868f0636c18396e0
Created May 10, 2014 16:41
Unix command to list top 20 directories you cd into
history | grep cd | cut -d' ' -f5 | sort | uniq -c | sort -k1 -n -r | head -n 20
void blendWithMask(cv::Mat &base, cv::Mat &src, cv::Mat &mask, cv::Mat &out){
char ch = base.channels();
double alpha = 0;
for( int y = 0; y < base.rows; y++ ){
uchar* pBS = base.ptr<uchar>(y);
uchar* pSR = src.ptr<uchar>(y);
uchar* pMK = mask.ptr<uchar>(y);
uchar* pOU = out.ptr<uchar>(y);
for( int x = 0; x < base.cols*ch; x++ ){
int ix = x / ch;