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
using System; | |
namespace MathUtil | |
{ | |
public class Solver | |
{ | |
static void Main(string[] args) | |
{ | |
// 方程式 | |
// 3x + 2y + z = 10 |
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
/* gist */ | |
.gist .line-number { | |
line-height: 1.625; | |
} |
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
// for Visual Studio | |
#define _CRT_SECURE_NO_WARNINGS | |
#include <iostream> | |
long double wallis_formula(int); | |
int main() { | |
int input_count = 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
using System; | |
namespace ColorConverter | |
{ | |
class CmykColorConverter | |
{ | |
static void Main(string[] args) | |
{ | |
// OpenCV の色表現は BGR なので順番注意 | |
// 論理式としての意味合いが強いため、色の再現性は不明 |
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
using OpenCvSharp; | |
using OpenCvSharp.CPlusPlus; | |
namespace OpenCvSharpSample.Samples | |
{ | |
public class MethodTest | |
{ | |
public static void DetectAnimeFace() | |
{ | |
string fileName = "image.jpg"; |
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
using OpenCvSharp; | |
using OpenCvSharp.CPlusPlus; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace OpenCvSharpSample.Samples | |
{ | |
public class MethodTest | |
{ |
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
using OpenCvSharp; | |
using OpenCvSharp.CPlusPlus; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace OpenCvSharpSample.Samples | |
{ | |
public class MethodTest | |
{ |
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
using OpenCvSharp; | |
using OpenCvSharp.CPlusPlus; | |
using System; | |
namespace OpenCvSharpSample.Samples | |
{ | |
public class MethodTest | |
{ | |
public static void MouseClickCanvasWindow() | |
{ |
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
public static void ChromaKeyCaptureSum(int faceCameraId, int backCameraId, bool putText = true) | |
{ | |
using (var form = new Form()) | |
using (var trackbarHueMin = new TrackbarWithLabel("Hue (min)", 50, 180, 0)) | |
using (var trackbarHueMax = new TrackbarWithLabel("Hue (max)", 70, 180, 0)) | |
using (var trackbarSaturationMin = new TrackbarWithLabel("Saturation (min)", 80, 255, 0)) | |
using (var trackbarSaturationMax = new TrackbarWithLabel("Saturation (max)", 255, 255, 0)) | |
using (var trackbarValueMin = new TrackbarWithLabel("Value (min)", 0, 255, 0)) | |
using (var trackbarValueMax = new TrackbarWithLabel("Value (max)", 255, 255, 0)) | |
using (var faceCapture = new VideoCapture(faceCameraId)) |
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
public static Mat ChromaKey(Mat srcMat, Mat backMat, int hueMin, int hueMax, int saturationMin, int saturationMax, int valueMin, int valueMax, int morphorogyIterations = 1) | |
{ | |
var mask = ColorExtractionMask(srcMat, ColorConversion.BgrToHsv, hueMin, hueMax, saturationMin, saturationMax, valueMin, valueMax); var element = new Mat(); | |
var back = new Mat(); | |
var face = new Mat(); | |
var result = new Mat(); | |
Cv2.MorphologyEx(mask, mask, MorphologyOperation.Close, element, null, morphorogyIterations); | |
Cv2.MorphologyEx(mask, mask, MorphologyOperation.Open, element, null, morphorogyIterations); |