相对于其中心旋转图像

问题描述 投票:0回答:1

我正在尝试通过alpha度旋转矩阵,更具体地说,旋转图像。我正在使用旋转矩阵来查找旋转它,但如果矩阵不是正方形,那么旋转失败并提供损坏的输出。

让我们看看我们有一个mxn矩阵

    for i to m
        for j to n
            new_i = i*cos(alpha) - j*sin(alpha)
            new_j = i*sin(alpha) + j*cos(alpha)
            write the value of sourceimage[i][j] to a new image[new_i][new_j]

我在这里失踪了什么?

java image-processing
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.