You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: EssentialMatrixFrom2DPoints.m
    path of file: ./repos/robotic_perception/Visual_odometry/code
    
    the code of the file until where you have to start completion: function e = EssentialMatrixFrom2DPoints(p1,p2,k)
%
% Input:
%       p1 and p2 are 2xN (or 3xN in homogeneous coordiantes) of
%       correspondings corners. 
%
%       k is the camera matrix.
% 
% Output:
%       e is the essential matrix.    
%   
%----------------------------------------------------------
%
% From 
%    Book: "Multiple View Geometry in Computer Vision",
% Authors: Hartley and Zisserman, 2006, [HaZ2006]
% Section: "Computation of the Fundamental Matrix F",  specifically "The
% normalised 8-point algorithm"
% Chapter: 11
%    Page: 279
%
%----------------------------------------------------------
%      Author: Diego Cheda
% Affiliation: CVC - UAB
%        Date: 03/06/2008
%----------------------------------------------------------

% Points in Normalized Coordinates. p = inv(k) * p
p1 = NormalizedCoordinates(p1,k);
p2 = NormalizedCoordinates(p2,k);

% Normalization
% Transform the image coordinates according to x^_i = Tx_i and x'^_i =
% T'x'_i where T and T' are normalizing transformation consisting of a
% translation and scaling.
% [p1,t1] = Normalise2DPts(p1);
% [p2,t2] = Normalise2DPts(p2);
[p1,t1] = normalise2dpts(p1);
[p2,t2] = normalise2dpts(p2);


% (x,y)
x1 = p1(1,:)';
x2 = p2(1,:)';

y1 = p1(2,:)';
y2 = p2(2,:)';



    
function e = EssentialMatrixFrom2DPoints(p1,p2,k)
%
% Input:
%       p1 and p2 are 2xN (or 3xN in homogeneous coordiantes) of
%       correspondings corners. 
%
%       k is the camera matrix.
% 
% Output:
%       e is the essential matrix.    
%   
%----------------------------------------------------------
%
% From 
%    Book: "Multiple View Geometry in Computer Vision",
% Authors: Hartley and Zisserman, 2006, [HaZ2006]
% Section: "Computation of the Fundamental Matrix F",  specifically "The
% normalised 8-point algorithm"
% Chapter: 11
%    Page: 279
%
%----------------------------------------------------------
%      Author: Diego Cheda
% Affiliation: CVC - UAB
%        Date: 03/06/2008
%----------------------------------------------------------

% Points in Normalized Coordinates. p = inv(k) * p
p1 = NormalizedCoordinates(p1,k);
p2 = NormalizedCoordinates(p2,k);

% Normalization
% Transform the image coordinates according to x^_i = Tx_i and x'^_i =
% T'x'_i where T and T' are normalizing transformation consisting of a
% translation and scaling.
% [p1,t1] = Normalise2DPts(p1);
% [p2,t2] = Normalise2DPts(p2);
[p1,t1] = normalise2dpts(p1);
[p2,t2] = normalise2dpts(p2);


% (x,y)
x1 = p1(1,:)';
x2 = p2(1,:)';

y1 = p1(2,:)';
y2 = p2(2,:)';


% Number of points
numPts = size(p1,2);

% Af = 0
% Computes A, the constraint matrix of numpts x 9
a = [x2.*x1 x2.*y1 x2 y2.*x1 y2.*y1 y2 x1 y1 ones(numPts,1)];
%a = [x1.*x2 x1.*y2 x1 y1.*x2 y1.*y2 y1 x2 y2 ones(numPts,1)];

if (rank(a)<8)
    disp('rank defficient');
end