I'm doing an image processing problem where I'm solving a regularized l1 minimization problem for x_n where N is a 3x3 neighborhood around a given pixel
to solve this you get that x_n=median() the concatination of the neighborhood from the original image and your previous iteration x_n-1.
I didn't know how to solve this with any built in matlab codes so I just made my own.
The problem is that it's pretty inefficient and I was wondering if you peeps had any suggestions!
here's my code. (note: I didn't/don't really care about the boundy of the image)
I_noisy_update = I_noisy1;
neighborhood1 = I_noisy1(m-1:m+1,n-1:n+1);
neighborhood1 = neighborhood1(:);
neighborhood_orig = I_noisy(m-1:m+1,n-1:n+1);
neighborhood = [neighborhood_orig;neighborhood1];
I_noisy_update(m,n) = median(neighborhood);
I_noisy1 = I_noisy_update;