{ "cells": [ { "cell_type": "markdown", "id": "38506168-7836-4153-a0f9-b5cfdd575067", "metadata": {}, "source": [ "# Define and apply an affine transform in 2D from control points\n", "### The same approach works for 3D points too. \n", "O. Kaufmann, 2022." ] }, { "cell_type": "code", "execution_count": 14, "id": "e5321fe6-2872-4ec7-bedd-1502b079392b", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from shapely.geometry import Point, LineString\n", "from shapely.affinity import affine_transform\n", "from geometron.geometries import transforms as ggt\n", "from geometron.plot import geometries as gpg" ] }, { "cell_type": "code", "execution_count": 15, "id": "84c2b059-d81a-4f09-866e-e4c8b3f5298d", "metadata": {}, "outputs": [], "source": [ "origin_coords = [np.array([0.,0.]), np.array([0.,1.]), np.array([1.,0.]), np.array([1.,1.2])]" ] }, { "cell_type": "code", "execution_count": 16, "id": "a4e8f2e9-1f7f-4f6f-b0a8-ac5d45b991a7", "metadata": {}, "outputs": [], "source": [ "destination_coords = [np.array([2.5,1.5]), np.array([2.,2.]), np.array([3.,2.]), np.array([2.5,3.])]" ] }, { "cell_type": "code", "execution_count": 17, "id": "11e11960-ed15-48df-9c81-97dd91611e23", "metadata": {}, "outputs": [], "source": [ "transform_matrix, residuals, rank, singular = ggt.affine_transform_matrix(origin_coords, destination_coords)" ] }, { "cell_type": "code", "execution_count": 18, "id": "810824f9-25ea-445d-9b14-ab0403eb98dd", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0.5450819672131152,\n", " -0.4508196721311477,\n", " 0.6803278688524602,\n", " 0.6967213114754098,\n", " 2.4754098360655745,\n", " 1.401639344262296]" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "transform_matrix" ] }, { "cell_type": "code", "execution_count": 19, "id": "482bf63c-11ee-455e-9fcb-b31b25c7c499", "metadata": {}, "outputs": [], "source": [ "origin_gcp = [Point(p) for p in origin_coords]\n", "destination_gcp = [Point(p) for p in destination_coords]\n", "transformed_gcp = [affine_transform(p, transform_matrix) for p in origin_gcp]" ] }, { "cell_type": "code", "execution_count": 20, "id": "377b89e7-64de-4d06-9703-22dce00bc648", "metadata": {}, "outputs": [], "source": [ "ls = LineString([[1,1], [2,1], [1,4]])\n", "Ls = affine_transform(ls, transform_matrix)" ] }, { "cell_type": "code", "execution_count": 23, "id": "009cb865-4b5a-4297-b923-00e0582893ca", "metadata": { "nbsphinx-thumbnail": { "tooltip": "This tooltip message was defined in cell metadata" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgEAAAEbCAYAAABDQ1cBAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAA4sklEQVR4nO3deViVZfoH8O9zWIQjiILHBeEACkd2N9ylREuxSStNU0mbHAfDsUwnbbEsLctpsnGsMbcxwx+VpGZiZWmSkk4puCEuuSCgYKLEFqYsz++PFwiUXQ5n+36uq0t4z+E9N2TxPe/9vM8tpJQgIiIiy6MydAFERERkGAwBREREFoohgIiIyEIxBBAREVkohgAiIiILxRBARERkoawNXQARETVdUlJSB2tr63UAAsE3dnSnMgAnSkpKpvfp0+fq7Q8yBBARmTBra+t1nTp18tNoNL+qVCpu/ELVlJWViezsbP8rV66sAzDm9seZGomITFugRqPJZwCgmqhUKqnRaPKgXCm68/EWroeIiJqXigGA6lL+96PG3/cMAUREdFcyMjKsR48e7eXm5hYUEBDg17NnT9/o6Oi2FY/Hx8erQ0JCunt6egb6+fn5P/bYYx4FBQWqFStWuLRr166Hr6+vf7du3QKWLVvWXh/1xcTEOL300kud6nrOxYsXbcLDw7vq4/WNGdcEEBFZkFWHVjkv3re4y5XCK7adHDrdWnjPwstP9X0qp6nnKysrw+jRo70nT558PS4uLhUAfv75Z9vPPvusLaAE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rr792+OWXX6w7depU/P33358DgOvXr1u5uLiUfvDBBx337t37c+fOnUtuf4309HS7//u//7swaNCgtAceeKBrdHR0u5kzZ+ZERET8+ve///0aADzzzDOuK1asaL9gwYKr9913X+6DDz6Y9+STT/5a9TxFRUVixowZXt9+++2Z4ODgm4888ojnP//5T83ChQuvAkD79u1LTp48eWrp0qWapUuXdty0aVNaQ38Od4NXAoiILIRLbnaNk/BqO94ULTlK+PDhww5//etfcwBgxowZlUFj586dbfbt29fG39/fPyAgwP/8+fN2p0+ftuvdu/eNhISENlFRUV127tzp4OLiUu9rdenS5eagQYNuAECvXr2KLl682AoAkpKS7Pv06dNdp9P5b9myxSUlJaXOd+/Hjh2zc3NzuxkcHHwTAP785z9f/+GHHyrXCkyePPlXAOjXr19RRkZGi40t5pUAIiIzUdc7dgDAm52CkHXnKGFV5063vpg1xCRHCatUqjsG4Egp8eyzz2bNmzfvjpkKhw8fPrllyxanV155pcvu3bvz33nnnay6vr/bRwrfuHFDBQCRkZFemzdvPjdw4MAbK1ascNm7d+9dLf6zs7OTAGBtbS1LSkpabGwxrwQQEVmKhQsvw676KGHY2ZVhoWmOEu7du3fh2rVrnQFg7dq1LhXHR40alb9x48b2eXl5KgBITU21uXz5svXFixdtHB0dy2bOnJkzd+7cK0ePHlUDQOvWrUsrnttQRUVFKq1WW3zz5k3x6aefVq6pcHBwKM3Pz7/jXD169Pj98uXLtidOnGgFANHR0S6hoaEGXzDIKwFERJbiqfKRwYsXd8GVK7bo1OkWFi68XHm8CSpGCf/tb39zX7FiRSdnZ+cStVpdWtMo4evXr9uoVCo5YMCAwrFjx+bf7bezcuXK9PI2Qqfw8PDciuNjx47NT0lJsevbt68vAKjV6rKYmJjU06dPt3rxxRfdVCoVrK2t5cqVK9MA4IknnrgWHh6u69ix462ffvrp54a89gsvvJDZr18/P2dn55LevXsXFhYWWgFARERETlRUlOeqVas6bt68uXI6oVqtlqtWrbo4fvz4bqWlpejRo0fRc889l137K7QMjhImIjJhHCVMDVH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dGoNcXZRdk23dp1+/31fa+7vr7v9RqfH9ghsGj9Q+szajtfQkKC+uOPP3ZJSko6JaVEnz59/IYPH17Qvn370osXL9qtXr364ogRI34bP3685z//+U/N4sWLf6n42qysLOs333yz8759+35u06ZN2YIFCzq9/vrrHd94440rERER3WJiYs7fe++9RTk5OSpHR8eyF198MTMxMbF1XQOHahIVFaWNiIi4/vTTT19fvny5S1RUlPvu3bvPl9dge/jw4dPW1tZYsWJF5XyBWbNmuc+cOfPqjBkzct5+++1aB+KcPHlSfezYsZP29vZl3t7egc8999wv3t7exY2pz5B4JYDMl78/8NNPwF//CixdCgwdCmTU+v8yIovQplWbUo1aU5xVmGWrUWuK27Rqc1eLZ77//nuHBx54ILdNmzZlTk5OZX/6059+jY+PdwSATp063RoxYsRvADBlypTrBw4ccLjta1ufP3/erl+/fr6+vr7+n376qUt6errt8ePH7Tp06FB87733FgGAs7Nzmc1dBPgjR460joyMzAGAqKionKSkpMo6xo4d+6u19Z3vh48cOeIwbdq0HACYPn16rRMWhwwZku/i4lKqVqult7f37+fPn69zPoGx4ZUAMm9qNbBmjXJXQWSk0h7YsEG5q4DIzNT1jr1CRQtgdv/ZWR8d+0jzyj2vZI7uPrpAH/UIIer8XEqJIUOG5MfFxaVWPX7w4EH7xr5WY0cOV3BwcLirDUZsbW2rjiSWxcXFoq7nGxteCSDLMGkScPgw4OEBjBkDzJ0L3NLLUC4io1URAKIfjr6wPHx5ZvTD0ReqrhFoirCwsMKvvvqqbUFBgSo/P1/11VdftQsLCysAlEvtu3fvbg0AMTExzoMGDSqs+rVDhw79LTEx0eHEiROtACA/P191/PjxVsHBwb9fvXrVZu/evWoA+PXXX1XFxcVo06ZNadUxxVXVNXK4V69ev61bt64dAKxevdo5JCSk8M4zVNezZ8/CDRs2tAOA9evXOzfup2I6GALIcvj4AP/7H/D008C//gUMHgxcMJtFvkT1+unyT+roh6MvVLzzH919dEH0w9EXfrr8U53rCOoyZMiQosmTJ1/v3bu3X58+ffymTJmSPXj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koRgCiIiILBRDABERkYViCCAiIrJQDAFEREQWiiGAiIjIQjEEEBERWaj/Byrb6uwPukTjAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "fig, ax = plt.subplots()\n", "for p in origin_gcp:\n", " i = origin_gcp.index(p)\n", " gpg.plot_shapely_obj(obj=p, ax=ax, color='g', marker='o', label='GCP - origin' if i == 0 else '_no_legend_')\n", "for p in destination_gcp:\n", " i = destination_gcp.index(p)\n", " gpg.plot_shapely_obj(obj=p, ax=ax, markeredgecolor='r', markerfacecolor='r', marker='o', label='GCP - destination' if i == 0 else '_no_legend_')\n", "for p in transformed_gcp:\n", " i = transformed_gcp.index(p)\n", " gpg.plot_shapely_obj(obj=p, ax=ax, markeredgecolor='k', markerfacecolor='w', marker='o', alpha=0.5, label='GCP - transformed' if i == 0 else '_no_legend_')\n", " \n", "gpg.plot_shapely_obj(obj=ls, ax=ax, color='g', marker='x', label='object - origin')\n", "gpg.plot_shapely_obj(obj=Ls, ax=ax, color='r', marker='x', label='object - transformed')\n", "ax.axis('equal')\n", "fig.legend(bbox_to_anchor=(1.25, 1), loc='upper right', borderaxespad=0)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.13" } }, "nbformat": 4, "nbformat_minor": 5 }