Questions tagged [image-preprocessing]
285 questions
4
votes
3 answers
How to apply normalization to images in testing phase when using keras ImageDataGenerator?
I'm trying to predict a new image using trained model. My accuracy is 95%. But the predict_classes always return the first label [0] whatever I input.
I guess one of the reason is I use featurewise_center=True and samplewise_center=True in…

Gamuza
- 73
- 1
- 1
- 7
4
votes
1 answer
Can I generate uint8 label using ImageDataGenerator() and flow_from_directory() in Keras?
I'm dealing with the 2D semantic segmentation task.
in Keras API Documents, these only has samples showing how to arrange dataset for image classification, not semantic segmentation.
So I arrange my image and label like this
SEED = 111
batch_size =…

Shouyu Chen
- 655
- 8
- 16
4
votes
1 answer
preprocessing images generated using keras function ImageDataGenerator() to train resnet50 model
I am trying to train resnet50 model for image classification problem.I have loaded the 'imagenet' pretrained weights before training the model on the image dataset I have. I am using keras function flow_from_directory() to load images from…

AKSHAYAA VAIDYANATHAN
- 2,715
- 7
- 30
- 51
4
votes
1 answer
How to automatically select best result from try_all_threshold?
I am applying thresholding on a text-digit based image. Using skimage.filters.try_all_threshold results in 7 of thresholding algorithms getting applied. I am able to get the resut but I am thinking on how I can choose only 1 result to pass the…

Prabhat Mishra
- 951
- 2
- 12
- 33
4
votes
0 answers
How to determine amount of augmented images in Keras?
I am working with Keras 2.0.0 and I'd like to train a deep model with a huge amount of parameters on a GPU.
As my data are big, I have to use the ImageDataGenerator. To be honest, I want to abuse the ImageDataGenerator in that sense, that I don't…

D.Laupheimer
- 1,074
- 1
- 9
- 21
3
votes
2 answers
Preprocess bad scans (partially blurred, shadowed and slightly skewed) for OCR
I try to read documents from various sources with Python. Therefore I am using OpenCV and Tesseract. To optimize the Tesseract performance, I do some preprocessing, but sadly the documents also vary in quality a lot. My current issue are documents…

Mumpitz
- 51
- 5
3
votes
1 answer
How to train a Keras model using Functional API which has two inputs and two outputs and uses two ImageDataGenerator methods (flow_from_directory)
I want to create a model using the Functional Keras API that will have two inputs and two outputs. The model will be using two instances of the ImageDataGenerator.flow_from_directory() method to get images from two different directories (inputs1…

user8270077
- 4,621
- 17
- 75
- 140
3
votes
1 answer
How to remove border edge noise from an image using python?
I am trying to preprocess a photo of the eye vessels by removing the black border and extraneous non-eye features in the image (Ex. see below for text and "clip") by replacing the black areas with the average pixel values from 3 random squares.…

jinsom
- 125
- 1
- 11
3
votes
1 answer
sklearn.utils.class_weight throws "classes should include all valid labels that can be in y" error
For "convenience", I tried to use sklearn.utils.class_weight, the compute_class_weight function
However, I get the "classes should include all valid labels that can be in y" error; despite that I am 100% sure that I was giving all the class labels…

Anderas
- 630
- 9
- 20
3
votes
1 answer
preprocess function in Keras doesn't work
In my 2D semantic segmentation task, all pixel values in labels aren't are not 0,1,2, but 0,127,255 for example.
So I want to simply add a preprocess function to my ImageDataGenerator of label dataset,
My code:
SEED = 111
batch_size =…

Shouyu Chen
- 655
- 8
- 16
3
votes
0 answers
Proper resize of image
I capture an image using android camera and was saved as Bitmap.
Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, CAMERA_CODE);
if(requestCode == CAMERA_CODE){
Bundle b = data.getExtras();
…

Team EUT
- 31
- 4
3
votes
0 answers
Tesseracts handles similar Pictures completely different
I was just playing around a little with Tesseract as I noticed some strange behavior of the program, which I can’t explain myself. Firstly I gave tesseract this preprocessed Picture1 but it didn’t understand any letter.
Then I put this one in and…

Schnurrbart
- 31
- 3
3
votes
1 answer
Do I have to preprocess test data using neural networks?
I am using Keras (version 2.0.0) and I'd like to make use of pretrained models like e.g. VGG16.
In order to get started, I ran the example of the [Keras documentation site ][https://keras.io/applications/] for extracting features with VGG16:
from…

D.Laupheimer
- 1,074
- 1
- 9
- 21
2
votes
0 answers
EasyOCR image preprocessing?
Does easyOCR do image preprocessing? There are saying on the GitHub page that there are doing a "pre process" 1, but i don't know what this means.

Armin Puran Youssef
- 31
- 1
2
votes
1 answer
Text Documents Image Alignment
I am trying different image alignment approaches to align the images containing texts using Computer Vision. I have tested following image alignment approaches:
Probabilistic Houghlines Transform to align images according to the detected lines.…

npn
- 304
- 1
- 14