Questions tagged [image-preprocessing]
285 questions
2
votes
1 answer
image data augmentation using Image Data generator in keras
I am currently working in a project on computer vision and I wanted to use the image data generator to load my images according to classes from respective directories so .
I wanted to augment my images by feature_std_normalization
I declared the…

Saikat Chakraborty
- 23
- 3
2
votes
4 answers
How to detect and rotate images in python
I have multiple pdf invoice which i am trying to parse. I convert them to images and use ocr to get text from the images. One of the pdf has 2 out of 3 pages which are rotated by 90 degrees. How do i detect these rotated pages and correctly rotate…

Developer
- 31
- 1
- 4
2
votes
1 answer
Remove black border/boxes around text for better OCR?
The borders across the text like in the following image is giving a very bad result for OCR.
So I am using javaCV(java wrapper for OpenCV ) to remove borders and boxes around text in an image. The results were quite satisfactory. But the problem I…

Arun Gowda
- 2,721
- 5
- 29
- 50
2
votes
1 answer
Keras Feature Wise Center at Training and Prediction Time
I have had ImageDataGenerator implemented with featurewise_center=True, featurewise_std_normalization=True. I fit the generator to my training set (it learns some statistics) and train my model. All is well.
After training is done and python is…

iDeepVision
- 31
- 5
2
votes
1 answer
Why is DPI relevant for images taken by a camera for OCR
I am currently working on a project that involves using the Tess4j Tesseract OCR engine.
While working on this project I come along a lot of websites that state that Tesseract works best on images of at least 300 DPI (Dots per Inch).
My question is…

danielrieske
- 127
- 1
- 11
2
votes
1 answer
Dimensions don't match after changin data representation " LabelBinarizer "
l have 66 classes of characters. l trained a multi layer perceptron feeding it with images and the class of each image is a character
Aa..Zz 0-9 ,;:! è à â ~
l applied a LabelBinarizer to transform each character to a vector of 66 classes,…

vincent
- 1,558
- 4
- 21
- 34
1
vote
0 answers
Pytorch: Segmentation model's dice score is not improving if i use augmentation
I am doing a brain MRI segmentation task using Unet model. My problem is it does no matter what transformation i use during training my val dice score after few epochs stucks around 77% score.
I already have a successfuly trained model with 93% dice…

Csippán György
- 11
- 4
1
vote
1 answer
AttributeError: module 'keras.preprocessing.image' has no attribute 'img_to_array'
I am trying to run a code from github of facial emotion teller and I am getting an attribute error,
The error is :
line 27, in
img_pixel = image.img_to_array(roi_gray)
AttributeError: module 'keras.preprocessing.image' has no attribute…

Rituraj Rawat
- 11
- 2
1
vote
1 answer
Add Gaussian noise to a binary image knowing noise variance or SNR in python
I am using python open cv for image restoration and in the first step, I have to add gaussian noise to my "binary" image. My image pixel values are integers that can take values 0 or 1. How can I add gaussian noise to my image knowing SNR or noise…

Amir Mohseni
- 13
- 3
1
vote
1 answer
python imaging library truncated image problem
I'm working with PIL in python to load and resize a large number of images, to feed to a CNN. But during the process of loading this error happens:
---------------------------------------------------------------------------
OSError …

Mocking Bird
- 15
- 6
1
vote
0 answers
Segmenting image by histogram
I am trying to classify infected red blood cells(RBC) and uninfected ones and am trying to do some image preprocessing that might help boost accuracy scores. I using this preprocessing for XGBOOST and SVM.
Asking for help here as my capstone tutor…

Saulius
- 11
- 2
1
vote
1 answer
How to standardize a tensor
When I have an image , I can standardize the image channel-wise as follows :
image[:, :, 0] = ((image[:, :, 0]-mean_1))/std_1
image[:, :, 1] = ((image[:, :, 1]-mean_2))/std_2
image[:, :, 2] = ((image[:, :, 2]-mean_3))/std_3
Where mean_1…

AAA
- 305
- 1
- 7
1
vote
0 answers
How to open folder, resize present images and save them in the same folder. (python)
For a project that I am working on I have to resize a lot of nrrd's. These files are stored in a very specific order and should also be returned to the same file.
For the last few days I have been trying different ways to open the image, resize it…

Lars VanderBroeck
- 23
- 4
1
vote
1 answer
Data standardization using ImageDataGenerator
I have a folder that is called ‘train’, which is divided into 8 sub folders with each sub folder contains the data ( images )of one class ( and hence my dataset is a multi class one with 8 classes) . Now I have the following questions :
I need to…

AAAA
- 11
- 1
1
vote
1 answer
How to use from_tensor_slices properly on MRI images?
I'm working with MRI images and I'd like to use from_tensor_slices to preprocess the paths but I don't know how to use that properly. Below are my code, the problem message and link for the dataset.
First I rearrange my data. 484 images and 484…

user15515518
- 91
- 6