mirror of https://github.com/emgucv/emgucv.git

14 changed files with 329 additions and 3 deletions
-
BINEmgu.CV.Unity/ProjectSettings/DynamicsManager.asset
-
BINEmgu.CV.Unity/ProjectSettings/EditorBuildSettings.asset
-
BINEmgu.CV.Unity/ProjectSettings/GraphicsSettings.asset
-
BINEmgu.CV.Unity/ProjectSettings/Physics2DSettings.asset
-
BINEmgu.CV.Unity/ProjectSettings/ProjectSettings.asset
-
2Emgu.CV.Unity/ProjectSettings/ProjectVersion.txt
-
7Emgu.CV.Unity/copy_demo_assets.bat
-
59Emgu.CV.Unity/demo/FeatureMatching.cs
-
13Emgu.CV.Unity/demo/FeatureMatching.cs.meta
-
BINEmgu.CV.Unity/demo/FeatureMatchingScene.unity
-
9Emgu.CV.Unity/demo/FeatureMatchingScene.unity.meta
-
BINEmgu.CV.Unity/demo/MainMenu.unity
-
121Emgu.CV.Unity/demo/Resources/box.png.meta
-
121Emgu.CV.Unity/demo/Resources/box_in_scene.png.meta
@ -1 +1 @@ |
|||
m_EditorVersion: 2017.1.0f3 |
|||
m_EditorVersion: 2017.2.0f3 |
@ -0,0 +1,59 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Copyright (C) 2004-2017 by EMGU Corporation. All rights reserved.
|
|||
//----------------------------------------------------------------------------
|
|||
|
|||
using System.IO; |
|||
using Emgu.CV.CvEnum; |
|||
using UnityEngine; |
|||
using System; |
|||
using System.Drawing; |
|||
using System.Collections; |
|||
using System.Text; |
|||
using Emgu.CV; |
|||
using Emgu.CV.Structure; |
|||
using Emgu.CV.Util; |
|||
using System.Runtime.InteropServices; |
|||
using Emgu.CV.Ocl; |
|||
|
|||
public class FeatureMatching : MonoBehaviour |
|||
{ |
|||
|
|||
// Use this for initialization
|
|||
void Start() |
|||
{ |
|||
|
|||
Texture2D boxTexture = Resources.Load<Texture2D>("box"); |
|||
Texture2D boxInSceneTexture = Resources.Load<Texture2D>("box_in_scene"); |
|||
|
|||
Mat box3Channels = new Mat(); |
|||
TextureConvert.Texture2dToOutputArray(boxTexture, box3Channels); |
|||
Mat box = new Mat(); |
|||
CvInvoke.CvtColor(box3Channels, box, ColorConversion.Bgra2Gray); |
|||
CvInvoke.Flip(box, box, FlipType.Vertical); |
|||
|
|||
Mat boxInScene3Channels = new Mat(); |
|||
TextureConvert.Texture2dToOutputArray(boxInSceneTexture, boxInScene3Channels); |
|||
Mat boxInScene = new Mat(); |
|||
CvInvoke.CvtColor(boxInScene3Channels, boxInScene, ColorConversion.Bgra2Gray); |
|||
CvInvoke.Flip(boxInScene, boxInScene, FlipType.Vertical); |
|||
|
|||
long time; |
|||
Mat img = FeatureMatchingExample.DrawMatches.Draw(box, boxInScene, out time); |
|||
//CvInvoke.Imwrite("c:\\tmp\\tmp.png", img);
|
|||
//Mat outImg = new Mat();
|
|||
//CvInvoke.CvtColor(img, outImg, ColorConversion.Bgr2Bgra);
|
|||
//CvInvoke.Imwrite("c:\\tmp\\tmp.png", outImg);
|
|||
Texture2D texture = TextureConvert.InputArrayToTexture2D(img); |
|||
|
|||
this.GetComponent<GUITexture>().texture = texture; |
|||
|
|||
this.GetComponent<GUITexture>().pixelInset = new Rect(-texture.width / 2, -texture.height / 2, texture.width, texture.height); |
|||
|
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update() |
|||
{ |
|||
|
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 9d77cb3d6f175084f8b3a97acce3ea7d |
|||
timeCreated: 1512338184 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
@ -0,0 +1,9 @@ |
|||
fileFormatVersion: 2 |
|||
guid: a06ce5bb254e2724f86cc183b41e8df3 |
|||
timeCreated: 1512337966 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
@ -0,0 +1,121 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 993a88b51c8f9ff409db803489c3c785 |
|||
timeCreated: 1512337715 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
externalObjects: {} |
|||
serializedVersion: 4 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 1 |
|||
sRGBTexture: 1 |
|||
linearTexture: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapsPreserveCoverage: 0 |
|||
alphaTestReferenceValue: 0.5 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 1 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 6 |
|||
cubemapConvolution: 0 |
|||
seamlessCubemap: 0 |
|||
textureFormat: 1 |
|||
maxTextureSize: 2048 |
|||
textureSettings: |
|||
serializedVersion: 2 |
|||
filterMode: -1 |
|||
aniso: -1 |
|||
mipBias: -1 |
|||
wrapU: -1 |
|||
wrapV: -1 |
|||
wrapW: -1 |
|||
nPOTScale: 1 |
|||
lightmap: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaUsage: 1 |
|||
alphaIsTransparency: 0 |
|||
spriteTessellationDetail: -1 |
|||
textureType: 0 |
|||
textureShape: 1 |
|||
maxTextureSizeSet: 0 |
|||
compressionQualitySet: 0 |
|||
textureFormatSet: 0 |
|||
platformSettings: |
|||
- buildTarget: DefaultTexturePlatform |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
- buildTarget: Standalone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
- buildTarget: iPhone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
- buildTarget: Android |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
- buildTarget: Windows Store Apps |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
- buildTarget: WebGL |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
physicsShape: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
@ -0,0 +1,121 @@ |
|||
fileFormatVersion: 2 |
|||
guid: dc85a34d2c836374d92013327ab64c62 |
|||
timeCreated: 1512337715 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
externalObjects: {} |
|||
serializedVersion: 4 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 1 |
|||
sRGBTexture: 1 |
|||
linearTexture: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapsPreserveCoverage: 0 |
|||
alphaTestReferenceValue: 0.5 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 1 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 6 |
|||
cubemapConvolution: 0 |
|||
seamlessCubemap: 0 |
|||
textureFormat: 1 |
|||
maxTextureSize: 2048 |
|||
textureSettings: |
|||
serializedVersion: 2 |
|||
filterMode: -1 |
|||
aniso: -1 |
|||
mipBias: -1 |
|||
wrapU: -1 |
|||
wrapV: -1 |
|||
wrapW: -1 |
|||
nPOTScale: 1 |
|||
lightmap: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaUsage: 1 |
|||
alphaIsTransparency: 0 |
|||
spriteTessellationDetail: -1 |
|||
textureType: 0 |
|||
textureShape: 1 |
|||
maxTextureSizeSet: 0 |
|||
compressionQualitySet: 0 |
|||
textureFormatSet: 0 |
|||
platformSettings: |
|||
- buildTarget: DefaultTexturePlatform |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
- buildTarget: Standalone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
- buildTarget: iPhone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
- buildTarget: Android |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
- buildTarget: Windows Store Apps |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
- buildTarget: WebGL |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
physicsShape: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
Write
Preview
Loading…
Cancel
Save
Reference in new issue