AI Hero Club

Computer Vision and 3D Scenes · Lesson 2

Marked Complete by You0 / 8

Saved in this browser only. Marking a lesson complete does not mean the project has passed verification.

Lesson Outline 3 subsections
Course Contents 8 lessons
Full course plan.
Computer Vision and 3D Scenes / Learning Plan ↗

LESSON 02 / 8Suggested study 120 minutes

General Cameras, Rotation, Projection and Scale

How do rotation and translation project a world point into pixels, and what units do coordinates, focal length and scale use?

3 Questions for This Lesson
  • Distinguishing the world from camera changes to camera positions
  • It's a pinhole projection and location that is comparable.
  • Check positive depth, scale and lens model boundaries
Course Project ZIP ↓

World Coordinates, Camera Coordinates, and Pinhole Projection

Chapter I gets the pixel position, and this chapter creates a function relationship to a three-dimensional position. Model input is the world point. X - Cameras. K Rotation R The camera also uses the right, lower, and front right-hand coordinates; this is the default value for each graphic software. The three-dimensional vector is written as a column vector, and the code batch is saved as line by multiplying and cannot be judged correctly by matching the array shape.

Camera center. C It's the place in the world. Rotation. R The three rows represent the right, lower and front of the camera in the world. The world point is reduced relative to the centre. C I'll see you later. R Take the axle projectors. So the camera coordinates are R Multiply X Less C, if written R X Add t, t equals negative R C. t is not the center of the camera in general, mixing the two makes mistakes when the camera turns. R......... is C is a negative conversion R Multiply t.

Xc=R(X−C)=RX+t,t=−RC,C=−R⊤tX_c=R(X-C)=RX+t,\qquad t=-RC,\qquad C=-R^\top t
R transforms the world into a camera, and the coordinates of C and t differ.

The rotation is a unit array, with positive lines; the proxies of the line negative include mirrors, not pure rotations. In reverse rotations, because the orbital conditions give it equal to the original arrays. When a vector rotates different axes, the matrix multiplys in order of order; nor is a local rotation of the world axis with the movement around objects the same operation. The project directly builds the camera base and does not guess on the name of the rotation parameter.

The construction first takes the target reduction center to a forward-unit vector, then the world to the bottom with the forward fork and then to the right with a single fork; the front fork to the right with the camera on the bottom. The fork to the bottom equals the right fork, thus maintaining the right hand. If the fork to the front is parallel to the fork to the bottom of the preselection, the first fork to the zero, another axis must be selected or wrong. The project’s five cameras avoid this degradation, but universal realization still needs to know the boundary and cannot pass on the non-limited values of the one zero-dimension.

The needle-hole model is the ideal image scenario used in this course, not the exact conclusion to be drawn directly from the physical laws of all lenses. Put a mathematical imaging plane in front of the camera, with depths of focus; similar triangles give the unicoded coordinates to camera horizontal coordinates by depth and vertical coordinates by depth. Then fly the pixel focal distance and add the main point. The main point is the axis of light meets the graphic plane, not necessarily the centre of the picture; this synthesizer places it at half the width. The focal range is a pixel and is not a mix of millimeter units with the world coordinates.

u=fxXcZc+cx,v=fyYcZc+cy,λx~=K[R∣t]X~=PX~u=f_x\frac{X_c}{Z_c}+c_x,\quad v=f_y\frac{Y_c}{Z_c}+c_y,\quad \lambda\tilde x=K[R\mid t]\tilde X=P\tilde X
The 2-D/ 3-D point with the Wave is added to the frame of coordinates 1, lambda.

The matrix P is three times four, combining internal participation in the excursions. Subpixels are three-dimensional vectors, which must eventually be divided by a third dimension; they are lost as normal three-dimensional locations. Since the subdirectorial multiplied by any non-zero mark represents the same pixel, the overall multiplier of P does not change the projection. On the contrary, depth plus minus has a visible meaning: Z equals zero time and the negative value is behind the camera. This project rejects the back point and does not treat its mathematical pixel position as an effective image.

Example 1: Projection and Global Scale Ambiguity

The camera is not rotated, the center is the original, with both pixel focal ranges of 95 and 48 and 40. The depth of the camera is 5, so that the horizontal pixels 48 and 19 are 67 and the vertical pixels 40 and 9.5 are 49.5. Multiply the three coordinates of the point at the same time by two, do not change the par value, and get exactly the same pixel. A single view does not determine the distance of the light on the pixel alone; the low image error does not guarantee that the size of the rice is correct.

If the camera center moves zero-five horizontally, the posture remains unchanged, with the original camera vertical coordinates dropping to zero-five and the trans-pixel to fifty-seven-five, while the vertical pixels remain unchanged. This time, only the camera will remain intact at the world point, so the projection will change. If all world points and all camera centers are multiplied by two, the difference will be multiplied by two, and pixels will remain unchanged. That is the overall degree of freedom that would be achieved only by reconstructing the image on an unknown scale; if the target or baseline of the rice is known to fix it.

Example 2: Rotation Is Not Translation

Consider the 90-degree matrix of the frame around the camera. Three lines are 01, 101, and minus 10. It turns the world vector 100 into zero, minus one; zero to zero; it stays in length, positive one. If the camera center is 100, then t is equal to zero one, not minus 10. The world centre is reduced by 202 to 10.2 and rotates to minus one, and it is located behind it, and it must reject projection.

The sensitivity of the project to the position can be directly guided. The vertical pixels lead to the camera horizontal coordinates by focal depth, negative focal distance by cross-coordinated depth squares; vertical homogeneity. By multiplying the two rows by a three-dimensionally comparable J, and R, they get a guide to the world position. The variation of the pixels at a small disturbance is similar to the change in the J multiplier position, the error being the second order of the disturbance; the depth close to zero hour is so large that the small location error may be strongly magnified, so that the positive depth is not equal to numerical security.

Jπ=[fx/Zc0−fxXc/Zc20fy/Zc−fyYc/Zc2],δx=JπR δX+O(∥δX∥2)J_\pi=\begin{bmatrix}f_x/Z_c&0&-f_xX_c/Z_c^2\\0&f_y/Z_c&-f_yY_c/Z_c^2\end{bmatrix},\qquad \delta x=J_\pi R\,\delta X+O(\|\delta X\|^2)
The double slash in the matrix only means a real line break, and the other LaTeX commands are single reverse slashes.

In the real lens, the ideal homogenous coordinates are also deformed. The minimum-direction model takes the vertical coordinates by one plus the k by a radius square, and the radius square is the single horizontal horizontal square. It makes the margin error usually greater than the central error. The teratonic parameter is not an equal parameter and cannot always be absorbed by moving three-dimensional points. Here the generator clearly sets the deformity to zero. The project does not claim to complete the full marking of the actual lens; the replacement of the camera photo must increase the estimate or first correction of the distortion and verify the spatial distribution of the debris.

Changes in the resolution of pictures also affect internal content. Zooming images in both sides of the spectrum is double that of pixel focal range and main point, with the world point and camera rice positions constant. A systematic projection error occurs when the image is magnified only by using the old K. If the ratio is scaled, the two directions are updated by the focus range and the main point. The crop changes the main point deviation. Such pre-processing should be included in the image list, otherwise a data-processing problem could be diagnosed in an inadequate three-dimensional model.

This project uses known non-combined target estimates for the general P, then triangulates the unknown beads, and does not assume that all cameras are parallel diquints. The rendering phase is normalized using known focal pixel scales and marking the depth of P; this is an open marking condition, not unmarked structural recovery. The camera matrix is straight, center zero, known projection and back-point refusal to form a different check, and no single item can replace the whole group examination. The next chapter will make clear how P corresponds to the wrong pixels.

The rotation combination can be checked for non-exchange by 90 degrees of the two axes. Shifting the right-unit vector around the axis to a negative direction, and then going around the horizontal axis, will fall on the other side. The first horizontal axis does not change the right vector, while the second is changing it to a negative direction, with different results. In the code, the top right-right of the array is used before the column, so that the order of writing corresponds to the order of natural languages. Camera multilayer coordinates changes should indicate input and output coordinates on each matrix, and the same dimension is not enough to allow any kind of multiplication.

When a world ray is restored from pixels, first by K The reverse is that the subpixel gets the camera direction, then the other side. R The re-routing back to the world. C. The direction can be normalized without changing the concentration of the rays; the distance parameter must be right in front of the camera. This direction should be re-profiled, and it should be returned to the same pixel, no matter how good it is. The round-trip check will both check the direction of the switch and show once again that the single perspective lacks depth. The following two perspectives do not repeat the same message.

Run in the Project DirectoryOperating in the project environment, confirming the world to camera and needle-hole projection.
from vision3d.core import look_at,project
import numpy as np
P,R=look_at([0,0,0])
u,z=project([[1,.5,5]],P)
np.testing.assert_allclose(u,[[67,49.5]])
np.testing.assert_allclose(R@R.T,np.eye(3))
print(u,z)

TRY IT YOURSELF

Practice I: Restore the camera centre

The known rotation matrix is the above-mentioned array, which orbits the axis by 90 degrees, moving to zero, zero, one.

Hint 1
Camera centre meets R C+t = 0, not directly t.
Hint 2
Reverse the rotation matrix to replace C with a transposition and check for zero.
Compare with the Solution
The centre is the negative conversion of R by t. The third row for the conversion of R is negative 1, zero, zero, multiplied by one, zero, zero, zero, zero. The replacement of R C with zero, zero, negative one, plus t with zero vectors means that the centre itself does not have a valid image orientation. If an error is made, then the centre will receive zero, zero, zero, one, zero in generations, which gives an algebra counter-indicator that does not depend on the image.

TRY IT YOURSELF

Practice II: Deep sensitivity

The focal range is 100 pixels, the camera is one metre across coordinates and five meters in depth. How much of the first step of the hyperpixel changes when depth is increased by zero and one metre? What is the exact margin?

Hint 1
The u=fX/Z is first directed to Z and confirmed as the unit of deep disturbance is rice.
Hint 2
By multiplying the lead by a small disturbance action step, the difference between the new and old periscope ratios is calculated directly, comparing the magnitude of the remaining error.
Compare with the Solution
The depth guide is negative 100 by 1 x 25, i.e. negative 4 pixels per metre, so the first-level projection is negative zero zero zero four pixels. The precise change is a hundred by 5:01 minus five, and a negative 0:0392 minus 10 negative five, which corresponds to the second order error of the small disturbance. The main point is offset by the difference and the unit has to write the disturbance as rice. This linearity seems to be reliable only when the disturbance is relatively low.

TRY IT YOURSELF

Practice III: Scale Images

The original focal range is 95, the main point 48 and 40, and the image is doubled each, then 10 pixels are cut off from the left side, and six pixels are cut above. What is the new inner factor, is the three-dimensional scale different?

Hint 1
Pixels are scaled and cropped first. Are the 3D coordinates involved in the change?
Hint 2
New = 2u old - crop to project, reading the changes in focal length and main point separately, and taking care of the order of operations.
Compare with the Solution
The new focal range is 190 in both directions; the main point after the scaling is 96 and 80, and the clippings are 86 and 74 respectively. The 3D scene and camera centre is still using the original rice, not changing by image processing. The new pixel coordinates are equal to the original coordinate double-draw-over and can be validated by a new projection. If only the size is updated without the internal content being updated, there will be systemic errors that cannot be mistaken for subsequent training as a problem of generalizing the new perspective.

CHECK YOUR UNDERSTANDING

Check Your Understanding

Answer first, then open the explanation to check your reasoning. These questions help reveal gaps in understanding; independent implementation and transfer require separate evaluation.

1. What's the relationship between the Camera World Center and the Transvestite?

Show ExplanationThe world has to bring the camera center to the original.
2. What does the protagonism mean by negative?

Show ExplanationPure rotation belongs to the proximate branch of the row.
3. Multiply all points and camera positions and how are pixels changing while maintaining the posture?

Show ExplanationThe visualization de-escalate the common scale and the absolute measure requires additional information.
4. How do image cropping primarily update the main point?

Show ExplanationCrops to change the pixel origin and geometry does not move with it.

Manual completion records your progress; it does not certify your project.