This file contains 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 <string> | |
#include <mfapi.h> | |
#include <mfidl.h> | |
void listup_webcams() { | |
IMFAttributes *p_attr = NULL; | |
HRESULT hr = MFCreateAttributes(&p_attr, 1); | |
if(FAILED(hr)){ | |
std::cout |
This file contains 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 url(https://fonts.googleapis.com/css?family=Roboto:700); | |
@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@500&display=swap'); | |
* { | |
box-sizing: border-box; | |
} | |
html, body { | |
height: 100%; | |
overflow: hidden; |
This file contains 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 url(https://fonts.googleapis.com/css?family=Roboto:700); | |
* { | |
box-sizing: border-box; | |
} | |
html, body { | |
height: 100%; | |
overflow: hidden; | |
} |
This file contains 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; | |
using System.Runtime.InteropServices; | |
using System.Diagnostics; | |
#region WIN32 TYPES | |
using DWORD = System.UInt64; | |
using HINSTANCE = System.IntPtr; | |
using HHOOK = System.IntPtr; | |
using WPARAM = System.IntPtr; | |
using LPARAM = System.IntPtr; |
This file contains 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 std::time::Instant; | |
fn split(mut n: u128) -> Vec<u8> { | |
let mut elems: Vec<u8> = Vec::new(); | |
while n != 0 { | |
let e = n % 10; | |
elems.push(e as u8); | |
n /= 10; | |
} | |
This file contains 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 <opencv2/opencv.hpp> | |
int main() { | |
// solve the equations below. | |
// x+y+z=6 | |
// x-y-z=-4 | |
// x+y+2z=9 | |
cv::Mat1f coef_mat(3, 4); | |
cv::Mat1f answer(3, 1); |
This file contains 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
extern crate image; | |
use std::env; | |
fn main() { | |
let mut args = env::args(); | |
args.next(); // skip command name | |
let img_path = match args.next() { | |
None => { |
This file contains 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
Texture2D<float4> Input; | |
RWTexture2D<float4> Result; | |
groupshared uint sbuffer[256]; // | |
groupshared float4 dbuffer[256]; // | |
groupshared float2 obuffer[256]; // | |
uint width; // テクスチャの幅 | |
uint height;// テクスチャの高さ | |
[numthreads(32,32,1)] |
This file contains 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 int getThresh() | |
{ | |
int th = 0; //ループ用の閾値 | |
double num1, num2; //画素数 | |
double sum1, sum2; //和 | |
double m1, m2; //平均 | |
double va_b; //クラス間分散の二乗 | |
double max = 0; //va_bの最大値を保存しておく変数 | |
//ヒストグラムを生成していなければ弾く |
This file contains 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 <cmath> | |
#include <vector> | |
#include <fstream> | |
#include <sstream> | |
#include <time.h> | |
#include <iomanip> | |
#include <opencv2/opencv.hpp> | |
#define PAT_ROW 7 // number of rows |
NewerOlder