Reputation: 4731
I am creating a deep learning based android app. I have a Canvas
where I am allowing the user to draw something. Then I will pass the bitmap of the Canvas
to my model for classification. I am using Tensorflow MNIST project as the base for my project. My problem is, in the MNIST example user are allowed to draw on a 28x28
size Canvas
. But I don't want to do that because drawing on that Canvas
is pixelating the drawing. I am drawing on a full size Canvas
but while sending the Bitmap
of the canvas to the Tensorflow
model I want to resize it to 28x28
for classification (else I am getting ArrayIndexOutOfBoundException
).
How can I resize the bitmap to 28x28
without loosing information ? or any other possible solution for this ?
Here is the image of the MNIST canvas:
This is the image of my application canvas. I tried resizing it to 28x28 but I am loosing the image information:
Upvotes: 0
Views: 335
Reputation: 2174
Let's say you have an input of 100 x 100 image and you want to resize it to 28 x 28.
100 x 100 pixels -> 10000 features
28 x 28 pixels -> 784 features
It is mathematically impossible not to lose input information while resizing.
However there are other ways to work around.
Upvotes: 2