# Tag Info

7

Convolution is associative, so $I_{xx} = K_{sobel} * (K_{sobel} * I) = (K_{sobel} * K_{sobel}) * I$ meaning the convolution of a 1st order Sobel filter kernel with another 1st order Sobel filter gives the filter kernel for a second order filter. So e.g. a 2nd order horizontal Sobel filter kernel is: $\left( \begin{array}{ccc} -1 & 0 & 1 \\ -... 7 I was working in opencv and trying to find the peak of a gradient generated by distance transform. I realised that using morphologic operations (erosion/dilatation) in grey-scsale images was very useful in this case. If you erode dilate a grey-scale image, any pixel is going to take the value of the lower/highest neighbour. You can therefore find peaks of ... 5 Apart from a sign error, your result looks correct. The term with$(1-a_{1k})$should have a positive sign. Also note that$\text{sgn}(x)$as the derivative of$|x|$is of course only valid for$x\neq 0$. If you take this into account, you can write the derivative in vector/matrix notation if you define$\text{sgn}(\mathbf{a})$to be a vector with elements$\...

5

Here is what I have so far. The way I'm populating my Hough space is far from optimal. I'm pretty sure there's some vectorization I can do to make it faster. I'm using Matlab R2011a. Original Image Suggestions are appreciated, Thank you. clear all; clc; close all; %% read in image and find gradient information img = rgb2gray(imread('123.png')); [rows, ...

5

That's a trick which you will also find in a DSP context, that's why I choose to provide an answer here. It is related to the Wirtinger derivative, and you can find more details about it in this answer over at math.SE. In practice this trick is often used to compute the extremum (minimum or maximum) of a real-valued function depending on a complex variable (...

4

The problem with $\left|f\right|$ is that since is not analytic the standard definition of complex derivative does not apply. A solution is to use Wirtinger derivatives: http://en.wikipedia.org/wiki/Wirtinger_derivatives A detailed account of Wirtinger calculus for signal processing problems is http://arxiv.org/abs/0906.4835 Another (probably simpler) ...

3

Indeed, it adds smoothing in the $y$ direction. The Sobel filter is the separable combination of the centered derivative $[−1,\;0,\;1]$ along $x$, and the $3$-point binomial smoother $[1,\;2,\;1]$ along $y$.

3

The quadratic surface is determined by the autocorrelation matrix of the data, which is always positive definite or positive semi-definite. This means that any stationary point is always a minimum. In the worst case, this minimum is not unique if the matrix is singular, but it can never be a saddle point.

3

For this operation to work, you need to imagine that your image is reshaped as a vector. Then, this vector is multiplied on its left by the convolution matrix in order to obtain the blurred image. Note that the result is also a vector the same size as the input, i.e., an image of the same size. Each row of the convolution matrix corresponds to one pixel in ...

2

For planar elements (implied by the wording "structuring element") the containment of origin is enough to maintain the properties of anti-extensivity for erosion, and extensivity for dilation as can be found in many texts and you also pointed that out. So, yes, this is enough for the non-negativity for the arithmetic difference (this is directly shown by ...

2

I looked up in Jaehne, Gonzalez, Soille (the one you've posted as well as Mathematical Morphology and Its Applications to Image and Signal Processing) and some other special morphological papers and haven't found neither any design criteria for the structuring element nor any special hints why it has to be symmetrical. Personally I think that a symmetrical ...

2

You can create your own custom kernel filter using something similar to this example. if you just want to find image gradients there are other options such as sobel and laplace If your aim is edge detection, I find canny is best for this in most cases.

2

For applications to images or convolution networks, to more efficiently use the matrix multipliers in modern GPUs, the inputs are typically reshaped into columns of an activation matrix that can then be multiplied with multiple filters/kernels at once. Check out this link from Stanford's CS231n, and scroll down to the section on "Implementation as Matrix ...

2

As the commenters have stated, this is not the same. The relationships between down/up-sampling and filtering are formally described by the noble identities. In your case down-sampling followed by filtering with [-1 0 1] is equivalent to filtering with [-1 0 0 0 1] first and than downsampling. In any case you need to make sure your don't alias before down-...

2

I am by no means an expert on total variation, however I think you should check out this Wikipedia page. It doesn't directly answer your question, but I believe the lemma below illustrates the relationship between total variation and divergence. There, it gives a lemma that follows from the Gauss-Ostrogradsky theorem and provides a proof for it, $\int_{\... 2 Recursive least squares (RLS) filters don't use gradient descent. As their name suggests, they use a least-squares fit to determine the optimum coefficients at each time step. Via clever formulation of the filter structure, one can use the calculations done from time step$n$to recursively calculate the updated coefficients for time step$n+1$without ... 2 So, if you're using Matlab, you can do: X = your matrix [gx,gy] = gradient(X); % first order gradient [gxx,gxy] = gradient(gx); % second order gradient [gxy,gyy] = gradient(gy); % second order gradient To find the curvature of features I advise you to look into the eigenvalues and eigenvectors of a Hessian matrix. A hessian matrix is a square matrix of ... 2 so with an LMS filter, we have a time-variant$N$-tap FIR filter: $$y[n] = \sum\limits_{k=0}^{N-1} h_n[k] \, x[n-k]$$$x[n]$is the input signal,$y[n]$is the FIR output, and$h_n[k]$are the FIR tap coefficients at the time of sample$n$. with an LMS filter, we also have another input called the desired signal:$d[n]$. we want our LMS filter to adapt ... 2 Yes, the$1/2$factor correction could be present, so that the magnitudes between a) the continuous derivative and b) the approximated gradient remain consistent in some way: a (continuous) line with a unit slope will have its discretized version get a unit gradient with the$1/2$factor. However, as long as the factor is nowhere applied, all gradient ... 2 Background The Sobel edge detector was introduced back in 1968 by Irwin Sobel and Gary Feldman as the Sobel-Feldman operator. In broad strokes, 'edges' in images are related to gradients, which motivated their development of a discrete differentiation operator. The Sobel-Feldman operator only computes an approximation of the gradient and not the actual ... 2 Well, if you go through the documentation of fspecial() you'd see it returns the following filter: h = fspecial('sobel') returns a 3-by-3 filter h that emphasizes horizontal edges using the smoothing effect by approximating a vertical gradient. To emphasize vertical edges, transpose the filter h'. [ 1 2 1 0 0 0 -1 -2 -1 ] Namely in the way you ... 2 I felt I needed to write an additional answer to try to clear my mind about the question. Here is the try, step by step. Caveat: for simplicity, I used the same notation$C$of a function of reals$u$and$v$, for its rewriting in$x=u+iv$and$\bar x$, and on complex$x$alone. I hope it is not confusing for the reader. Let$C(x)$be a function (we don't ... 2 The easiest approach would be writing each case using Matrix Form of the convolution. In this answer we assume the discrete convolution is applied only on valid support (Matching MATLAB's valid parameter for the convolution). Namely, given$ x \in \mathbb{R}^{m \times n} $and$ h \in \mathbb{R}^{k \times l} $then$ h \ast x \in \mathbb{R}^{ \left( m - k + ...

2

1-d MMSE derivative filter for uniform spectral prior With some simplifying assumptions about the signal distribution, a filter with least square frequency response error is the Bayesian minimum mean square error (MMSE) filter for a uniform prior of the frequency spectrum. For such 1-d filters, an oversampling factor $\beta \approx 2\ldots2.5$ seems optimal,...

2

The only difference I can see between your gradient3 function and MATLAB's gradient is that the latter returns the horizontal derivative as the first output, and your code returns as "x" derivative the vertical derivative. Note that MATLAB arrays are stored such that the first index is vertical, and the second index is horizontal. Therefore, the code under ...

1

Yes, you are correct. The direction of the gradient vector (dx,dy) is (pretty much by definition) the "optimal direction of derivation". The magnitude of the gradient is the "intensity" of the edge, the steepness of the derivative.

1

To obtain the Gradient of the TV norm, you should refer to the calculus of variations. By examining the TV minimization with Euler-Lagrange equation, e.g,, Eq. (2.5a) in [1], you would see the answer. [1] Nonlinear total variation based noise removal algorithms, 1992.

1

This is a typical deconvolution problem that you can solve either by transforming to the frequency domain where convolution is a simple multiplication: $$F\left \{ {\bf{I}} \right \}= F\left \{ {\bf{z}} \right \} F\left \{ {\bf{f}} \right \},$$ where ${\mathcal{F}}$ denotes the Fourier transform (or DFT) so $f$ will be: \begin{...

1

I dont know what this axis([-.76 -.16 -15 5])’ means As far as I am concerned axis([-.76 -.16 -15 5]) set minimal and maximum values for x axis (first and second values) and y axis (third and forth values) in plot. For example: x = linspace (-10, 10, 100); y = x .^ 2; plot (x, y, 'r', "linewidth", 2); title ("S"); xlabel ("x"); ylabel ("y"); x = linspace ...

1

This is the result of taking the derivative of $\|\Phi\circ(X_{1}-X_{2})-u\|_F^2$ w.r.t. $X_{1}$: $[\Phi^{1'}(\Phi\circ(X_{1}-X_{2})-u), ...,\Phi^{J'}(\Phi\circ(X_{1}-X_{2})-u)]$ . This can be got by first finding the expression for the norm, and then taking the matrix derivative (w.r.t. $X_{1}$) to get an $N \times J$ matrix. This matrix is then ...

Only top voted, non community-wiki answers of a minimum length are eligible