Skip to content

Instantly share code, notes, and snippets.

View karlphillip's full-sized avatar
🚗

Karl Phillip karlphillip

🚗
View GitHub Profile
@seLain
seLain / gist:8bdf12c7196f3fccafdf067dec2696b2
Last active January 30, 2024 19:45
Fix the thing GitHub keeps saying “This branch is X commits ahead, Y commits behind”
ref stackoverflow:
https://stackoverflow.com/questions/41283955/github-keeps-saying-this-branch-is-x-commits-ahead-y-commits-behind
works by
1. git remote add upstream https://github/upstream/repo.git
2. git pull --rebase upstream master
2.1 git rebase --skip (if the conflicts are not true, skip the patches)
3. git push --force-with-lease origin master
If there are branches to fix
@pjbull
pjbull / SparseInteractions.py
Last active April 18, 2021 12:09
Sparse Interaction Terms for scikit-learn
from sklearn.base import BaseEstimator, TransformerMixin
from scipy import sparse
from itertools import combinations
class SparseInteractions(BaseEstimator, TransformerMixin):
def __init__(self, degree=2, feature_name_separator="_"):
self.degree = degree
self.feature_name_separator = feature_name_separator
@nebgnahz
nebgnahz / README.md
Created August 31, 2016 17:43
OpenCV __cg_jpeg_resync_to_restart
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
error: Process didn't exit successfully: `target/debug/main` (signal: 5, SIGTRAP: trace/breakpoint trap)

Similarly for libTIFF.dylib, etc.

// Autor: Eliezer Emanuel Bernart
// Data: 23/08/2014
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <vector>
// Variáveis de controle
int escala = 15,
qualidade = 75;
@wyudong
wyudong / rgb2cmyk.cpp
Last active January 23, 2024 14:35
OpenCV: From RGB to CMYK
// RGB to CMYK conversion
void rgb2cmyk(cv::Mat& img, std::vector<cv::Mat>& cmyk) {
// Allocate cmyk to store 4 componets
for (int i = 0; i < 4; i++) {
cmyk.push_back(cv::Mat(img.size(), CV_8UC1));
}
// Get rgb
std::vector<cv::Mat> rgb;
cv::split(img, rgb);