code: def corner_foerstner(image, sigma=1):
      """Compute Foerstner corner measure response image.
  
      This corner detector uses information from the auto-correlation matrix A::
  
          A = [(imx**2)   (imx*imy)] = [Axx Axy]
              [(imx*imy)   (imy**2)]   [Axy Ayy]
  
      Where imx and imy are first derivatives, averaged with a gaussian filter.
      The corner measure is then defined as::
  
          w = det(A) / trace(A)           (size of error ellipse)
          q = 4 * det(A) / trace(A)**2    (roundness of error ellipse)
  
      Parameters
      ----------
      image : (M, N) ndarray
          Input image.
      sigma : float, optional
          Standard deviation used for the Gaussian kernel, which is used as
          weighting function for the auto-correlation matrix.
  
      Returns
      -------
      w : ndarray
          Error ellipse sizes.
      q : ndarray
          Roundness of error ellipse.
  
      References
      ----------
      .. [1] Förstner, W., & Gülch, E. (1987, June). A fast operator for
             detection and precise location of distinct points, corners and
             centres of circular features. In Proc. ISPRS intercommission
             conference on fast processing of photogrammetric data (pp. 281-305).
             https://cseweb.ucsd.edu/classes/sp02/cse252/foerstner/foerstner.pdf
      .. [2] https://en.wikipedia.org/wiki/Corner_detection
  
      Examples
      --------
      >>> from skimage.feature import corner_foerstner, corner_peaks
      >>> square = np.zeros([10, 10])
      >>> square[2:8, 2:8] = 1
      >>> square.astype(int)
      array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
             [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
             [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
             [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
             [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
             [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
      >>> w, q = corner_foerstner(square)
      >>> accuracy_thresh = 0.5
      >>> roundness_thresh = 0.3
      >>> foerstner = (q > roundness_thresh) * (w > accuracy_thresh) * w
      >>> corner_peaks(foerstner, min_distance=1)
      array([[2, 2],
             [2, 7],
             [7, 2],
             [7, 7]])
  
      """
  
      Arr, Arc, Acc = structure_tensor(image, sigma, order="rc")
  
      # determinant
      detA = Arr * Acc - Arc**2
      # trace
      traceA = Arr + Acc
  
      w = np.zeros_like(image, dtype=detA.dtype)
      q = np.zeros_like(w)
  
      mask = traceA != 0
  
      w[mask] = detA[mask] / traceA[mask]
      q[mask] = 4 * detA[mask] / traceA[mask] ** 2
  
      return w, q
  
imports: import functools
  import math
  from itertools import combinations_with_replacement
  import numpy
  from scipy import ndimage
  from scipy import spatial, stats
  from .._shared.filters import gaussian
  from .._shared.utils import _supported_float_type, safe_as_int, warn
  from ..transform import integral_image
  from ..util import img_as_float
  from ._hessian_det_appx import _hessian_matrix_det
  from .corner_cy import _corner_fast, _corner_moravec, _corner_orientations
  from .peak import peak_local_max
  from .util import _prepare_grayscale_input_2D, _prepare_grayscale_input_nD
label_desc: Use image node_id 14 for calling a global function with example usage: corner_foerstner(image, sigma) and returns: w,  q