Questions tagged [image-processing]

10314 questions
1

votes
1

answer
3k

Views

How to find the Bit Depth of an image

I am trying to get the Statistics of image like width, height, bands, min, max, mean, stddev etc., I could find all of these but however i can't find the Bit Depth of an image. i could not find any function , is there a way for this ?
PythonLearner
1

votes
1

answer
270

Views

Generate a Gaussian Image without adding noise

I want to generate a Gaussian Image by Matlab. It has 3 circles (as three classes). The intensity in each circle will be followed by Gaussian distribution. Thus, the histogram of the image will be multiplicate Gaussian distribution as a question. However, I used a free-noise image and added it with...
Jame
1

votes
2

answer
1.4k

Views

skimage.color.rgb2gray import trouble

I am having problem with importing skimage.color module. Although I can import and call skimage.color.rgb2gray from python shell, I cannot do the same thing from my application. I checked skimage lib places on my PC. They all seems to be fine. But when I try to call skimage.color. from my code it a...
enterbutton
0

votes
1

answer
15

Views

Why is the result from cornerHarris being used to calculate euclidean distance?

I had read in the question that cornerHarris returned a matrix with confidence scores. I came across the following snippet which did not make sense to me, if it this method returns a confidence matrix. Here is the snippet. # GET CORNER MATRIX dst = cv2.cornerHarris(gray, blockSize, ksize, k) max=n...
Jessica
0

votes
0

answer
13

Views

How to avoid colour banding in polynomial interpolation background extraction

I have a code that takes some "nodes", or "samples" in an image. With these nodes I build a synthetic background image using polynomial interpolation. My problem is that for some images, with small dynamic, I have a colour banding in my result. However, my source does not have any colour banding. Th...
lock
-1

votes
0

answer
14

Views

How to detect gates objects from by Edge Detection in Python Open CV

I want to detect this gate from the video in real time. I can detect the edge. There are gates of other colours too. Can anyone suggest me how to detect the gate from here?
Adnan Sabbir
5

votes
1

answer
125

Views

Unable to use sort_contors for building seven segment OCR

I am trying to build an OCR for recognising seven segment display as mentioned below Using preprocessing tools of open CV I got it here Now I am trying to follow this tutorial - https://www.pyimagesearch.com/2017/02/13/recognizing-digits-with-opencv-and-python/ But on the part digitCnts = contour...
Mansi Shukla
1

votes
3

answer
7k

Views

CCTV Automatic number plate recognition and integration of data,software? [closed]

I have a client who is looking for a solution to integrate cctv with a (any) ANPR solution that can,I assume recognize the number plate of cars and store in a database and has the ability to post this data to other backoffice applications, crm, marketing app. etc. Is there any ready software to do t...
abmv
1

votes
0

answer
10

Views

Why do I have to save my BufferedImage before comparison?

I have a few images on my drive, and I want to compare them to images from an online resource. I read the bytes of the online image into a byte[] and then create a BufferedImage object like this: BufferedImage captcha = ImageIO.read(new ByteArrayInputStream(captchaBytes)); Then I compare this image...
Raghav
0

votes
0

answer
4

Views

How to map values from 3d color table into an image?

I'm trying to apply a color table from a png to an image, but can't match the pixel from the png to the target image. The color table is 64^3 https://imgur.com/a/i9SCpBC https://i.imgur.com/IP38EHr.png From what I understand each pixel in the larget image, need to use a similar value in the color t...
MIkael
0

votes
0

answer
11

Views

How to interpret (rho, theta) pairs found by Hough transform

I obtained a dataframe of Hough lines with variables theta, rho and score. The code I used for this is: df min(df$theta) [1] 0 > max(df$theta) [1] 6.283185 > min(df$rho) [1] -427.4126 > max(df$rho) [1] 427.414 As for theta, all values are very low. This made me think the values are in rads, rather...
Stan Zutt
0

votes
0

answer
3

Views

Load datasets and store it in another file using opencv

How can I read all images from datasets and store it in another location using opencv.
Aviii04
1

votes
1

answer
1.2k

Views

RANSAC with multiple lines to be detected

This is a bit of a theoretical question, but I was wondering how one randomly chooses points when there are multiple lines to be detected in an image. In most examples I have seen so far, there seems to be only one line to be detected, and it seems easy. However, I am not sure how it is extended to...
user2857014
1

votes
1

answer
1.3k

Views

Python 2.7: Area opening and closing binary image in Python not so accurate

I am using Python 2.7 and I used following Python and Matlab function for removing noises and fill holes in this image . 1. Code to remove noise and fill holes using Python and Opencv img = cv2.imread("binar.png",0) kernel = np.ones((5,5),np.uint8) open = cv2.morphologyEx(img, cv2.MORPH_OPEN, kernel...
Naseeb Gill
1

votes
1

answer
52

Views

How does PyTorch handle labels when loading image/mask files for image segmentation?

I am starting an image segmentation project using PyTorch. I have a reduced dataset in a folder and 2 subfolders - "image" to store the images and "mask" for the masked images. Images and masks are .png files with 3 channels and 256x256 pixels. Because it is image segmentation, the labelling has to...
Julianno Sambatti
1

votes
3

answer
113

Views

Python / numpy: Remove empty (zeroes) border of 3D array

I have a 3D numpy array. This can be thought of as an image (to be exact it's values of field points). I want to remove the border (0 values, note that there are negative values possible) in all dimensions. The restriction is that the dimension remains the same for all molecules, eg. I only want to...
beginner_
1

votes
1

answer
40

Views

Applying threshold to an image

I am trying to write a function that thresholds a grey-level image F and a threshold value t (0 ≤ t ≤ 255) such that r = 0 for r < t and r = 255 otherwise. I have tried to implement this, but imshow(r) does not produce an output. function f = imgThreshold(img, t) f = img; if (f < t) f = 0; else...
CObject
4

votes
1

answer
226

Views

Tensorflow: Simple 3D Convnet not learning

I am trying to create a simple 3D U-net for image segmentation, just to learn how to use the layers. Therefore I do a 3D convolution with stride 2 and then a transpose deconvolution to get back the same image size. I am also overfitting to a small set (test set) just to see if my network is learning...
CAta.RAy
1

votes
1

answer
56

Views

Low Pass Filter for blurring an image

I'm trying to blur an image using fft by passing a low pass filter that I created but the output yields to be an image full of gray noise. from scipy import fftpack import numpy as np import imageio from PIL import Image, ImageDraw image1 = imageio.imread('image.jpg',as_gray=True) #convert image to...
sspatole
2

votes
0

answer
18

Views

Replacement of circular spots by respective colors

My objective here is to replace the spot in mask_image by a color corresponding to the spot in original_image. What I did here is to find connected components and labeling them, but I can't figure out how to find the corresponding labeled spot and replace it. Any help would be appreciated. Or how ca...
Chinmay Athavale
1

votes
2

answer
4.1k

Views

storing and retrieving images in dictionary - python

can anyone tell me how to store images in dictionary, and how to retrieve images from the dictionary based on the key value. Thanks in advance!
varsha_holla
0

votes
0

answer
6

Views

How can I use ImageDataGenerator class to generate either train and label as image for a keras model?

I want to train a model to generate new images using Keras and I would use the ImageDataGenerator class to generate batches of images. The problem is that I can't find a way to use this class to generate train and label batches as image. I want to pass to the model as training some images and as lab...
Syrius Deffey
-1

votes
0

answer
14

Views

Measuring distance between tiny objects from low res images

I have 100 images which show spirale objects (metal) and their movement pattern. Folder-Zip: https://ufile.io/x057h These were measured in an timely period of 10 Milli Seconds. Also they are tiny (~2mm). The result are very inconsistent lighting conditions. On the images, you can see the object (low...
1

votes
2

answer
589

Views

Scale image object to match another object's scale

I have two sets of images of different size for each set. The first set is images of 400x400 pixels with real picture objects. The second set is 319x319, with image silhouettes of different scale than the real picture objects. What I want to achieve, is basically to have the silhouettes replaced by...
kalfasyan
1

votes
1

answer
226

Views

How to transform different shapes to circles in Matlab

I have this image: that has different shapes, and I want to transform each shape in a circle. And each circle must have different radius, depending on the size of the shape. How can I do that? With Morphology Operations or there are any function on Matlab that does that? I used the function Region...
Pedro Marques
1

votes
2

answer
2.3k

Views

Find [x,y] rotated coordinates locations in image [OpenCV / Python]

I want to rotate an image at several angles sequentially. I do that using cv2.getRotationMatrix2D and cv2.warpAffine. Having a pair of pixels coordinates [x,y], where x=cols, y=rows (in this case) I want to find their new coordinates in the rotated images. I used the following slightly changed code...
Roxanne
1

votes
1

answer
2k

Views

How to implement RGB images as tensors in tensorflow?

I'm new to tensorflow and I'm trying to create a model of Stacked Sparse Denoising Auto-encoders. I have found a way on how to load my training ( and testing) set through examples from here and github but I cannot use them as a tensor to perform the required multiplications etc. (this code is only f...
costisst
1

votes
2

answer
525

Views

opencv cv::addText exception if no window

I'm using OpenCV 3.2.0 compiled with Qt support and function cv::addText to put text on image. Here's the simplest code that reproduces the error #include #include using namespace cv; using namespace std; int main(int argc, char** argv) { if (argc != 2) { cout
1

votes
1

answer
1.8k

Views

SimpleITK Resize images

I have a set o 3D volumes that I am reading with SimpleITK import SimpleITK as sitk for filename in filenames: image = sitk.ReadImage(filename) Each of the volumes has different size, spacing, origin and direction. This code yields different values for different images: print(image.GetSize()) print(...
Miguel
1

votes
1

answer
8.7k

Views

OpenCV : Remove background of an image

I am using Opencv and python to detect shapes and then crop them. I have succeeded to do that, however now I am trying to take the cropped images and remove their backgrounds. The image has a circle inside and surrounded by gray color. (It can be gray or can be even more than one color). How can I...
1

votes
1

answer
1.3k

Views

Resize image preserving aspect ratio in Tensorflow

I am fairly new to TF. I am trying to resize an image tensor so that the lowest dimension of the image is a constant value LO_DIM. In a non-tf environment, I'd just do something like this: if img.size[0] < img.size[1]: h = int(float(LO_DIM * img.size[1]) / img.size[0]) img = resize(img, [LO_DIM, h])...
kuranes
1

votes
1

answer
51

Views

Merging two 1d histograms into one

I got two histograms which I created with standard openCV function calcHist: int getModels(string filename) { Mat src = imread(filename, 1); if(!src.data) { return -1; } Mat imageHSV; cvtColor(src, imageHSV, COLOR_BGR2HSV); vector bgr_planes; split(imageHSV, bgr_planes); int histSize = 256; flo...
user7303261
1

votes
1

answer
792

Views

How to display 16-bit 4096 intensity image in Python openCV?

I have images encoded in grayscale 16-bit tiff format. They use a variant of 16-bit color depth where the max intensity is 4,096. I believe the default max intensity in openCV is 65,536, so my image shows up as black using the following code. import cv2 image = cv2.imread("test.tif", -1) cv2.imshow(...
Jay Wong
1

votes
2

answer
792

Views

opencv - plot contours in an image

I am trying to draw contour around an image. I can see that contours being found but I am not able to draw the outline. The color of the contour seem to be either of the two (black and white) colors. import cv2 import numpy as np import matplotlib.pyplot as plt from skimage import io %matplotlib in...
learner
1

votes
1

answer
134

Views

Average filter without built-in function

I am having a problem with the output. I am using 5*5 filter for making image smooth. As average filter smooth our image but this one is making the image more dull. Can anyone help me with this problem? Input Image is: img_2 = imread('White-Bars.png'); filter = ones(5 , 5)/25; working_img = img_2(:,...
blu.
1

votes
1

answer
31

Views

How can I crop black corners from a scanned image?

Scans/photocopies often miss the corner which comes out black. How can these black corners be made white using python with numpy, pillow or skimage?
simon
1

votes
1

answer
80

Views

Fill empty enclosed parts from image

I'm looking for an algorithm that would produce the result I'm showing above. I tried so far some dilatation and erosion from PIL but the results are not the ones I'm looking for because I'm losing some essential details of the letters. Furthermore, they tend to be very bold afterwards, and erosion...
Peter
1

votes
1

answer
56

Views

SSIM for 3D image volume

I'm working on an image super-resolution problem (both 2D and 3D) using TensorFlow and am using SSIM as one of the eval_metrics. I'm using image.ssim from TF and measure.comapre_ssim from skimage. Both of them are giving same results for 2D, but there's always a difference in results for 3D volume...
End-2-End
1

votes
1

answer
46

Views

How to remove white annotations from image?

I try to remove the white annotations of this image (the numbers and arrows), as well as the black grid, with MATLAB: I tried to compute, for each pixel, the mode of neighbors, but this process is very slow and I get poor results. How can I obtain an image like this one? Thank you for your time.
S.Saladas
1

votes
1

answer
35

Views

Image Processing: Determining a trapezoid from a list of points

The problem is fairly simple: I have the following image. My list of points is the white pixels, I have them stored in a texture. What would be the best and possibly most efficient method to determine the trapezoid they define? (Convex shape with 4 corners, doesn't necessarily have 90 degree angles)...
MattMatt2000

View additional questions