using UnityEngine;
using System.Collections;
using OpenCvSharp;
using System.Runtime.InteropServices;
using System.Linq;
public class CovextityHull : MonoBehaviour {
Texture2D img;
public GameObject plane;
string imagename = "Assets/Resources/hand.jpg";
public IplImage image;
// Use this for initialization
void Start()
{
image = Cv.LoadImage(imagename, LoadMode.AnyColor);
img = new Texture2D(image.Width, image.Height, TextureFormat.RGBA32, false);
System.Random rand = new System.Random();
//for (; ; )
//{
int count = rand.Next() % 100 + 1;
CvPoint[] ptseq = new CvPoint[count];
for (int i = 0; i < ptseq.Length; i++)
{
ptseq[i] = new CvPoint
{
X = rand.Next() % (image.Width / 2) + image.Width / 4,
Y = rand
opencvsharp + unity进行轮廓凸出(ConvexityHull2)
最新推荐文章于 2024-06-14 14:48:11 发布