{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "See "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "2"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for details of the estimation procedure.  "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "2"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is a good place to start."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Fundamental matrix transformation."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "params",
              "annotation": "(3, 3) array",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Fundamental matrix."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "matrix",
              "annotation": "(3, 3) array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Fundamental matrix."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "dimensionality",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Fallback number of dimensions when "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "matrix"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " not specified, in which case, must equal 2 (the default)."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The fundamental matrix relates corresponding points between a pair of uncalibrated images. The matrix transforms homogeneous image points in one image to epipolar lines in the other image."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The fundamental matrix is only defined for a pair of moving images. In the case of pure rotation or planar scenes, the homography describes the geometric relation between two images ("
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "ProjectiveTransform",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "skimage.transform._geometric:ProjectiveTransform"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "). If the intrinsic calibration of the images is known, the essential matrix describes the metric relation between the two images ("
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "EssentialMatrixTransform",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "skimage.transform._geometric:EssentialMatrixTransform"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ")."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/skimage/transform/_geometric.py",
  "item_line": null,
  "item_type": "ABCMeta",
  "aliases": [
    "skimage.transform.FundamentalMatrixTransform"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nimport skimage as ski\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nDefine source and destination points:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "src = np.array([1.839035, 1.924743,\n                0.543582, 0.375221,\n                0.473240, 0.142522,\n                0.964910, 0.598376,\n                0.102388, 0.140092,\n               15.994343, 9.622164,\n                0.285901, 0.430055,\n                0.091150, 0.254594]).reshape(-1, 2)\ndst = np.array([1.002114, 1.129644,\n                1.521742, 1.846002,\n                1.084332, 0.275134,\n                0.293328, 0.588992,\n                0.839509, 0.087290,\n                1.779735, 1.116857,\n                0.878616, 0.602447,\n                0.642616, 1.028681]).reshape(-1, 2)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nEstimate the transformation matrix:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tform = ski.transform.FundamentalMatrixTransform.from_estimate(\n     src, dst)\ntform.params\n",
        "execution_status": "success",
        "out": "array([[-0.21785884,  0.41928191, -0.03430748],\n       [-0.07179414,  0.04516432,  0.02160726],\n       [ 0.24806211, -0.42947814,  0.02210191]])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nCompute the Sampson distance:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tform.residuals(src, dst)\n",
        "execution_status": "success",
        "out": "array([0.0053886 , 0.00526101, 0.08689701, 0.01850534, 0.09418259,\n       0.00185967, 0.06160489, 0.02655136])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nApply inverse transformation:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tform.inverse(dst)\n",
        "execution_status": "success",
        "out": "array([[-0.0513591 ,  0.04170974,  0.01213043],\n       [-0.21599496,  0.29193419,  0.00978184],\n       [-0.0079222 ,  0.03758889, -0.00915389],\n       [ 0.14187184, -0.27988959,  0.02476507],\n       [ 0.05890075, -0.07354481, -0.00481342],\n       [-0.21985267,  0.36717464, -0.01482408],\n       [ 0.01339569, -0.03388123,  0.00497605],\n       [ 0.03420927, -0.1135812 ,  0.02228236]])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe estimation can fail - for example, if all the input or output points\nare the same.  If this happens, you will get a transform that is not\n\"truthy\" - meaning that ``bool(tform)`` is ``False``:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "if tform:\n    print(\"Estimation succeeded.\")\nbad_src = np.ones((8, 2))\nbad_tform = ski.transform.FundamentalMatrixTransform.from_estimate(\n     bad_src, dst)\nif not bad_tform:\n    print(\"Estimation failed.\")\n",
        "execution_status": "success",
        "out": "Estimation failed.\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nTrying to use this failed estimation transform result will give a suitable\nerror:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "bad_tform.params  # doctest: +IGNORE_EXCEPTION_DETAIL\n",
        "execution_status": "success",
        "out": "Traceback (most recent call last):\n  File \"<doctest skimage.transform._geometric:FundamentalMatrixTransform[0]>\", line 1, in <module>\n    bad_tform.params  # doctest: +IGNORE_EXCEPTION_DETAIL\n    ^^^^^^^^^^^^^^^^\n  File \"/opt/hostedtoolcache/Python/3.14.7/x64/lib/python3.14/site-packages/_skimage2/_shared/utils.py\", line 546, in __getattr__\n    raise self.error_cls(msg)\n_skimage2._shared.utils.FailedEstimationAccessError: FailedEstimation has no attribute 'params'. FundamentalMatrixTransform: Scaling failed for input points\n\nHint: You can check for a failed estimation by truth testing the returned object. For failed estimations, `bool(estimation_result)` will be `False`. E.g.\n\n    if not estimation_result:\n        raise RuntimeError(f'Failed estimation: {estimation_result}')\n"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "matrix",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "dimensionality",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "FundamentalMatrixTransform"
  },
  "references": [
    ".. [1] Hartley, Richard, and Andrew Zisserman. Multiple view geometry in",
    "       computer vision. Cambridge university press, 2003.",
    ".. [2] Zhang, Zhengyou. \"Determining the epipolar geometry and its",
    "       uncertainty: A review.\" International journal of computer vision 27",
    "       (1998): 161-195.",
    "       :DOI:`10.1023/A:1007941100561`",
    "       https://www.microsoft.com/en-us/research/wp-content/uploads/2016/11/RR-2927.pdf"
  ],
  "qa": "skimage.transform._geometric:FundamentalMatrixTransform",
  "arbitrary": [],
  "local_refs": [
    "dimensionality",
    "matrix",
    "params"
  ]
}