Created
February 22, 2019 08:01
-
-
Save frogermcs/478ebe371393e9a8722cdcb665deb812 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Bitmap prepareImageForClassification(Bitmap bitmap) { | |
Paint paint = new Paint(); | |
Bitmap finalBitmap = Bitmap.createScaledBitmap( | |
bitmap, | |
GtsrbModelConfig.INPUT_IMG_SIZE_WIDTH, | |
GtsrbModelConfig.INPUT_IMG_SIZE_HEIGHT, | |
false); | |
Canvas canvas = new Canvas(finalBitmap); | |
canvas.drawBitmap(finalBitmap, 0, 0, paint); | |
return finalBitmap; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment