View PIL2CV.py
pil_image = Image.open('C:\\Users\\ochi\\temp\\lenna.jpg')
cv_image = cv2.cvtColor(np.array(pil_image) , cv2.COLOR_RGB2BGR)
cv2.imshow("cv_image",cv_image)
cv2.waitKey(0)
View openMultiTiff.py
from PIL import Image
# Tiff画像を読み込む
image = Image.open('C:\\Users\\ochi\\temp\\sample2.tif')
#ページ数を求める
fLength =image.n_frames
#1ページずつ抜き出して処理
for i in range(0,fLength+1):
image.seek(1)
sImg =image.copy()
View SampleFirstOpenCVPython.py
# -*- coding: utf-8 -*-
import numpy as np
import cv2
# 元の画像を読み込む
img = cv2.imread('C:\\Users\\ochi\\temp\\lena.jpg',cv2.IMREAD_UNCHANGED)
#Matのコピー(クローンみたいなもの)
img2 = img.copy()
View PropertySample.py
class prop:
__x=100
def getX(self):
return self.__x
def setX(self,value):
value=value+1
self.__x=value
x=property(getX,setX)
View OLineChartMemo.cs
RingArray<PerformanceInfo>[] ring = new
RingArray<PerformanceInfo>[3]; ////RingArray型の配列を三個用意
//その箱の中の要素として扱いたい型を指定する。
EnumerableDataSource<PerformanceInfo>[] ds = new
EnumerableDataSource<PerformanceInfo>[3]; ////加算するデータソース型の配列を三個宣言
LineGraph[] chart = new LineGraph[3];
View getTemplateAreaLocation.cs
private OpenCvSharp.Point getTemplateAreaLocation(Mat matTarget, Mat matTemplate, int LocFlag) {
Mat result = new Mat(matTarget.Height - matTemplate.Height + 1, matTarget.Width - matTemplate.Width + 1, MatType.CV_8UC1);
OpenCvSharp.Point minPoint = new OpenCvSharp.Point();
OpenCvSharp.Point maxPoint = new OpenCvSharp.Point();
try {
Cv2.MatchTemplate(matTarget, matTemplate, result, TemplateMatchModes.CCoeff);
Cv2.MinMaxLoc(result, out minPoint, out maxPoint);
}
View HtmlFilter.java
class HtmlFilter extends FileFilter{
public boolean accept(File f){
if (f.isDirectory()){
return true;
}
String ext = getExtension(f);
if (ext != null){
if (ext.equals("html") || ext.equals("htm")){
return true;
}else{
View SamplePythonAsyncCall.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
View SamplePythonCall.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePythonCall
{
View FPSManager.java
package org.ochilab.util.time;
import java.util.concurrent.TimeUnit;
/**
* FPSの表示・調整するクラス
*/
public class FPSManager {
// 1秒(ナノ秒単位)
private static long ONE_SEC_TO_NANO = TimeUnit.SECONDS.toNanos(1L);