code: def test_degenerate():
      src = dst = np.zeros((10, 2))
  
      tform = SimilarityTransform()
      assert not tform.estimate(src, dst)
      assert np.all(np.isnan(tform.params))
  
      tform = EuclideanTransform()
      assert not tform.estimate(src, dst)
      assert np.all(np.isnan(tform.params))
  
      tform = AffineTransform()
      assert not tform.estimate(src, dst)
      assert np.all(np.isnan(tform.params))
  
      tform = ProjectiveTransform()
      assert not tform.estimate(src, dst)
      assert np.all(np.isnan(tform.params))
  
      # See gh-3926 for discussion details
      tform = ProjectiveTransform()
      for i in range(20):
          # Some random coordinates
          src = np.random.rand(4, 2) * 100
          dst = np.random.rand(4, 2) * 100
  
          # Degenerate the case by arranging points on a single line
          src[:, 1] = np.random.rand()
          # Prior to gh-3926, under the above circumstances,
          # a transform could be returned with nan values.
          assert (
              not tform.estimate(src, dst)
              or np.isfinite(tform.params).all()
          )
  
      src = np.array([[0, 2, 0], [0, 2, 0], [0, 4, 0]])
      dst = np.array([[0, 1, 0], [0, 1, 0], [0, 3, 0]])
      tform = AffineTransform()
      assert not tform.estimate(src, dst)
      # Prior to gh-6207, the above would set the parameters as the identity.
      assert np.all(np.isnan(tform.params))
  
      # The tessellation on the following points produces one degenerate affine
      # warp within PiecewiseAffineTransform.
      src = np.asarray(
          [
              [0, 192, 256],
              [0, 256, 256],
              [5, 0, 192],
              [5, 64, 0],
              [5, 64, 64],
              [5, 64, 256],
              [5, 192, 192],
              [5, 256, 256],
              [0, 192, 256],
          ]
      )
  
      dst = np.asarray(
          [
              [0, 142, 206],
              [0, 206, 206],
              [5, -50, 142],
              [5, 14, 0],
              [5, 14, 64],
              [5, 14, 206],
              [5, 142, 142],
              [5, 206, 206],
              [0, 142, 206],
          ]
      )
      tform = PiecewiseAffineTransform()
      assert not tform.estimate(src, dst)
      assert np.all(
          np.isnan(tform.affines[4].params)
      )  # degenerate affine
      for idx, affine in enumerate(tform.affines):
          if idx != 4:
              assert not np.all(np.isnan(affine.params))
      for affine in tform.inverse_affines:
          assert not np.all(np.isnan(affine.params))
  
imports: import re
  import textwrap
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_equal
  from skimage.transform import AffineTransform, EssentialMatrixTransform, EuclideanTransform, FundamentalMatrixTransform, PiecewiseAffineTransform, PolynomialTransform, ProjectiveTransform, SimilarityTransform, estimate_transform, matrix_transform
  from skimage.transform._geometric import _GeometricTransform, _affine_matrix_from_vector, _center_and_normalize_points, _euler_rotation_matrix
label_desc: Use image node_id 37 for calling a global function with example usage: test_degenerate() without return types