1、The CameraOverview The pinhole projection modelQualitative propertiesPerspective projection matrix Cameras ModelThe camera matrixDepth of focusField of viewLens aberrationsHow do we see the world?Lets design a cameraIdea 1:put a piece of film in front of an objectDo we get a reasonable image?Pinhole
2、 cameraAdd a barrier to block off most of the raysThis reduces blurringThe opening known as the aperturePinhole camera modelPinhole model:Captures pencil of rays all rays through a single pointThe point is called Center of Projection(focal point)The image is formed on the Image PlaneCamera Obscura B
3、asic principle known to Mozi(470-390 BCE),Aristotle(384-322 BCE)Drawing aid for artists:described by Leonardo da Vinci(1452-1519)Depth of the room(box)is the effective focal lengthGemma Frisius,1558Dimensionality Reduction Machine(3D to 2D)3D world2D imageWhat have we lost?Angles Distances(lengths)P
4、rojection properties Many-to-one:any points along same ray map to same point in image Points pointsBut projection of points on focal plane is undefined Lines lines(collinearity is preserved)But line through focal point projects to a point Planes planesBut plane through focal point projects to linePr
5、ojection properties Parallel lines converge at a vanishing pointEach direction in space has its own vanishing pointBut parallels parallel to the image plane remain parallelHow do we construct the vanishing point?One-point perspectiveMasaccio,Trinity,Santa Maria Novella,Florence,1425-1427First consis
6、tent use of perspective in Western art?Parallel projectionthe gods view point.清明上河图Perspective distortion Problem for architectural photography:converging verticalsPerspective distortion Problem for architectural photography:converging verticals Solution:view camera(lens shifted w.r.t.film)Tilting t
7、he camera upwards results in converging verticalsKeeping the camera level,with an ordinary lens,captures only the bottom portion of the buildingShifting the lens upwards results in a picture of the entire subjecthttp:/en.wikipedia.org/wiki/Perspective_correction_lensPerspective distortion Problem fo
8、r architectural photography:converging verticals Result:Modeling projectionThe coordinate systemWe will use the pinhole model as an approximationPut the optical center(O)at the originPut the image plane()in front of O xyzSource:J.Ponce,S.SeitzxyzModeling projectionProjection equationsCompute interse
9、ction with of ray from P=(x,y,z)to ODerived using similar triangles),(),(fzyfzxfzyxWe get the projection by throwing out the last coordinate:),(),(zyfzxfzyxxyzModeling projectionProjection equationsCompute intersection with of ray from P=(x,y,z)to ODerived using similar trianglesWe get the projectio
10、n by throwing out the last coordinate:),(),(zyfzxfzyxHomogeneous coordinatesIs this a linear transformation?Trick:add one more coordinate:homogeneous image coordinateshomogeneous scene coordinatesConverting from homogeneous coordinates nodivision by z is nonlinearSlide by Steve Seitzdivide by the th
11、ird coordinatePerspective Projection MatrixProjection is a matrix multiplication using homogeneous coordinates:/10/10000100001fzyxzyxf),(zyfzxfIn practice:lots of coordinate transformationsWorld to camera coord.trans.matrix(4x4)Perspectiveprojection matrix(3x4)Camera to pixel coord.trans.matrix(3x3)
12、=2Dpoint(3x1)3Dpoint(4x1)Orthographic ProjectionSpecial case of perspective projectionDistance from center of projection to image plane is infiniteAlso called“parallel projection”Whats the projection matrix?ImageWorldBuilding a real cameraHome-made pinhole camera http:/www.debevec.org/Pinhole/Why so
13、blurry?Shrinking the apertureWhy not make the aperture as small as possible?Less light gets throughDiffraction effectsShrinking the apertureSolution:Adding a lensA lens focuses light onto the filmRays passing through the center are not deviatedAdding a lensA lens focuses light onto the filmRays pass
14、ing through the center are not deviatedAll parallel rays converge to one point on a plane located at the focal length ffocal pointfAdding a lensA lens focuses light onto the filmThere is a specific distance at which objects are“in focus”other points project to a“circle of confusion”in the image“circ
15、le of confusion”Thin lensesThin lens equation:Any object point satisfying this equation is in focus What is the shape of the focus region?How can we change the focus region?Thin lensesCamera ModelsCamera ModelsCamera ModelsCamera ModelsCamera ModelsPerspective projection transformationCamera ModelsT
16、he camera matrixCamera ModelsThe camera matrixWorld reference systemWorld reference systemWorld reference systemNo distortionPin cushionBarrelRadial DistortionCaused by imperfect lensesDeviations are most noticeable for rays that pass through the edge of the lensMore about a real cameraDepth of Fiel
17、dHow can we control the depth of field?Changing the aperture size affects depth of fieldA smaller aperture increases the range in which the object is approximately in focusBut small aperture reduces amount of light need to increase exposureVarying the aperture Large apeture =small DOFSmall apeture=l
18、arge DOFNice Depth of Field effectTilt-shift lenses Tilting the lens with respect to the image plane allows to choose an arbitrary plane of focus Standard setup:plane of focus is parallel to image plane and lens planeimage planelens planeplane of focusshifttiltTilt-shift lenses Tilting the lens with
19、 respect to the image plane allows to choose an arbitrary plane of focus Scheimpflug principle:plane of focus passes through the line of intersection between the lens plane and the image planeimage planetiltedlens planeplane of focusshifttilt“Fake miniatures”Olivo Barbieri:http:/ of View(Zoom)Slide
20、by A.EfrosField of View(Zoom)Slide by A.EfrosfFOV depends of Focal LengthSmaller FOV=larger Focal LengthField of View/Focal LengthLarge FOV,small fCamera close to carSmall FOV,large fCamera far from the carSame effect for facesstandardwide-angletelephotoSource:Hartley&ZissermanApproximating an affin
21、e cameraReal lensesLens Flaws:Chromatic AberrationLens has different refractive indices for different wavelengths:causes color fringingLens flaws:Spherical aberrationSpherical lenses dont focus light perfectlyRays farther from the optical axis focus closerLens flaws:VignettingDigital cameraA digital
22、 camera replaces film with a sensor arrayEach cell in the array is light-sensitive diode that converts photons to electronsTwo common types Charge Coupled Device(CCD)Complementary metal oxide semiconductor(CMOS)http:/ Color sensing in camera:Color filter arrayEstimate missing components from neighbo
23、ring values(demosaicing)Why more green?Bayer gridHuman Luminance Sensitivity FunctionColor sensing in camera:Prism Requires three chips and precise alignment More expensiveCCD(B)CCD(G)CCD(R)SummaryPinhole camerasCamera&lensesThe geometry of pinhole camerasProjection matrixIntrinsic parametersExtrinsic parametersAssignmentUse Matlab camera calibrator to calibration your camera and measure object.1.Build your own test board.2.Fix the camera and take some photos.3.Calibrate you camera.intrinsic parameters extrinsic parameters4.Measure the DOF of a Rubiks Cube.