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 as np | |
from keras.utils import np_utils | |
from keras.models import Sequential | |
from sklearn.model_selection import train_test_split | |
import glob | |
from keras.preprocessing.image import load_img, img_to_array | |
from keras.initializers import TruncatedNormal, Constant | |
from keras.layers import Dropout, Flatten, Conv2D, MaxPooling2D, Dense, BatchNormalization | |
from keras.optimizers import SGD |
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 as np | |
from keras.models import model_from_json | |
from keras.preprocessing.image import load_img, img_to_array | |
# ------------------------------------------------------------------------------------- | |
# モデルの読み込み部 | |
# ------------------------------------------------------------------------------------- | |
# 入力画像サイズ - 訓練時の画像サイズと合わせる | |
INPUT_IMAGE_SIZE = 224 |
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 <opencv2/opencv.hpp> | |
#include <iostream> | |
int main(int argc, char* argv[]) { | |
int col_num = 11; // 列方向の分割数 | |
int row_num = 7; // 行方向の分割数 | |
cv::Mat input_image = cv::imread("test1.jpg"); // 分割する画像の取得 | |
if (input_image.empty() == true) { |
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 <opencv2/opencv.hpp> | |
#include <ctime> | |
std::string input_image_name = "test.jpg"; | |
int lbp_weights[8] = {128, 64, 32, 16, 8, 4, 2, 1}; | |
int main(int argc, char* argv[]) { | |
// 入力画像の取得 |
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
__global__ void convertToGray(uchar3 *color_pixel, unsigned char* gray_pixel) { | |
int ID = blockIdx.x*blockDim.x + threadIdx.x; | |
// カラーからグレースケール変換を実施 | |
gray_pixel[ID] = | |
(unsigned char)(0.299f*color_pixel[ID].x | |
+ 0.587f*(float)color_pixel[ID].y | |
+ 0.114f*(float)color_pixel[ID].z); | |
} |
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
ffmpeg -safe 0 -f concat -i movielists.txt -c copy output.mp4 |
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
// クライアント側 WinSock2 | |
#include <stdio.h> | |
#include <winsock2.h> | |
#include <ws2tcpip.h> | |
#include <iostream> | |
int main() { | |
char server_ip_addr[32]; |
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 <opencv2/opencv.hpp> | |
#include <opencv2/superres/optical_flow.hpp> | |
int main(int argc, char* argv[]) | |
{ | |
// オプティカルフローの計算手法の決定 | |
//cv::Ptr<cv::superres::DenseOpticalFlowExt> opticalFlow = cv::superres::createOptFlow_Farneback(); // Franeback | |
cv::Ptr<cv::superres::DenseOpticalFlowExt> opticalFlow = cv::superres::createOptFlow_DualTVL1(); // TVL1 | |
// Optical Flowを計算する前後2フレームを保存するMat |
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
\documentclass{article} | |
\usepackage{xcolor} | |
\begin{document} | |
\section*{Color test} | |
\noindent | |
\textcolor{black}{testBlack} \\ | |
\textcolor{darkgray}{testDarkgray} \\ |
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
\documentclass{article} | |
\usepackage{color} | |
\begin{document} | |
\section*{Color test 2} | |
\textcolor[rgb]{0.1, 0.5, 0.1}{test} | |
\textcolor[rgb]{0.8, 0.5, 0.3}{test} | |
\textcolor[rgb]{0.7, 0.4, 0.9}{test} |