seperating vertical and horizontal images from an image seperately
1 次查看(过去 30 天)
显示 更早的评论
I want to seperate the horizontal and vertical images seperately fom an image.If F is my original image then for getting its vertical image I have the equation
Dv_F(i,j)=Abs(F(i,j)-F(i-1,j)) for i=1 to m-1, j=0 to n-1
For horizontal image
Dh_F(i,j)=Abs(F(i,j)-F(i,j-1)) for j=1 to n-1, i=0 to m-1
How can I implement these in matlab? Its very urgent. Please someone help.
0 个评论
回答(1 个)
Turlough Hughes
2019-10-15
编辑:Turlough Hughes
2019-10-15
I'm not sure what you mean by vertical / horizontal image but from your equation it looks like you want to find the absolute difference of adjacent pixels to form a new image, first in the vertical direction and secondly in the horizontal direction. Let's a assume you have a grayscale image F, you can use the imabsdiff function
Dv_F=imabsdiff(F(1:end-1,:),F(2:end,:))
Dh_F=imabsdiff(F(:,1:end-1),F(:,2:end))
Please refer to the documentation on imabsdiff to confirm if this is what you are looking for.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!