Well, zs is the one that I need to work on. zs is a row vector of a set of pixels that belong to a window surrounding pixel s in the blurred image X. I need to evaluate the 7 x 7 window on each pixel but I'm not sure what I need to do when I select a pixel that is for example, on the top left corner of the image. Once I have zs I know what to do. ys = zs * theta is for one pixel. ys is the pixel of an image Y.
How can I move a 7x7 filter around an image?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
So I have an estimated filter, theta, to apply it to a blurred image. For each pixel on the image I have to do the following:
ys = zs * theta
Where zs is a 7x7 window sorrounding pixel s and theta is the minimum square error to adjust the blurred image. How can I move the 7x7 window filter around the image, especially when I select pixels that are located at the edge of the image?
Risposte (1)
Image Analyst
il 15 Apr 2017
For a simple multiplication, you can use conv2(). Assuming zs is the 2-D input image:
ys = conv2(zs, imrotate(theta, 180), 'same');
If zs is uint8 or uint16, cast to double before you pass it to conv2():
ys = conv2(double(zs), imrotate(theta, 180), 'same');
or use imfilter():
ys = imfilter(zs, theta);
3 Commenti
Image Analyst
il 16 Apr 2017
If zs is a row vector - one complete row from an image - then ys is also a row vector since you're just multipling it by a scalar theta. So where does the 7x7 window come into play? And anyway, how do you apply a 7x7 2-D square window to a 1-D vector?
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!