Files

63 lines
3.4 KiB
XML

<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="cam-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#555"/>
</marker>
<marker id="cam-arrow-blue" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#3498db"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Pinhole Camera Model</text>
<!-- 3D scene (left side) -->
<text x="100" y="50" fill="#666" font-size="11" text-anchor="middle">3D World</text>
<!-- Object: a simple triangle/tree -->
<polygon points="100,70 70,150 130,150" fill="#27ae60" opacity="0.3" stroke="#27ae60" stroke-width="1.5"/>
<text x="100" y="140" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">P(X,Y,Z)</text>
<!-- Star point at top of object -->
<circle cx="100" cy="75" r="4" fill="#e74c3c"/>
<!-- Optical centre (pinhole) -->
<circle cx="320" cy="150" r="6" fill="#333"/>
<text x="320" y="178" fill="#333" font-size="11" text-anchor="middle" font-weight="bold">Optical Centre</text>
<text x="320" y="192" fill="#666" font-size="10" text-anchor="middle">(pinhole)</text>
<!-- Light ray from object through pinhole to image plane -->
<line x1="100" y1="75" x2="320" y2="150" stroke="#e74c3c" stroke-width="1.5" stroke-dasharray="6,3"/>
<line x1="320" y1="150" x2="540" y2="225" stroke="#e74c3c" stroke-width="1.5"/>
<!-- Second ray -->
<line x1="70" y1="150" x2="320" y2="150" stroke="#f39c12" stroke-width="1" stroke-dasharray="4,3" opacity="0.6"/>
<line x1="320" y1="150" x2="570" y2="150" stroke="#f39c12" stroke-width="1" opacity="0.6"/>
<!-- Image plane -->
<line x1="530" y1="80" x2="530" y2="260" stroke="#3498db" stroke-width="2.5"/>
<text x="600" y="50" fill="#3498db" font-size="11" font-weight="bold" text-anchor="middle">Image Plane</text>
<!-- Projected point on image plane -->
<circle cx="540" cy="225" r="4" fill="#e74c3c"/>
<text x="595" y="230" fill="#e74c3c" font-size="10" text-anchor="middle">p(u,v)</text>
<!-- Focal length annotation -->
<line x1="320" y1="210" x2="530" y2="210" stroke="#9b59b6" stroke-width="1.5" marker-end="url(#cam-arrow)"/>
<line x1="530" y1="210" x2="320" y2="210" stroke="#9b59b6" stroke-width="1.5"/>
<text x="425" y="228" fill="#9b59b6" font-size="11" text-anchor="middle" font-weight="bold">f (focal length)</text>
<!-- Optical axis -->
<line x1="180" y1="150" x2="620" y2="150" stroke="#999" stroke-width="1" stroke-dasharray="4,4"/>
<text x="630" y="155" fill="#999" font-size="9" text-anchor="start">optical axis</text>
<!-- Principal point -->
<circle cx="530" cy="150" r="3" fill="#9b59b6"/>
<text x="545" y="145" fill="#9b59b6" font-size="9" text-anchor="start">(c_x, c_y)</text>
<!-- Depth annotation -->
<line x1="100" y1="265" x2="320" y2="265" stroke="#666" stroke-width="1"/>
<line x1="100" y1="258" x2="100" y2="272" stroke="#666" stroke-width="1"/>
<line x1="320" y1="258" x2="320" y2="272" stroke="#666" stroke-width="1"/>
<text x="210" y="282" fill="#666" font-size="10" text-anchor="middle">Z (depth)</text>
<!-- Bottom note -->
<rect x="130" y="56" width="160" height="22" rx="4" fill="#f5f5f5" stroke="#ccc" stroke-width="1"/>
<text x="210" y="72" fill="#333" font-size="9" text-anchor="middle">u = f_x · X/Z + c_x</text>
</svg>