将图像分为不重叠和重叠的块
我有一张 256*256 的图像。我必须根据下面给定的重叠规则将图像分成大小为 W * W 的子块,其中 W=3,4,.....27:
如果 W<8 则没有块重叠 if 8<=W<=13 则块重叠 50% 如果 W>13 则块重叠 75% 如何在matlab中实现它,特别是第二条和第三条规则
I have an image of 256*256.I have to divide the image into sub blocks of size W * W,where W=3,4,.....27 according to the given overlapping rules below:
if W<8 thn no overlapping of blocks
if 8<=W<=13 thn 50% overlapping of blocks
if W>13 thn 75% overlapping of blocks
how to implement it in matlab,particularly in 2nd and in 3rd rule
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实现您感兴趣的目标的最快、最简单的方法如下:
请注意,当
W
没有完全除以size(im,1)
时,则它会从右边缘和下边缘丢弃一些点,因此您需要再次查看它如何设置startPos
的值。The quickest and simplest way of achieving something like what you're interested in is as follows:
Note that when
W
doesn't divide exactly intosize(im,1)
then it will drop some of the points from the right and bottom edges, so you will want to look again at how it's setting the values ofstartPos
.