Does such a spatial filter exist?

2 views (last 30 days)
Are ther any kind of 2d spatial filters that can shift a border in an image. for example, lets imagine we have a 400*400 matrix, with ones in each row and in columns 1 to 30, and with zeros in the rest of the positions. So, visualizing this matrix will give us a white/black border between columns 30 and 31. Are there any kind of spatial filters with a specific frequency response that can move this border to right or left?
I mean a spatial filter, that receives this image( with the border between columns 30-31) and outputs an image with a border between the columns 31-32, which means in the output image, we have ones up to the 31th column (while in the input image it was 30). So the border has moved to right by one column.
Are there any known types of spatial filters with this behaviour? Are there any filters that are capable to shift a border to left or right? or with a similar capability? If so, how can I implement it?
thank you all

Accepted Answer

Image Analyst
Image Analyst on 7 Sep 2014
Of course. Just shift your kernel right or left. For example, instead of a kernel for vertical edges being [-1, 1], have it be [0,0,-1,1]. You can make the shift whatever you want. Put the zeros on the opposite side to shift it in the opposite direction.
  2 Comments
payman khayree
payman khayree on 7 Sep 2014
thanks for your answer. But are there also any other solutions other than using kernel matrices or sobel method?
Image Analyst
Image Analyst on 8 Sep 2014
Well you could maybe use diff(), but why, when you have filter() or conv() that make more sense?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!