def plot_epipolar_line(im, F, x, epipole=None, show_epipole=True):
 (m, n) = im.shape[:2]
 line = dot(F, x)
 t = linspace(0, n, 100)
 lt = array([((line[2] + (line[0] * tt)) / (- line[1])) for tt in t])
 ndx = ((lt >= 0) & (lt < m))
 plot(t[ndx], lt[ndx], linewidth=2)
 if show_epipole:
  if (epipole is None):
   epipole = compute_epipole(F)
  plot((epipole[0] / epipole[2]), (epipole[1] / epipole[2]), 'r*')

def plot_epipolar_line ( im , F , x , epipole = None , show_epipole = True ) : ( m , n ) = im . shape [ : 2 ] line = dot ( F , x ) t = linspace ( 0 , n , 100 ) lt = array ( [ ( ( line [ 2 ] + ( line [ 0 ] * tt ) ) / ( - line [ 1 ] ) ) for tt in t ] ) ndx = ( ( lt >= 0 ) & ( lt < m ) ) plot ( t [ ndx ] , lt [ ndx ] , linewidth = 2 ) if show_epipole : if ( epipole is None ) : epipole = compute_epipole ( F ) plot ( ( epipole [ 0 ] / epipole [ 2 ] ) , ( epipole [ 1 ] / epipole [ 2 ] ) , 'r*' )
plot the epipole and epipolar line f*x=0 in an image .