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 <vector> | |
#include <opencv2/opencv.hpp> | |
#include <opencv2/nonfree/nonfree.hpp> | |
#include <opencv2/legacy/legacy.hpp> | |
#include <boost/random.hpp> | |
#include <boost/format.hpp> | |
#include "KAZE.h" | |
#include "config.h" | |
#include "utils.h" |
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 <vector> | |
#include <opencv2/opencv.hpp> | |
#include <opencv2/nonfree/nonfree.hpp> | |
#include <opencv2/legacy/legacy.hpp> | |
#include <boost/random.hpp> | |
#include <boost/format.hpp> | |
#include "KAZE.h" | |
#include "config.h" | |
#include "utils.h" |
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 <glog/logging.h> | |
void func() | |
{ | |
throw; | |
} | |
int main(int argc, char *argv[]) | |
{ | |
//google glogの初期化 |
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 <random> | |
#include <algorithm> | |
#include <boost/format.hpp> | |
#include <xmmintrin.h> | |
#include <immintrin.h> | |
#include <osakana/stopwatch.hpp> |
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 <random> | |
int main() | |
{ | |
std::vector<int> prob = {1, 9, 25, 25, 30, 9, 1}; | |
const std::string str[] = {"大吉", "中吉", "小吉", "吉末", "吉", "凶", "大凶"}; | |
std::mt19937 rng; | |
//出現確率を累積に変換 |
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 <random> | |
int main() | |
{ | |
std::vector<int> prob = {1, 9, 25, 25, 30, 9, 1}; | |
const std::string str[] = {"大吉", "中吉", "小吉", "吉末", "吉", "凶", "大凶"}; | |
std::mt19937 rng; | |
std::discrete_distribution<int> dst(prob.begin(), prob.end()); |
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
# Construct 2-row ndarray | |
>>> a = numpy.random.randint(0, 100, (2, 10)) | |
>>> a | |
array([[95, 31, 25, 68, 88, 25, 71, 55, 16, 14], | |
[57, 59, 38, 30, 78, 92, 30, 47, 89, 41]]) | |
# Extract columns whose 1st row is larger than the 2nd. | |
>>> a[:, a[1] < a[0]] | |
array([[95, 68, 88, 71, 55], | |
[57, 30, 78, 30, 47]]) |
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
# Construct 2-column ndarray | |
>>> a = numpy.random.randint(0, 100, (10, 2)) | |
>>> a | |
array([[29, 1], | |
[33, 36], | |
[79, 32], | |
[72, 52], | |
[30, 9], | |
[33, 85], | |
[72, 29], |
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 numpy | |
from benchmarker import Benchmarker | |
N = 10 ** 8 | |
with Benchmarker(1000) as bench: | |
@bench('col-proposed') | |
def _(bm): | |
a = numpy.random.randint(0, 100, (2, N)) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import numpy | |
import skimage.io | |
from PySide.QtGui import * | |
skimg = skimage.io.imread('imgfile.jpg') | |
# convert to QImage (skimg can be grayscale or rgb) |
OlderNewer