void Start() { VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted); NoodleManager.noodleType = NoodleType.normal; // 入力画像用 初期 cameraMat = new Mat(Screen.height, Screen.width, CvType.CV_8UC3); cameraTexture = new Texture2D(cameraMat.cols(), cameraMat.rows(), TextureFormat.RGBA32, false); // 出力画面 初期化 outputScreenQuad = outputCamera1.GetComponent <OutputCamQuad>(); camQuad2 = outputCamera2.GetComponent <OutputCamQuad>(); camQuad3 = outputCamera3.GetComponent <OutputCamQuad>(); camQuad4 = outputCamera4.GetComponent <OutputCamQuad>(); // 飲料領域の初期化 foodRegion = new Region(0, 0, cameraMat.cols(), cameraMat.rows()); // テクスチャCreator初期化 _textureCreator = new NoodleTextureCreator(); // BinaryCreator初期化 binaryMatCreator = new BinaryMatCreator(); binaryMatCreator.setCrUpper(cr_threshold_upper); binaryMatCreator.setCrLower(cr_threshold_lower); binaryMatCreator.setSUpper(s_threshold_upper); binaryMatCreator.setSLower(s_threshold_lower); binaryMatCreator.setVUpper(v_threshold_upper); binaryMatCreator.setVLower(v_threshold_lower); }
void Start() { // 入力画像用 cameraMat = new Mat(Screen.height, Screen.width, CvType.CV_8UC3); cameraTexture = new Texture2D(cameraMat.cols(), cameraMat.rows(), TextureFormat.ARGB32, false); // 出力画像用 camQuad1 = outputCamera1.GetComponent <OutputCamQuad> (); camQuad2 = outputCamera2.GetComponent <OutputCamQuad> (); camQuad3 = outputCamera3.GetComponent <OutputCamQuad> (); camQuad4 = outputCamera4.GetComponent <OutputCamQuad> (); // ターゲットの初期化 var targetBehaviour = GameObject.Find(TargetObjectName).GetComponent <ImageTargetBehaviour> (); plate = new Plate(targetBehaviour, cameraMat.rows()); // テクスチャマネージャーの初期化 _textureCreator = new SushiTextureCreator(); // BinaryCreator初期化 binaryMatCreator = new BinaryMatCreator(); binaryMatCreator.setCrUpper(cr_threshold_upper); binaryMatCreator.setCrLower(cr_threshold_lower); binaryMatCreator.setSUpper(s_threshold_upper); binaryMatCreator.setSLower(s_threshold_lower); binaryMatCreator.setVUpper(v_threshold_upper); binaryMatCreator.setVLower(v_threshold_lower); }
void Start() { InitializeCV(); // 出力画面 初期化 outputScreenQuad = outputCamera1.GetComponent <OutputCamQuad>(); }
public override void OnARMainInited() { // 出力画面 初期化 outputScreenQuad = outputCamera1.GetComponent <OutputCamQuad>(); // 飲料領域の初期化 foodRegion = new Region(0, 0, rgbMat.cols(), rgbMat.rows()); // テクスチャCreator初期化 _textureCreator = new ColorTextureCreator(30, 100, 100, 1.0); }
public override void OnARMainInited() { // 出力画面 初期化 outputScreenQuad = outputCamera1.GetComponent <OutputCamQuad>(); // 出力先の設定するならココ. 参照: OpenCVForUnityExample. outputScreenQuad.setupScreenQuadAndCamera(Screen.height, Screen.width, CvType.CV_8UC3); // 飲料領域の初期化 foodRegion = new Region(0, 0, rgbaMat.cols(), rgbaMat.rows()); OnARMainProcessInited(); // テクスチャCreator初期化 _textureCreator = new ColorTextureCreator(30, 100, 100, 1.0); }
void Start() { // 入力画像用 cameraMat = new Mat(Screen.height, Screen.width, CvType.CV_8UC3); cameraTexture = new Texture2D(cameraMat.cols(), cameraMat.rows(), TextureFormat.ARGB32, false); // 出力画像用 camQuad1 = outputCamera1.GetComponent <OutputCamQuad> (); // コップの初期化 var cupTargetBehaviour = GameObject.Find(TargetObjectName).GetComponent <CylinderTargetBehaviour> (); cup = new Cup(cupTargetBehaviour, cameraMat.rows()); // コーヒー領域の初期化 coffeeRegion = new Region(0, 0, cameraMat.cols(), cameraMat.rows()); // テクスチャマネージャーの初期化 textureManager = GameObject.Find("ARCamera").GetComponent <TextureManager> (); }