'是矩阵转置运算符,sum函数是按列求和,所以转置求和再转置就是按行求和。
其实
Y_projection=(sum((~image)'))'
这句可以写成
Y_projection=sum(~image,2)
意思是一样的,按行求和