diff --git a/AR-3/Assets/Chess/Fbx/Materials/Black.mat b/AR-3/Assets/Chess/Fbx/Materials/Black.mat index 89c26eb..0f2a8f3 100644 --- a/AR-3/Assets/Chess/Fbx/Materials/Black.mat +++ b/AR-3/Assets/Chess/Fbx/Materials/Black.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Black - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _EMISSION m_LightmapFlags: 1 m_EnableInstancingVariants: 0 diff --git a/AR-3/Assets/DrawingScene.unity b/AR-3/Assets/DrawingScene.unity index f91c640..efeadfc 100644 --- a/AR-3/Assets/DrawingScene.unity +++ b/AR-3/Assets/DrawingScene.unity @@ -156,7 +156,7 @@ MonoBehaviour: fy: 650 cx: 320 cy: 240 - DarknessThreshold: 280 + DarknessThreshold: 400 --- !u!33 &12666034 MeshFilter: m_ObjectHideFlags: 0 @@ -164,7 +164,7 @@ MeshFilter: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 12666032} - m_Mesh: {fileID: 1198122122} + m_Mesh: {fileID: 940414303} --- !u!23 &12666035 MeshRenderer: m_ObjectHideFlags: 0 @@ -182,7 +182,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 1272638553} + - {fileID: 1166857367} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -517,13 +517,13 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!43 &1198122122 +--- !u!43 &940414303 Mesh: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: ImageTargetMesh21968 + m_Name: ImageTargetMesh7576 serializedVersion: 9 m_SubMeshes: - serializedVersion: 2 @@ -677,7 +677,7 @@ Mesh: offset: 0 size: 0 path: ---- !u!21 &1272638553 +--- !u!21 &1166857367 Material: serializedVersion: 6 m_ObjectHideFlags: 0 @@ -686,7 +686,7 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: 'finger_drawing_templateMaterial - 21980' + 7588' m_Shader: {fileID: 4800000, guid: bd60f254bfe034e099e9f70c306d67e7, type: 3} m_ShaderKeywords: m_LightmapFlags: 5 @@ -699,7 +699,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _MainTex: - m_Texture: {fileID: 2800000, guid: 362f2e29ecb348259b1cb6c2d5535bea, type: 3} + m_Texture: {fileID: 2800000, guid: 5b01e8d346ff4a5482324fe1d8c6c674, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: [] @@ -1115,7 +1115,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: mWorldCenterMode: 0 - mWorldCenter: {fileID: 12666038} + mWorldCenter: {fileID: 0} --- !u!81 &2010761165 AudioListener: m_ObjectHideFlags: 0 diff --git a/AR-3/Assets/Resources/VuforiaConfiguration.asset b/AR-3/Assets/Resources/VuforiaConfiguration.asset index 4429b87..2a1f830 100644 --- a/AR-3/Assets/Resources/VuforiaConfiguration.asset +++ b/AR-3/Assets/Resources/VuforiaConfiguration.asset @@ -64,7 +64,7 @@ MonoBehaviour: autoInitTracker: 0 autoStartTracker: 0 webcam: - deviceNameSetInEditor: 'USB Camera #2' + deviceNameSetInEditor: 'USB Camera #5' flipHorizontally: 0 turnOffWebCam: 0 renderTextureLayer: 30 diff --git a/AR-3/Assets/change_everything.cs b/AR-3/Assets/change_everything.cs index 7c5c085..9b3e2b5 100644 --- a/AR-3/Assets/change_everything.cs +++ b/AR-3/Assets/change_everything.cs @@ -6,8 +6,6 @@ using Vuforia; public class change_everything : MonoBehaviour { - private TextMesh colorQuad; - private GameObject color; private GameObject brightness; private Renderer rend; @@ -31,3 +29,4 @@ public class change_everything : MonoBehaviour rend.material.color = Color.HSVToRGB(color_rot, 1, bright_rot); } } + diff --git a/AR-3/Assets/homo_draw.cs b/AR-3/Assets/homo_draw.cs index 70b506c..646f7c9 100644 --- a/AR-3/Assets/homo_draw.cs +++ b/AR-3/Assets/homo_draw.cs @@ -154,18 +154,15 @@ public class homo_draw : MonoBehaviour } - Mat homo = Calib3d.findHomography(imagePoints, dstPoints); - Mat output = camImgCopy.clone(); //Mat outputSkullMat = skullTextureMat.clone(); Imgproc.warpPerspective(camImageMat, output, homo, output.size()); - Imgproc.circle(output, new Point(45, 390), 5, new Scalar(255, 0, 0, 255)); @@ -179,8 +176,8 @@ public class homo_draw : MonoBehaviour Mat yetAnotherClone = camImgCopy.clone(); - - + print(r + g + b); + if (r+g+b < DarknessThreshold) { print("finger lol"); @@ -190,9 +187,7 @@ public class homo_draw : MonoBehaviour Imgproc.cvtColor(output, lelImg, Imgproc.COLOR_BGR2HSV); var newOutput = output.clone(); - Core.inRange(lelImg, new Scalar(r - 30, g - 30, b - 30), new Scalar(r + 30, g + 30, b + 30), newOutput); - - + MatDisplay.DisplayMat(newOutput, MatDisplaySettings.BOTTOM_LEFT); var nicePoint = LocateFinger(newOutput); if (nicePoint != null) { @@ -201,7 +196,6 @@ public class homo_draw : MonoBehaviour } - MatDisplay.MatToTexture(newOutput, ref planeOutText); planeRend.sharedMaterial.mainTexture = planeOutText; @@ -215,15 +209,10 @@ public class homo_draw : MonoBehaviour Core.addWeighted(camImageMat, 0.95f, circleClone, 0.7f, 0.0f, yetAnotherClone); - //Display the Mat that includes video feed and debug points MatDisplay.DisplayMat(yetAnotherClone, MatDisplaySettings.FULL_BACKGROUND); - - imagePoints.Dispose(); - - } } @@ -238,11 +227,8 @@ public class homo_draw : MonoBehaviour return new Point(j, i); } } - } - + } return null; - } -} - +} \ No newline at end of file diff --git a/AR-3/Assets/lol.mat b/AR-3/Assets/lol.mat index a45b84d..d1dfa29 100644 --- a/AR-3/Assets/lol.mat +++ b/AR-3/Assets/lol.mat @@ -73,5 +73,5 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/AR-3/Assets/python_test.cs b/AR-3/Assets/python_test.cs index f8dea11..b8fe786 100644 --- a/AR-3/Assets/python_test.cs +++ b/AR-3/Assets/python_test.cs @@ -115,7 +115,7 @@ public class python_test : MonoBehaviour //sr = new StreamReader(process.StandardOutput.BaseStream, System.Text.Encoding.Default, true, 1024, true); - _webcamtex = new WebCamTexture("HD Pro Webcam C920 #3", 1920, 1080); + _webcamtex = new WebCamTexture("HD Pro Webcam C920", 1920, 1080); _webcamtex.Play(); //DoStuff(); baseObject.SetActive(false); @@ -180,9 +180,9 @@ public class python_test : MonoBehaviour GameObject fbx = intToPiece[intPiece]; GameObject piece = Instantiate(fbx); piece.transform.localScale = baseObject.transform.localScale; - piece.transform.position = new Vector3((float)(bp.x + i * 0.04), + piece.transform.position = new Vector3((float)(bp.x + i * 0.043), bp.y, - (float)(bp.z + j * 0.04)); + (float)(bp.z + j * 0.040)); pieces.Add(piece); } } diff --git a/AR-3/Assets/tester.py b/AR-3/Assets/tester.py new file mode 100644 index 0000000..768ffc0 --- /dev/null +++ b/AR-3/Assets/tester.py @@ -0,0 +1,4 @@ +import time + +time.sleep(5) +print("lleelel") diff --git a/AR-3/ProjectSettings/ProjectVersion.txt b/AR-3/ProjectSettings/ProjectVersion.txt index 6128d74..7765e4a 100644 --- a/AR-3/ProjectSettings/ProjectVersion.txt +++ b/AR-3/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.3.5f1 +m_EditorVersion: 2018.3.12f1