Questions tagged [convolution]

A mathematical operation that combines two signals to generate a third signal. Convolution often arises in audio processing (e.g., filtering, reverb) and image processing (e.g., blurring, edge detection).

Convolution takes two signals and combines them to generate a third signal. For 1-D signals, the operation can be thought of as sliding the time-reverse of one signal along the other, and at each time step, taking the integral of the product of the signals (see wikipedia). The convolution operation describes the response of linear time-invariant systems to common input signals. Therefore, it commonly occurs in digital signal processing (DSP) contexts. Audio and image processing are two very common application areas for convolution.

A simple implementation for convolving two discrete time signals requires M*N multiply-add operations, where M and N are the lengths of the two signals. However, by taking advantage of the fact that convolution in the time domain is equivalent to multiplication in the frequency domain, and that transforming between domains can be implemented with O(N*log N) operations, convolution can be sped up. See here for more details.


Related tags

2052 questions
0
votes
0 answers

CNNs: First Convolution Operation

I have not fully understood one aspect of the CNNs: is the first hidden layer the same than the convolved image? I mean, Can we talk about the first hidden layer and the first convolution operation in the same way ? Are they two ways of expressing…
0
votes
0 answers

Error: Using a target size (torch.Size([1, 55, 46, 46])) that is different to the input size (torch.Size([1, 55, 47, 47]))

I am getting error this error while running my pytorch model /usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:47: UserWarning: Using a target size (torch.Size([1, 55, 46, 46])) that is different to the input size (torch.Size([1, 55, 47,…
user16668992
0
votes
0 answers

Box Blur Convolution Outputting Same Result After Changing Kernel

I am new to Matlab and I am trying to use a box blur on a grayscale image. When I change the values in the kernel I use, I do not see any difference in the blurred images I get. box_filter = 1/9 * [1, 1, 1; 1, 1, 1; 1, 1, 1]; box_blur_grey =…
coder_jam
  • 94
  • 12
0
votes
0 answers

If I add a constant value to all pixels of a single channel image, would the result of Laplacian of Gaussian (LoG) convolution remain the same?

I am working on an image processing deep learning project using tensorflow. I calculated a brightness bias to add to all pixels of an image and calculated the LoG output of it. However, the sum of all pixel values was approximately the same as it…
0
votes
1 answer

NCHW input matrix to Dm conversion logic for convolution in cuDNN

I have been trying to understand the convolution lowering operation shown in the cuDNN paper. I was able to understand most of it by reading through and mapping various parameters to the image below. However, I am unable to understand how the…
0
votes
0 answers

How do I invert a convolution operator?

The title may be a little obscure, sorry. I'm not quite sure how to phrase it otherwise. The problem is as such: I have a 2D kernel (as is used for convolution) and a vector of weights (e.g., floats or ints). I would like to produce a 2D array of…
Aku
  • 526
  • 4
  • 17
0
votes
1 answer

Tensorflow functional API Model build

why is is showing all the layers of VGG19 in the output of features.layers? layer_outputs = [layer.output for layer in vgg_layers] layer_outputs = layer_outputs[22:-1] features = Model(inputs=vgg_input,…
0
votes
1 answer

2D Discrete Convolution of Image and Mask using C

I am trying to make a convolution algorithm for grayscale bmp image. The below code is from Image processing course on Udemy, but the explanation about the variables and formula used was little short. The issue is in 2D discrete convolution part, im…
0
votes
1 answer

How can I use FFT to find convolution function by python?

I have output and input of a system, As I know f=conv(h,g) that h is convolution function in the FFT we can write F=H*G. So Can I find H by : H=F/G or no? I try to write a code like this: # -*- coding: utf-8 -*- """ Created on Wed Dec 15…
0
votes
0 answers

Vectors and boost::multiprecision::mpq_rational in Rcpp

I am a C++ beginner hoping to find some help here. To motivate my question, I wish to write a function that performs convolutions in C++ via either infinite precision or rational arithmetic. Since I wish to call this function from R (via Rcpp), I…
0
votes
1 answer

Why do i have to multiply the convolution value times tpas?

What does the commented line do? More specifically, why do I have the conv function times tpas value? tstart=0; tstop=0.1; tpas=0.0001; f=100; t=tstart:tpas:tstop; x=0+10*t; subplot(3,1,1); plot(t,x,'linewidth',2); axis([0 0.1001 0…
0
votes
0 answers

How to cast the Average layer output to push it into a Conv2D layer in Keras?

I am trying to build a custom CNN using keras functional API. The issue with my theoretical idea and pratical one is that when I try to Average the ouput of three Conv2D layers and pass it to another Conv2D. I get an error saying that the output of…
haddagart
  • 68
  • 1
  • 8
0
votes
2 answers

How can I make a filter in pytorch conv2d

I am really new to pytorch, and I've been making code convolution myself. To apply convolution on input data, I use conv2d. In the documentation, torch.nn.Conv2d(in_channels, out_channels, kernel_size ...) But where is a filter? To convolute, we…
JAEMTO
  • 209
  • 3
  • 15
0
votes
0 answers

Using scipy.signal.convolve2d to implement vectorized scipy.signal.convolve 1d?

Support i have two same length list of 1d vectors d1, d2 with same shape. My goal is to obtain the new list r[i] = np.convolve(d1[i], d2[i], mode='same'). And my questions is how can i construct some 2d matrix m1, m2 such that, i can benefit from…
yupbank
  • 263
  • 1
  • 13
0
votes
0 answers

Get a bounding box from a convolution between two images in python

I have 5 sample images (approx. 500x300) representing letters that can appear in a larger image (approx. 3000x3000). All images (both samples and larger images) are monochrome. The letters always have the same shape, orientation and size as the…