public void startImageRecognitionApi() { Debug.Log("CamDisplay StartImageRecognitionApi is called"); if (!cam.isPlaying) { turnCamearOn(); } while (!cam.isPlaying) { } picture.SetPixels(GetAllPixels(cam)); picture.Apply(); image.texture = picture; File.WriteAllBytes(Application.persistentDataPath + '/' + "test_image.png", picture.EncodeToPNG()); Debug.Log("saving png image as test_image.png"); cam.Stop(); postImage.sendImageToCloudSight(); }