Questions tagged [image-preprocessing]

285 questions
0
votes
0 answers

Is it an overfitting problem for SVM classification?

I am new in Machine learning, and I want to detect emotions from the face. Preprocessing: I used equalizeHist to equalizes the histogram of grayscale images (JAFFE database with 213 images), in the goal to normalizes the brightness and increases the…
0
votes
0 answers

What happens to image type when importing images in python?

libraries such as PIL, Skimage and matplotlib mping all produced the same result img1 = io.imread("1.3/blurry-moon.tif") img1 = img1.astype('int32') img2 = io.imread("1.3/blurry-moon.tif") imageArray = np.copy(img1) image1 = np.copy(img1) image2 =…
0
votes
3 answers

How can I do a segmentation like this

In this work: Montouro et al specifies a way to segment OCT images like this: I want to do a similar segmentation but I don't know-how. This is what I tried: # load image img = cv2.imread('OCT.jpeg') # define colors color1 = (255,0,0) color2 =…
user12268725
0
votes
1 answer

Can a Neural Network Image Classifier distinguish between similar classes?

I have been training an image classifier using Keras, and have tried out various convnet architectures. The dataset consists of jars of food. The problem is that many of the classes are extremely similar, with the differences between them often just…
0
votes
0 answers

ValueError: when using sklearn's train_test_split

I have Images and Labels, and I want to divide them into training and validation sets. I have the below code for the same. train_test_split guarantees that both sets have the same proportion of data. from sklearn.model_selection import…
iamkk
  • 135
  • 1
  • 16
0
votes
1 answer

Reading File from directory

I am doing some preprocessing, and after I am trying to open a file that has floats within the file name but I get a ValueError: invalid literal for int() with base 10: 'output_patch_fp' and I do not know why. Can anyone help? Code is below: …
Tristan
  • 1
  • 2
0
votes
1 answer

Pytorch dataloader Transforms tensor error

[Unable to access the pytorch dataloader values for use TypeError: default_collate: batch must contain tensors, NumPy arrays, numbers, dicts, or lists; found object The error can be reproduced by running https://jovian.ml/pravin-bnmit/cxr/ on…
0
votes
1 answer

Merging images from different folders and storing to a different folder

I have three different folders m1, m2, and m3. The 'm1' folder contains images of the format image(i)_m1.png (where i =1 to N), 'm2' folder contains images of the format image(i)_m2.png, and 'm3' folder contains images of the format image(i)_m3.png.…
shiva
  • 1,177
  • 2
  • 14
  • 31
0
votes
1 answer

How to fill contour of connected edge and crop the image out in python?

click to view the image the left side is the original image and I've used canny edge detection method to only get the outer edge of the image as you can see from the right side image. Now is it possible to fill the connected edge with white color…
Meor Izzat
  • 17
  • 1
  • 6
0
votes
0 answers

Automatic Image Level Adjustment in Matlab

I've transformed an image from RGB to cieLAB and then extracted a channel. How can I automatically adjust the tonal range of the a channel like in Adobe Photoshop? A = imread('image.jpg'); CT = makecform('srgb2lab'); lab = applycform(A,CT); a =…
MatejZ
  • 1
0
votes
1 answer

Change input shape dimensions for ResNet model (pytorch)

I want to feed my 3,320,320 pictures in an existing ResNet model. The model actually expects input of size 3,32,32. As I am afraid of loosing information I don't simply want to resize my pictures. What is the best way to preprocess my images, so…
feiland
  • 11
  • 1
  • 1
  • 4
0
votes
1 answer

Cropping and storing bounding box image regions for a collection of images?

The current code aims to crop and store multiple bounding box image regions for a set of images in a folder. The cropped bounding box image regions are store to a different folder. There are a total of 100 images, each image has multiple bounding…
shiva
  • 1,177
  • 2
  • 14
  • 31
0
votes
1 answer

How to implement one hot encoding without any ML frames in python?

doing MNIST tutorial without any MLframe, but got stuck in one hot encoding stage y contains label data of digits images 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and its size is (10000, ) I want to convert each category numbers to one hot encoding array 0 : 1 0…
0
votes
1 answer

OpenCV - Image Text enhancment - OCR pre-processing

my goal is to pre-process image (extracted from a video) for OCR detection. Text is always black, like this example: I tried to use age framering and HVS mask: cv2.accumulateWeighted(frame,avg2,0.005) #res2 = cv2.convertScaleAbs(avg2) # Convert…
user3925023
  • 667
  • 6
  • 25
0
votes
1 answer

Pytorch: RGB value ranges 0-1 after rescaling, How do I normalize images?

I wrote a class to rescale images, but the RGB value became ranging from 0 to 1 after preocessing. What happened to the RGB which intuitively should be ranging from 0-255 ? Following are the Rescale class and the RGB values after…