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
// Read https://en.wikipedia.org/wiki/Otsu%27s_method (added this since JS examples in wikipedia didn't work) | |
function otsu(histData /* Array of 256 greyscale values */, total /* Total number of pixels */) { | |
let sum = 0; | |
for (let t=0 ; t<256 ; t++) sum += t * histData[t]; | |
let sumB = 0; | |
let wB = 0; | |
let wF = 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
var RED_INTENCITY_COEF = 0.2126; | |
var GREEN_INTENCITY_COEF = 0.7152; | |
var BLUE_INTENCITY_COEF = 0.0722; | |
//var canvas = document.createElement('CANVAS'); | |
var canvas = document.getElementById('viewport'); | |
var ctx = canvas.getContext('2d'); | |
var img = new Image; |
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
// OpenCV imports | |
#include <opencv2/imgproc/imgproc.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
// C++ imports | |
#include <iostream> | |
// namespaces | |
using namespace std; | |
using namespace cv; |
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
'use strict'; | |
var Octokat = require('octokat'); | |
var extend = require('lodash/object/assign'); | |
var defaults = { | |
branchName: 'master', | |
token: '', | |
username: '', | |
reponame: '' |
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
// Example showing how to patch Kubernetes resources. | |
package main | |
import ( | |
"fmt" | |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |
"k8s.io/apimachinery/pkg/runtime/schema" | |
"k8s.io/client-go/dynamic" | |
_ "k8s.io/client-go/plugin/pkg/client/auth" |
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
//set up the object with the api details | |
function GitHubCommit(api, owner, repo, ref) | |
{ | |
this.api = api; | |
this.repo = { | |
owner: owner, | |
repo: repo, | |
ref: ref | |
} | |
} |
OlderNewer