Questions tagged [image-preprocessing]

285 questions
2
votes
0 answers

Is there an equivalent function or an implmentation of skimage.feature.peak_local_max in OpenCV?

I have been trying to segment biological cells in an image using watershed algorithm. I found an excellent article on pyimagesearch which clearly gives an overview of the algorithm and its implementation in python. The code uses both opencv and…
2
votes
1 answer

tf.keras ImageDataGenerator for Semantic Segmentation: Keep y values as integers

In short I want to use the easy to use tf.keras.preprocessing.image.ImageDataGenerator to load batches of X and y images to train CNNs for semantic segmentation. Augmentation is to be applied on the fly. Unfortunately, the values of the y images are…
Manuel Popp
  • 1,003
  • 1
  • 10
  • 33
2
votes
1 answer

bounding boxes on handwritten digits with opencv

I tried the code provided bellow to segment each digit in this image and put a contour around it then crop it out but it's giving me bad results, I'm not sure what I need to change or work on. The best idea I can think of right now is filtering the…
2
votes
1 answer

How to read and display images from a Drive directory using OpenCV and numpy?

I'm trying to read an image from a directory on my drive, for this I use OpenCV, I convert the image to a numpy array of 32-bit floats and then display it, the problem I have is that the image is not displayed. The images correspond to chest X-rays…
0x55b1E06FF
  • 538
  • 1
  • 9
  • 24
2
votes
1 answer

Applying a simple transformation to get a binary image using pytorch

I'd like to binarize image before passing it to the dataloader, I have created a dataset class which works well. but in the __getitem__() method I'd like to threshold the image: def __getitem__(self, idx): # Open image, apply transforms…
JammingThebBits
  • 732
  • 11
  • 31
2
votes
1 answer

imshow/imwrite changes all pixel values to 1

I have a Matlab dataset saved with .mat that I'm trying to process in Octave GUI. The data consist of images and I want to save them in a JPG format (or any other image format), but I'm having this strange behavior when trying to displaying or…
salRad
  • 320
  • 1
  • 8
  • 21
2
votes
1 answer

Finding distance between two Histogram of Oriented Gradients Features

I have two 4000 dimension HOG features, created by cv2.HOGDescriptor. I need to find distance between, this two vectors. def getDistances(firstFace,secondFace): EuclideanDistance = distance.euclidean(firstFace,secondFace) print("Euclidean distance…
2
votes
1 answer

How to check preprocessing time/speed in Colab?

I am training a neural network on Google Colab GPU. Therefore, I synchronized the input images (180k in total, 105k for training, 76k for validation) with my Google Drive. Then I mount the Google Drive and go from there. I load a csv-file with image…
Tobitor
  • 1,388
  • 1
  • 23
  • 58
2
votes
0 answers

Getting wrong sub-matrix from a matrix with an error of -1

I am trying to find out the maximum sum sub matrix of size k from a 2d matrix. I have implemented everything correctly, but still I'm getting: index out of bounds -1 exception The idea I'm following for this thing as follows: Preprocess the the…
ABHISHEK
  • 57
  • 3
2
votes
1 answer

Why does the inpaint method not remove the text from IC image?

I am trying to mask out the marking on an IC but the inpaint method from OpenCV does not work correctly. The left image is the original image (after cropping the ROI). The middle image is the mask I generated through threshholding. The right image…
NECben067
  • 427
  • 1
  • 4
  • 20
2
votes
1 answer

Keras: Altered ImageDataGenerator gives error "__init__() got an unexpected keyword argument"

I am using keras=2.3.1 and I wanted to use my own version of zca_whitening. For that, I made changes directly into the ImageDataGenerator class in the keras file…
NeStack
  • 1,739
  • 1
  • 20
  • 40
2
votes
0 answers

Why pickle dump size is larger than the original image dataset size?

The image dataset contains approximately 70,000 images. I tried to create 6 pickle files out of them. Therefore, each pickle dump file contains around 11519 pre-processed images. The image folder size on the disk is approximately 2.5G. However, each…
Ali R. Memon
  • 121
  • 1
  • 1
  • 12
2
votes
2 answers

After cropping a image, how to find new bounding box coordinates?

Here's a receipt image that I've got and I've plotted it using matplotlib, # x1, y1, x2, y2, x3, y3, x4, y4 bbox_coords = [[650, 850], [1040, 850], [1040, 930], [650, 930]] image = cv2.imread(IMG_FILE) gray = cv2.cvtColor(image,…
user_12
  • 1,778
  • 7
  • 31
  • 72
2
votes
1 answer

OpenCV Processing - Edge detection and Cropping

How do i remove the irregular white pixels from the preprocessed image. i have tried doing erosion and that would make all pixels black. After Preprocessing: Requirement: My Code: Mat img, edges, erode, blurred, element; element =…
Praveen
  • 267
  • 1
  • 5
  • 19
2
votes
1 answer

Tesseract options & image preprocessing

The image I try to OCR Edit : As asked, here is the original image Dear community I am trying to do some ocr. I have already pre-processed the image a lot (unskew, crop...) Now, I can read the digits myself with no problem But I can't get tesseract…
1 2
3
18 19