Skip to content

Instantly share code, notes, and snippets.

View alfredplpl's full-sized avatar

Alfred Increment alfredplpl

View GitHub Profile
@alfredplpl
alfredplpl / 5-pi_is_not_in_z.ipynb
Last active April 2, 2022 10:19
5**pi_is_not_in_Z.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alfredplpl
alfredplpl / BagOfFeatures.py
Last active May 12, 2021 03:19
This is a class of Bag-of-Features for OpenCV
import cv2
import numpy as np
class BagOfFeatures:
"""This is a class of Bag-of-Features by K-means for OpenCV"""
codebookSize=0
classifier=None
def __init__(self, codebookSize):
self.codebookSize=codebookSize
self.classifier=cv2.KNearest()
@alfredplpl
alfredplpl / opencv_copyTo.cpp
Created October 16, 2013 13:37
OpenCV: paste a image
cv::Mat image=cv::imread("./image.png",-1);
cv::Rect rect(startColumn,startRow,image.cols,image.rows);
cv::Mat subdst=dst(rect);
image.copyTo(subdst);
@alfredplpl
alfredplpl / createMovie.py
Created November 2, 2019 04:44
Concatenate movies by ffmpeg on Windows. ffmpegで動画をつなぐスクリプト
# License: MIT License
__author__="Alfred Increment"
import glob
import os
import datetime
dt_now = datetime.datetime.now()
dateString=dt_now.strftime('%Y-%m-%d')
@alfredplpl
alfredplpl / STT.cs
Created December 20, 2018 00:38
Speech-To-Text on Unity
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Windows.Speech;
using System.Collections.Generic;
using System.Linq;
public class STT : MonoBehaviour
{
public UnityEngine.UI.Text resultDisplay;
@alfredplpl
alfredplpl / InputTools.py
Created May 30, 2015 03:42
Simple key input with time out on python. タイムアウト付きキー入力。
# -*- coding: utf-8 -*-
# This code is distributed under the 3-Clause BSD license (New BSD license).
# 基本的に作者の名前を書いていただければ、商用利用も可能です。なお、保証はいたしかねます。
__author__ = 'alfredplpl'
# This fucntion can use on Unix systems (Mac or Linux) .
TIMEOUT_VAL=-1
def waitKey(miliseconds):
@alfredplpl
alfredplpl / EmotionalAgent.py
Created November 26, 2017 05:41
自然非言語処理第1日目のソースコード
# coding: UTF-8
__auhtor__="alfredplpl"
#See also:
#https://westus.dev.cognitive.microsoft.com/docs/services/5639d931ca73072154c1ce89/operations/56f23eb019845524ec61c4d7
#http://labs.eecs.tottori-u.ac.jp/sd/Member/oyamada/OpenCV/html/py_tutorials/py_gui/py_video_display/py_video_display.html
import httplib,cv2,json
## constants
No Part Correct Choices
1 1 3 5
1 2 2 5
1 3 5 5
1 4 3 5
1 5 5 5
2 6 4 5
3 7 5 5
4 8 1 5
5 9 3 5
No Part Correct Choices
1 1 1 5
1 2 3 5
1 3 1 5
1 4 1 5
1 5 5 5
2 6 1 5
3 7 5 5
4 8 2 5
5 9 5 5