{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "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": "BRIEF binary descriptor extractor."
            }
          ]
        }
      ],
      "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": "descriptors",
              "annotation": "(Q, `descriptor_size`) array of dtype bool",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "2D ndarray of binary descriptors of size "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "descriptor_size"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for Q keypoints after filtering out border keypoints with value at an index "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(i, j)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " either being "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "True"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " or "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "False"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " representing the outcome of the intensity comparison for i-th keypoint on j-th decision pixel-pair. It is "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Q == np.sum(mask)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "mask",
              "annotation": "array of shape (N,) and dtype bool",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Mask indicating whether a keypoint has been filtered out ("
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "False"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ") or is described in the "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "descriptors",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "descriptors"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " array ("
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "True"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ")."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "descriptor_size",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Size of BRIEF descriptor for each keypoint. Sizes 128, 256 and 512 recommended by the authors. Default is 256."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "patch_size",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Length of the two dimensional square patch sampling region around the keypoints. Default is 49."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "mode",
              "annotation": "{'normal', 'uniform'}, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Probability distribution for sampling location of decision pixel-pairs around keypoints."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "rng",
              "annotation": "{`numpy.random.Generator`, int}, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Pseudo-random number generator (RNG). By default, a PCG64 generator is used (see "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "numpy.random.default_rng",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "numpy",
                        "version": "*",
                        "kind": "api",
                        "path": "numpy.random:default_rng"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "). If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "rng"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is an int, it is used to seed the generator."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The PRNG is used for the random sampling of the decision pixel-pairs. From a square window with length "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "patch_size"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", pixel pairs are sampled using the "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "mode"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " parameter to build the descriptors using intensity comparison."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "For matching across images, the same "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "rng"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " should be used to construct descriptors. To facilitate this:"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": true,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "rng"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " defaults to 1"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Subsequent calls of the "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "extract"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " method will use the same rng/seed."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "sigma",
              "annotation": "float, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Standard deviation of the Gaussian low-pass filter applied to the image to alleviate noise sensitivity, which is strongly recommended to obtain discriminative and good descriptors."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "BRIEF (Binary Robust Independent Elementary Features) is an efficient feature point descriptor. It is highly discriminative even when using relatively few bits and is computed using simple intensity difference tests."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For each keypoint, intensity comparisons are carried out for a specifically distributed number N of pixel-pairs resulting in a binary descriptor of length N. For binary descriptors the Hamming distance can be used for feature matching, which leads to lower computational cost in comparison to the L2 norm."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Returns",
    "Yields",
    "Receives",
    "Raises",
    "Warns",
    "Other Parameters",
    "Attributes",
    "Methods",
    "Notes",
    "Warnings"
  ],
  "item_file": "/dev/scikit-image/src/skimage/feature/brief.py",
  "item_line": 19,
  "item_type": "class",
  "aliases": [
    "skimage.feature.BRIEF"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from skimage.feature import (corner_harris, corner_peaks, BRIEF,\n                             match_descriptors)\nimport numpy as np\nsquare1 = np.zeros((8, 8), dtype=np.int32)\nsquare1[2:6, 2:6] = 1\nsquare1\nsquare2 = np.zeros((9, 9), dtype=np.int32)\nsquare2[2:7, 2:7] = 1\nsquare2\nkeypoints1 = corner_peaks(corner_harris(square1), min_distance=1)\nkeypoints2 = corner_peaks(corner_harris(square2), min_distance=1)\nextractor = BRIEF(patch_size=5)\nextractor.extract(square1, keypoints1)\ndescriptors1 = extractor.descriptors\nextractor.extract(square2, keypoints2)\ndescriptors2 = extractor.descriptors\nmatches = match_descriptors(descriptors1, descriptors2)\nmatches\nkeypoints1[matches[:, 0]]\nkeypoints2[matches[:, 1]]\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "descriptor_size",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "256"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "patch_size",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "49"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "mode",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "normal"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "sigma",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "1"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "rng",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "1"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "BRIEF"
  },
  "references": null,
  "qa": "skimage.feature.brief:BRIEF",
  "arbitrary": [],
  "local_refs": [
    "descriptor_size",
    "descriptors",
    "mask",
    "mode",
    "patch_size",
    "rng",
    "sigma"
  ]
}