Questions tagged [image-preprocessing]

285 questions
1
vote
1 answer

Remove noise from image without losing data in OpenCV

i used this code: horizontalStructure = cv2.getStructuringElement(cv2.MORPH_RECT, (horizontalsize, 1)) horizontal = cv2.erode(horizontal, horizontalStructure, (-1, -1)) horizontal = cv2.dilate(horizontal, horizontalStructure, (-1,…
Shalev
  • 25
  • 5
1
vote
0 answers

Image data generator for my (x, 12, 370, 235, 3) dataset

I have made a model with 12 2D CNN inputs. I suddenly realized that the ImageDataGenerator from from keras.preprocessing import image don't accept inputs with more than 4 dimensions or as the error message stated it: ('Input data in…
1
vote
1 answer

Extract random non-overlapping patches from image tensor in Tensorflow

I want to extract 3 random, non-overlapping sub-images of 80 x 80 with Tensorflow. How could I do it? The picture below should give an idea.
3nomis
  • 1,175
  • 1
  • 9
  • 30
1
vote
2 answers

remove all black pixels and get only required image using C++ (OpenCV)

I have tried findNonZero and with the boundingRect. But nothing is helping me. I am new to C++ OpenCV. I did this using Python OpenCV which involved NumPy, but unfortunately I am not able to do the same in C++. Input image Python: def…
Praveen
  • 267
  • 1
  • 5
  • 19
1
vote
1 answer

Keras ImageDataGenerator.flow_from_directory returns TypeError

I'm trying to give a directory as input to ImageDataGenerator.flow_from_directory but I'm unable to do it. train_data_dir = "/train" validation_data_dir = "/test" train_generator =…
1
vote
1 answer

AttributeError: 'str' object has no attribute 'shape' - when resizing image using scikit-image

I'm trying to iterate through a directory and resize every image using scikit-image but I keep getting the following error: b'scene01601.png' Traceback (most recent call last): File "preprocessingdatacopy.py", line 16, in
iiooii
  • 551
  • 2
  • 9
  • 15
1
vote
1 answer

which kind of image preprocessing is better in deep learning

Here are three kinds of pre-processing methods to convert from uint8 to float32. Which one is recommended to be used in conv2d->batch norm->ReLU structure(e.g. robustness and avoiding dying ReLU problem), or any suggestion? As mentioned in cs231n,…
1
vote
1 answer

How can I accelerate processing tons of patches in a image?

I wrote a function to process the image, in which I extract many patches and then process them using the same function(func) to generate a new image. However, this is very slow because of two loop, func, the number of patches, size of the patches. I…
1
vote
1 answer

Apply preprocessing to the dataset

I am implementing a paper on image segmentation in pytorch. I am required to do some preprocessing steps but as I am trying it the first time so I am unable to incorporate them in the traditional pipeline. Following are the preprocessing steps- 1) …
Beginner
  • 721
  • 11
  • 27
1
vote
1 answer

How to fix the image preprocessing difference between tensorflow and android studio?

I'm trying to build a classification model with keras and deploy the model to my Android phone. I use the code from this website to deploy my own converted model, which is a .pb file, to my Android phone. I load a image from my phone and everything…
1
vote
1 answer

Image preprocessing for edge detection - low quality, low contrast

I have a bunch of low quality, low contrast (usually also bad light) photos of writings on rocks. I would like my program to detect letter shapes (which are usually quite worn). Since I'm a newbie, I tried applying sobel / laplacian / canny filters,…
1
vote
1 answer

What does ImageDataGenerator.fit() function does in Keras Image preprocessing?

There is ImageDataGenerator.flow() function, in which we pass our training images and it returns augmented images. But what does ImageDataGenerator.fit() function does?
Shiva Verma
  • 89
  • 2
  • 9
1
vote
0 answers

What does "color ordering" mean when used with distorted inputs with inception model

I have been looking for pre-processing techniques of input images. After looking into the implementation of the inception model at:…
I. A
  • 2,252
  • 26
  • 65
1
vote
2 answers

What is the Ideal image dimensions for better OCR by google vision?

I have been using google vision OCR for a while now. And I have observed that the OCR result varies with image dimension. Say for example an image with dimension 720 x 1280 gives a better result than 360 x 720. And it sometimes does worse the other…
1
vote
1 answer

Converting channel last to channel first image

I have an image tensor of the following dimensions TensorShape([Dimension(1), Dimension(96), Dimension(96), Dimension(3)]) I want this tensor to be in following channel first dimension TensorShape([Dimension(1), Dimension(2), Dimension(96),…