2,096 questions
1
vote
2
answers
232
views
2D matrix convolution with convolve() in R
I am trying to perform 2D matrix processing (convolution) by applying a kernel/filter to a large matrix. There is a built-in function convolve that can perform convolution. It offers three different ...
1
vote
1
answer
143
views
Torch Conv2d results in both dimensions convolved
I have input shape to a convolution (50, 1, 7617, 10). Here, 7617 is word vectors as rows, and 10 is the number of words in columns. I want to convolve column-wise and obtain (2631, 1, 7617, 1), 1 ...
0
votes
0
answers
74
views
What is the fastest way to compute a filter in Fourier space?
I am currently working on a beam propagation code. The code basically consists of a transversal profile (a 2000x2000 array) which is propagated a small distance, then has its borders filtered, then ...
0
votes
0
answers
90
views
Tensorflow speed of tf.nn.conv2D used instead of opencv GaussianBlur
I'm trying to move some computer vision tasks to tensorflow. The most intensive ops are convolutions, like GaussianBlur. The timings I get using timeit suggest that the GPU equivalent is >10 x ...
0
votes
0
answers
77
views
Why is my OpenCL optimized convolution kernel slower than the naive version at higher workgroup sizes?
I'm working on a GPU-accelerated 2D convolution in OpenCL for a 2048x2048 image using a 3x3 Sobel filter. I implemented two versions of the kernel:
A naive version that uses only global memory.
An ...
1
vote
1
answer
122
views
Using scipy.ndimage.correlate only calculate elements with full overlap
I am trying to use scipy.ndimage.correlate to replicate the output of IDL convol() function. The IDL function only calculates elements where there is full overlap between the input and the kernel.
So, ...
1
vote
1
answer
143
views
Why is the convolution of two different frequency sine waves not 0? (Windowing help)
I'm trying to figure out how to window two different frequency sine waves in such a way that their convolution produces a 0 signal.
I have code that works for sine waves with integer periods:
T = 1000
...
0
votes
0
answers
56
views
How to convolve a 3D array with Lorentzian kernel along axis=2?
I have an array img_data of shape (x, x, n_channels) and I want to convolve / smooth along the axis=2.
Specifically, I would like the output shape to be (x,x,n_channels//3), after convolving the ...
1
vote
1
answer
153
views
Separable convolutions in PyTorch (i.e. 2 1D-vector-tensor "traditional" convolutions)
I'm trying to implement an image filter in PyTorch that takes in two filters of shapes (1,3), (3,1) that build up a filter of (3,3). An example application of this is the Sobel filter or Gaussian ...
2
votes
1
answer
186
views
CuPy ndimage convolution in a nested for-loop seems fast but the next execution is stalled
I am trying to write code that convolves a 3D image with a 3D wavelet kernel that can be described using three independent parameters. I want to analyze the results of the convolution for all ...
1
vote
1
answer
141
views
Convolving with a gaussian kernel vs Gaussian blur
While looking for a way to generate spatially varying noise, I came across this answer, which is able to do what I wanted. But I am getting confused about how the code works.
From what I understand, ...
2
votes
1
answer
111
views
CUDA constant memory provides no improvement compared to the global memory accesses
I am using 2D convolution and applying filter (3 x 3) to an image (2048 x 2048). I wrote two versions: one uses global memory accesses and another uses constant memory for the filter. When I benchmark ...
0
votes
1
answer
82
views
Why does my code affect the imageData.data at times correctly and at other (random) times, in an unexpected way?
I have a code that should affect an image by applying a laplace filter to the top left quarter and to the bottom left quarter separately. But when doing so, sometimes the second application of the ...
1
vote
1
answer
53
views
Efficient Computation of convolution-like expression [closed]
Let p(z_i | x_i) for i=1...m be some probabilities, where x_i and z_i are in {0,1}. I want to efficiently compute the following:
for all z_1...z_m.
I know that convolutions can be computed ...
1
vote
1
answer
68
views
Creating a decaying halo around a cluster in an image with python
I'm trying to modify the sorrounding values around clusters in an image so that the neighbours pixels decrease to zero following a exponential decay. I need to find a way to control the decaying rate ...