Image processing: Minimizing laplacian norm with boundary conditions [closed] - matlab

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm trying to minimize this function (by A):
argmin_A (||L(A)||^2 + a||A-B||^2*)
where:
A is a MxN image L is the Laplacian Operator
||.|| is the usual norm (Frobrenius)
a is a weight parameter
B is a matrix of size (M+2*k)xN
where k is an integer parameter.
(*) indicates that we just consider the pixels in the boundary (we want to preserve in A the pixels in the boundary of B).
Maybe the problem has a trivial solution, but I'm absolutely blocked.
If you need more details, it's (4) equation in this paper.
I will be very grateful for any help provided.

Without looking carefully at that paper, gridfit does essentially that, although it does not employ the boundary conditions you ask for. You could certainly write what you want however, or you could simply apply a weight to the boundary points. This is not a difficult problem, but in order to solve it efficiently, you would want to employ the sparse matrix capabilities of MATLAB.

Related

What does linsolve(A,B) return when the number of equations is larger then number of variables? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I by accident put a matrix A with far more rows then columns into linsolve(A,B). So it should be inconsistent system of equations. However what I got was a 'solution' which fits my task far better. So what exactly does it return when you have more columns then rows?
What you have seems to be an overdetermined linear system, that can be solved by the least-square method.
If your matrix A has more rows than columns (m > n) it means that you have more equations than unknowns, so an exact solution can be almost impossible to find. What you can obtain is a good enough solution that minimizes the error.
You can refer to the page Overdetermined system for more insights.

Limit of zero padding [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I have a signal in energy. But it's not from zero to E, but from A to B. It has N data points. If I add 2.5N zeros to the left of A, I will have a good enough signal in time after Fourier Transform. However, is it too much zeros to add? How much zeros can be added without producing too much artifacts in the signal?
Zero-padding before an FFT or DFT just results in the interpolation of more points on the same spectral result curve. You can zero-pad by a very large number if you just want a lot of smoothly interpolated points between the non-zero-padded FFT result.

matlab indices not in range? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm trying to write the optimal quantization for IP.
I'm new to matlab and in this code, i'm trying to go over every pixel in every interval of Z, multiply it with it's histogram and sum it , so I can calculate the optimal Q.
problem : Attempted to access hist(257);index out of bounds because numel(hist)=256.
for i=1:K,
for j=(Z(i)):Z(i+1),
sum1=(j)*hist(j+1)+sum1;
count=count+hist(j+1);
end
end
The error is telling you that you cannot access hist(257) because the array hist only has 256 elements in it. Note that hist is also a built in function name so you really ought to consider giving your variable a different name.
How to solve:
Think carefully about your code, and what you are trying to achieve. What are Z. hist and K? What is the largest value that j can reach (=Z(i+1))? That is the value with which you are indexing hist, and apparently hist is not that big. What then is the shape of each variable?

Bicubic Interpolation [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
My assignment question is :
"In Lecture 9 Slide No.21 There are Affine Transform based equations. Take an input gray-scale image and apply these transformations one by one. The interpolation used must be bi-cubic."
Now the equations are:
I am not understanding what exactly is meant by this question? I mean should i just apply transformation on an image or what? I am confused
I'm sure your TA could answer here...
Anyway, you have to apply the transformations to a set of coordinates (probably two coordinates per pixel if you want to transform images). Since you will get real values instead of integers (as the pixel grid requires), you have to apply bicubic interpolation to obtain the final values on the destination pixel grid.

best result for salt and pepper [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
i have a picture with salt and pepper noise added to it. my task is to remove it using these functions :
You may use matlab functions ginput, to find specific points in the image (of course in the script you should hard code the coordinates you need).
You may use conv2, fft2, ifft2, fftshift etc.
You may also use median, mean, max, min, sort, etc.
As far as i can tell. i can use MinMax filter or Median Filter.
my task is to get the best results! so far i think Median filter will get me that.
is median filter really better than doing MinMaxMinMax.... ? is there a better way to get better results?
A median filter is a great way and text book approach to address salt an pepper noise. Matlab offers a function medfilt2 for this purpose, but of course you can also code your own by calculating the center intensity of a 3x3 window w using median(w(:)).