Resolve WES-133 "Multiple choice"

This commit is contained in:
Tibe Habils
2023-04-10 15:05:11 +00:00
committed by Jelle De Geest
parent 04d9a4bf2b
commit 4e9d801e61
49 changed files with 3310 additions and 1244 deletions

View File

@@ -136,7 +136,7 @@ public class SignPredictor : MonoBehaviour
/// <summary>
/// Webcam texture
/// </summary>
private WebCamTexture webcamTexture;
private WebCamTexture webcamTexture = null;
/// <summary>
/// Input texture
@@ -418,7 +418,7 @@ public class SignPredictor : MonoBehaviour
}
}
public void SetModel(ModelIndex index)
{
this.modelList.SetCurrentModel(index);
@@ -430,7 +430,14 @@ public class SignPredictor : MonoBehaviour
public void SwapScreen(RawImage screen)
{
this.screen = screen;
this.screen.texture = webcamTexture;
//width = webcamTexture.width;
//height = webcamTexture.height;
if (webcamTexture != null)
{
float webcamAspect = (float)webcamTexture.width / (float)webcamTexture.height;
this.screen.rectTransform.sizeDelta = new Vector2(this.screen.rectTransform.sizeDelta.y * webcamAspect, (this.screen.rectTransform.sizeDelta.y));
this.screen.texture = webcamTexture;
}
}
}