diff --git a/notebooks/geometry_and_monocular.ipynb b/notebooks/geometry_and_monocular.ipynb index e7a8fb1..92f7c46 100644 --- a/notebooks/geometry_and_monocular.ipynb +++ b/notebooks/geometry_and_monocular.ipynb @@ -304,7 +304,7 @@ "def translate(points, t):\n", " pass\n", "\n", - "translated_points = translate(points, t)" + "translated_points = translate(rotated_points, t)" ] }, { @@ -324,7 +324,7 @@ "outputs": [], "source": [ "def make_homogenous(points):\n", - " return np.hstack([points, np.ones(points.shape[0])])\n", + " return np.hstack([points, np.ones(points.shape[0]).reshape((points.shape[0], 1))])\n", "\n", "# вставьте движение точек с помощью однородных координат сюда. отобразите результат\n", "def move(points, rot_mat, t):\n", @@ -417,7 +417,7 @@ " \n", " def project(self, points):\n", " if points.shape[1] == 3:\n", - " homo_pts = self.K.dot(translate(rotate(points, self.R), self.t)).T\n", + " homo_pts = self.K.dot(translate(rotate(points, self.R), self.t).T).T\n", " elif points.shape[1] == 4:\n", " homo_pts = self.P.dot(points.T)\n", " else:\n", @@ -580,7 +580,7 @@ " dtype='float64')\n", "\n", "#камера расположена немного левее начала с.к.\n", - "R_cam = np.ones((3,3), dtype='float64')\n", + "R_cam = np.identity(3, dtype='float64')\n", "t_cam = np.array([5.956621e-02, 2.900141e-04, 2.577209e-03],\n", " dtype='float64')\n", "img_size = image.shape"