<legend id='ouSxQ'><style id='ouSxQ'><dir id='ouSxQ'><q id='ouSxQ'></q></dir></style></legend>

      <small id='ouSxQ'></small><noframes id='ouSxQ'>

    1. <i id='ouSxQ'><tr id='ouSxQ'><dt id='ouSxQ'><q id='ouSxQ'><span id='ouSxQ'><b id='ouSxQ'><form id='ouSxQ'><ins id='ouSxQ'></ins><ul id='ouSxQ'></ul><sub id='ouSxQ'></sub></form><legend id='ouSxQ'></legend><bdo id='ouSxQ'><pre id='ouSxQ'><center id='ouSxQ'></center></pre></bdo></b><th id='ouSxQ'></th></span></q></dt></tr></i><div id='ouSxQ'><tfoot id='ouSxQ'></tfoot><dl id='ouSxQ'><fieldset id='ouSxQ'></fieldset></dl></div>
      • <bdo id='ouSxQ'></bdo><ul id='ouSxQ'></ul>

    2. <tfoot id='ouSxQ'></tfoot>

      图像旋转后如何重新映射点?

      时间:2023-07-03
    3. <tfoot id='qHfpw'></tfoot>

          <bdo id='qHfpw'></bdo><ul id='qHfpw'></ul>
              <tbody id='qHfpw'></tbody>
            <i id='qHfpw'><tr id='qHfpw'><dt id='qHfpw'><q id='qHfpw'><span id='qHfpw'><b id='qHfpw'><form id='qHfpw'><ins id='qHfpw'></ins><ul id='qHfpw'></ul><sub id='qHfpw'></sub></form><legend id='qHfpw'></legend><bdo id='qHfpw'><pre id='qHfpw'><center id='qHfpw'></center></pre></bdo></b><th id='qHfpw'></th></span></q></dt></tr></i><div id='qHfpw'><tfoot id='qHfpw'></tfoot><dl id='qHfpw'><fieldset id='qHfpw'></fieldset></dl></div>

              • <legend id='qHfpw'><style id='qHfpw'><dir id='qHfpw'><q id='qHfpw'></q></dir></style></legend>

                <small id='qHfpw'></small><noframes id='qHfpw'>

              • 本文介绍了图像旋转后如何重新映射点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个数学问题:假设我使用带有以下命令的 opencv 将图像围绕其中心旋转 30°:

                I have a mathematical question: let's suppose I rotate an image around its center by an angle of 30°, using the opencv with the following commands:

                M = cv2.getRotationMatrix2D((cols/2,rows/2),30,1)
                img_rotate = cv2.warpAffine(img,M,(cols,rows))
                

                如果a取img_rotate的像素(40,40),如何知道原图中对应的像素是什么?

                If a take the pixel (40,40) of the img_rotate, how can I know which is the corresponding pixel in the original image?

                换句话说,当我将旋转应用于图像时,我获得了转换后的图像.是否有可能获得点之间的映射?比如新图的(x,y)点对应原图的(x',y')点.

                in other words, when I apply the rotation to an image I obtain the transformed image. Is there the possibility to obtain the mapping between points? For example the (x,y) point of the new image corresponds to (x',y') point of the original image.

                推荐答案

                只需使用 仿射变换和逆矩阵.

                # inverse matrix of simple rotation is reversed rotation.
                M_inv = cv2.getRotationMatrix2D((100/2, 300/2),-30,1)
                
                
                # points
                points = np.array([[35.,  0.],
                                   [175., 0.],
                                   [105., 200.],
                                   [105., 215.],
                                  ])
                # add ones
                ones = np.ones(shape=(len(points), 1))
                
                points_ones = np.hstack([points, ones])
                
                # transform points
                transformed_points = M_inv.dot(points_ones.T).T
                

                这篇关于图像旋转后如何重新映射点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:旋转 numpy 二维数组 下一篇:使用 grid_2d_graph 在 networkx 中绘制 MxM 节点的方形网格时移除旋转效果

                相关文章

                <small id='Y68WS'></small><noframes id='Y68WS'>

                • <bdo id='Y68WS'></bdo><ul id='Y68WS'></ul>
                <legend id='Y68WS'><style id='Y68WS'><dir id='Y68WS'><q id='Y68WS'></q></dir></style></legend>
                <i id='Y68WS'><tr id='Y68WS'><dt id='Y68WS'><q id='Y68WS'><span id='Y68WS'><b id='Y68WS'><form id='Y68WS'><ins id='Y68WS'></ins><ul id='Y68WS'></ul><sub id='Y68WS'></sub></form><legend id='Y68WS'></legend><bdo id='Y68WS'><pre id='Y68WS'><center id='Y68WS'></center></pre></bdo></b><th id='Y68WS'></th></span></q></dt></tr></i><div id='Y68WS'><tfoot id='Y68WS'></tfoot><dl id='Y68WS'><fieldset id='Y68WS'></fieldset></dl></div>

              • <tfoot id='Y68WS'></tfoot>