public IEnumerator PerformAnnotation(Texture2D snap)
        {
            if (RescaleInput)
            {
                GenericUtils.ScaleTexture(snap, (int)scaleResolution.x, (int)scaleResolution.y);
                Debug.Log("rescaled final: " + snap.width + "," + snap.height);
            }
            //copy image
            temp_image = snap;
            // Convert to base64 encoding.
            string _selectedImageData = ImageConvert.Convert(snap);

            if (MasoutisClient.category == (int)Enums.MasoutisCategories.product)
            {
                // set features types
                var featureTypes = new List <Enumerators.FeatureType>()
                {
                    Enumerators.FeatureType.DOCUMENT_TEXT_DETECTION,
                    Enumerators.FeatureType.OBJECT_LOCALIZATION
                };
                AnnotateImage(_selectedImageData, featureTypes);
            }
            else
            {
                // set features types
                var featureTypes = new List <Enumerators.FeatureType>()
                {
                    Enumerators.FeatureType.DOCUMENT_TEXT_DETECTION
                };
                AnnotateImage(_selectedImageData, featureTypes);
            }

            while (annotationCompleted != true)
            {
                yield return(null);
            }
        }
 private void RescaleTexture(Texture2D snap)
 {
     GenericUtils.ScaleTexture(snap, (int)scaleResolution.x, (int)scaleResolution.y);
     Debug.Log(snap.width + " ," + snap.height);
 }