且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从MATLAB中的图像创建子图像

更新时间:2023-11-26 11:33:16

im = magic(100)
subIm = im(p1:p3,p5:p6,:)

imshow(subIm)

假设p1 == p2,p3 == p4,p5 == p7和p6 == p8

This assumes that p1 == p2, p3 == p4, p5 == p7 and p6 == p8

基本上,您正在获取矩阵的一个子集.根据您p1..p8的设置方式,您会在此主题上有所不同.

Basically, you are taking a subset of the matrix. Depending on how your p1..p8 are set up, you will have a variation on this theme.