Пример #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> ();
        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);
    }
Пример #2
0
    IScorer scorer; // 領域判定のスコアラー

    public override void OnARMainInited()
    {
        // 出力画面 初期化
        outputScreenQuad = outputCamera1.GetComponent <OutputCamQuad>();

        // 飲料領域の初期化
        foodRegion = new Region(0, 0, rgbaMat.cols(), rgbaMat.rows());

        // テクスチャCreator
        _textureCreator = new SushiTextureCreator();
    }