public void LoadGestureBatch(int gestureNumber) { GestureBatchData data = GestureSaveSystem.LoadGestureBatch(gestureNumber); //deep copy of gestureBatch for (int i = 0; i < 500; i++) { for (int j = 0; j < 32; j++) //<32 because the image is 32 pixles wide { for (int k = 0; k < 24; k++) //<24 because the image is 24 pixels tall { gestureBatch[i, j, k] = data.gestureBatch[i, j, k]; } } } }
public void LoadMEGAgestureBatch() { MEGAgestureBatch.Clear(); for (int n = 0; n < 4; n++) //assumes only 4 gestures are being used { List <int[, ]> imagecollection = new List <int[, ]>(); GestureBatchData data = GestureSaveSystem.LoadGestureBatch(n); //deep copy of gestureBatch for (int i = 0; i < 500; i++) { int[,] gestureImage = new int[32, 24]; for (int j = 0; j < 32; j++) //<32 because the image is 32 pixles wide { for (int k = 0; k < 24; k++) //<24 because the image is 24 pixels tall { gestureImage[j, k] = data.gestureBatch[i, j, k]; } } imagecollection.Add(gestureImage); } MEGAgestureBatch.Add(imagecollection); //for testing /*if(n == 1){ * reducedImage = new Texture2D (32, 24); * for (int x = 0; x < 32; x++) { * for (int y = 0; y < 24; y++) { * if (MEGAgestureBatch[0][304][x, y] == 1) { * reducedImage.SetPixel (x, y, Color.white); * } else { * reducedImage.SetPixel (x, y, Color.black); * } * } * } * reducedImage.Apply(); * Filtered.texture = reducedImage; * }*/ } }
public void SaveGestureBatch() { GestureSaveSystem.SaveGestureBatch(this, gestureQuantity - 1); Debug.Log("gestureBatch SAVED, number: " + gestureQuantity); }
public void LoadGestureQuantity() { GestureQuantityData data = GestureSaveSystem.LoadGestureQuantity(); gestureQuantity = data.gestureQuantity; }
public void SaveGestureQuantity() { GestureSaveSystem.SaveGestureQuantity(this); Debug.Log("gestureQuantity SAVED, value: " + gestureQuantity); }
//sets gesture quantity to 0 and saves it. public void resetGestureQuantity() { gestureQuantity = 0; GestureSaveSystem.SaveGestureQuantity(this); }