Skip to content

Instantly share code, notes, and snippets.

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
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
#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) {
#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[]) {
// 入力画像の取得
__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);
}
ffmpeg -safe 0 -f concat -i movielists.txt -c copy output.mp4
// クライアント側 WinSock2
#include <stdio.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <iostream>
int main() {
char server_ip_addr[32];
#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
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\section*{Color test}
\noindent
\textcolor{black}{testBlack} \\
\textcolor{darkgray}{testDarkgray} \\
\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}