using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using OpenCVForUnity;
using UnityEngine.UI;
public class test : MonoBehaviour {
public Texture2D src2d;
public RawImage srcimg;
void Start () {
}
void Update () {
if (Input.GetKeyDown(KeyCode.K))
{
Mat src = new Mat(src2d.height,src2d.width,CvType.CV_8UC3);
Utils.texture2DToMat(src2d, src);
Mat dstImage=new Mat();
Imgproc.blur(src,dstImage,new Size(5,5));
Texture2D texture2D = new Texture2D(src.cols(), src.rows(),TextureFormat.RGBA32, false);
Utils.matToTexture2D(dstImage, texture2D);
srcimg.texture = texture2D;
}
}
}
unity opencv 模糊 blur
最新推荐文章于 2024-05-23 16:48:20 发布