shifting a part of image (not rectangular shape)
1 次查看(过去 30 天)
显示 更早的评论
I have an rectangular shape image. In which there is an inclined line (not vertical or horizontal) separating that image into 2 parts. I want to shift one part of the image down by a fixed amount of pixels. how can do that
0 个评论
采纳的回答
Walter Roberson
2011-10-10
The question is not clear. Are you pulling one part of the image "away" from the dividing line, or are you pushing it "into" the dividing line?
If you are pulling it "away" from the dividing line, then what should go in to the new space between the dividing line and the new location, and what should happen with the part of the image that would protrude beneath the old bottom of the image?
If you are pushing it "into" the dividing line, should the pixels that would go above the line just be discarded? And what should go in to the empty space left by moving the image?
Is the inclined line a straight line defined by a start and end point, or do its boundaries need to be found by examining the image to detect some distinctive property of the boundary?
3 个评论
Walter Roberson
2011-10-10
So the original pixels 495-500 can be thrown away if they would go beyond the edge?
Based upon your original description, I thought perhaps you wanted to shift a cut rectangular block -- rectangular until it hit the dividing line. But your answer has left me thinking that perhaps you meant something else?
Does the straight line only go through part of the overall image? When the rows are shifted, should the portion of the image between the left or right edge of the line and the edge of the image be left as-is?
An example might help.
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
Walter Roberson
2011-10-10
That last should have been written in terms of the upper and lower part of the line edge, not the left and right part.
更多回答(3 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!