Explore 1.5M+ audiobooks & ebooks free for days

Only $12.99 CAD/month after trial. Cancel anytime.

Two Dimensional Computer Graphics: Exploring the Visual Realm: Two Dimensional Computer Graphics in Computer Vision
Two Dimensional Computer Graphics: Exploring the Visual Realm: Two Dimensional Computer Graphics in Computer Vision
Two Dimensional Computer Graphics: Exploring the Visual Realm: Two Dimensional Computer Graphics in Computer Vision
Ebook258 pages2 hoursComputer Vision

Two Dimensional Computer Graphics: Exploring the Visual Realm: Two Dimensional Computer Graphics in Computer Vision

Rating: 0 out of 5 stars

()

Read preview

About this ebook

What is Two Dimensional Computer Graphics


2D computer graphics is the computer-based generation of digital images-mostly from two-dimensional models and by techniques specific to them. It may refer to the branch of computer science that comprises such techniques or to the models themselves.


How you will benefit


(I) Insights, and validations about the following topics:


Chapter 1: 2D computer graphics


Chapter 2: Orthogonal matrix


Chapter 3: Ellipsoid


Chapter 4: Rotation (mathematics)


Chapter 5: Transformation matrix


Chapter 6: Rotation matrix


Chapter 7: Rotation formalisms in three dimensions


Chapter 8: Axis-angle representation


Chapter 9: Kinematics


Chapter 10: Three-dimensional rotation operator


(II) Answering the public top questions about two dimensional computer graphics.


(III) Real world examples for the usage of two dimensional computer graphics in many fields.


Who this book is for


Professionals, undergraduate and graduate students, enthusiasts, hobbyists, and those who want to go beyond basic knowledge or information for any kind of Two Dimensional Computer Graphics.

LanguageEnglish
PublisherOne Billion Knowledgeable
Release dateMay 5, 2024
Two Dimensional Computer Graphics: Exploring the Visual Realm: Two Dimensional Computer Graphics in Computer Vision

Other titles in Two Dimensional Computer Graphics Series (30)

View More

Read more from Fouad Sabry

Related to Two Dimensional Computer Graphics

Titles in the series (100)

View More

Related ebooks

Intelligence (AI) & Semantics For You

View More

Reviews for Two Dimensional Computer Graphics

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Two Dimensional Computer Graphics - Fouad Sabry

    Chapter 1: 2D computer graphics

    Generating digital images on a computer, typically from two-dimensional models (such as 2D geometric models, text, and digital images) and using methods tailored to these types of models is known as 2D computer graphics. Either the models themselves or the field of computer science that includes them could be meant.

    Typography, cartography, technical drawing, advertising, etc. are all examples of applications that built on the foundation of 2D computer graphics. Two-dimensional models are preferred over three-dimensional computer graphics in these cases because they allow for greater direct control over the image. This is because the two-dimensional image is more than just a representation of a real-world object; it also has additional semantic value (whose approach is more akin to photography than to typography).

    Document descriptions based on 2D computer graphics techniques can be significantly smaller than the corresponding digital image in many fields, including desktop publishing, engineering, and business. Since this representation can be rendered at varying resolutions to accommodate a variety of output devices, it is also more versatile. This is why 2D graphic files are commonly used for archiving and transporting documents and images.

    Vector graphics devices from the 1950s paved the way for the first 2D computer graphics. In the decades that followed, raster-based devices became the norm. Two of the most important innovations in this area are the PostScript language and the X Window System protocol.

    Combinations of geometric models (also known as vector graphics), digital images (also known as raster graphics), text to be typeset (described by its content, font style and size, color, position, and orientation), mathematical functions and equations, and other types of information are all possible in 2D graphics models. Two-dimensional geometric transformations, such as translation, rotation, and scaling, allow for easy and precise manipulation of these parts. An object with a self-rendering method, a process that arbitrarily assigns colors to image pixels, describes the image in object-oriented graphics. In object-oriented programming paradigms, complex models are constructed from submodels.

    The principles of Euclidean geometry, In geometry, a translation moves every point by some fixed distance in some direction.

    One type of rigid motion is translation; other types include rotation and reflection.

    It is also possible to think of a translation as the process of adding a constant vector to each point, or as if the coordinate system's origin were moved.

    A translation operator is an operator T_\mathbf{\delta} such that T_\mathbf{\delta} f(\mathbf{v}) = f(\mathbf{v}+\mathbf{\delta}).

    When v is a constant vector, then the translation Tv will work as Tv(p) = p + v.

    Theoretically, if T is a translation,, If A is a subset and T is a function, then the translation of A by T is the image of A under T.

    The translation of A by Tv is often written A + v.

    Any translation in a Euclidean space is also an isometry. The set of all translations is called the translation group T, and it is an ordinary subgroup of the Euclidean group E, being isomorphic to the space itself (n ). Orthogonal group O is an isomorphism of the quotient group E(n) by T. (n ):

    E(n ) / T ≅ O(n ).

    Unlike a linear transformation, a translation is an affine transformation, The translation operator is typically represented by a matrix, making it linear, when homogeneous coordinates are used.

    Thus we write the 3-dimensional vector w = (wx, wy, wz) using 4 homogeneous coordinates as w = (wx, wy, wz, 1).

    Each homogeneous vector p (in homogeneous coordinates) must be multiplied by this translation matrix if an object is to be translated by a vector v:

    T_{\mathbf{v}} = \begin{bmatrix} 1 & 0 & 0 & v_x \\ 0 & 1 & 0 & v_y \\ 0 & 0 & 1 & v_z \\ 0 & 0 & 0 & 1 \end{bmatrix}

    The product of the multiplication is as shown in the table below:

    T_{\mathbf{v}} \mathbf{p} = \begin{bmatrix} 1 & 0 & 0 & v_x \\ 0 & 1 & 0 & v_y\\ 0 & 0 & 1 & v_z\\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} p_x \\ p_y \\ p_z \\ 1 \end{bmatrix} = \begin{bmatrix} p_x + v_x \\ p_y + v_y \\ p_z + v_z \\ 1 \end{bmatrix} = \mathbf{p} + \mathbf{v}

    To find the inverse of a translation matrix, simply flip the vector's direction:

    T^{-1}_{\mathbf{v}} = T_{-\mathbf{v}} . \!

    Likewise, multiplying the vectors together yields the product of two translation matrices:

    T_{\mathbf{u}}T_{\mathbf{v}} = T_{\mathbf{u}+\mathbf{v}} . \!

    Multiplication of translation matrices is commutative because vector addition is commutative (unlike multiplication of arbitrary matrices).

    A rotation matrix, in linear algebra, is a matrix that rotates an object in Euclidean space.

    R={\begin{bmatrix}\cos \theta &-\sin \theta \\\sin \theta &\cos \theta \\\end{bmatrix}}

    rotates points in the xy-Cartesian plane counterclockwise through an angle θ about the origin of the Cartesian coordinate system.

    A rotation matrix R is used to effect the rotation, Each point's coordinates must be expressed as a vector in the vertical direction, consisting of the point's coordinates.

    The matrix multiplication Rv yields a rotated vector.

    To clarify, the zero vector (i.e.) is unaffected by matrix multiplication, based on zero-degree coordinates), Only rotations around the coordinate system's origin can be described by means of rotation matrices.

    Such rotations can be easily described algebraically with the help of rotation matrices., and play a crucial role in geometric computations, physics, and graphical interfaces.

    Within the confines of a plane, a rotation can be simply described by an angle θ of rotation, Alternatively, the 4 entries of a 22 rotation matrix can be used to represent it.

    With respect to the third dimension, See also Euler's rotation theorem, which states that any rotation can be recast as an angular rotation about a single, unchanging axis, which can be reduced to an angle and a three-element vector.

    However, Alternatively, it can be represented by the 9 entries of a 33 rotation matrix.

    In dimensions greater than three, rotation is rarely employed; a rotational displacement is something that can be talked about, which a matrix can be used to represent, there being no single axis or angle associated with it.

    A rotation matrix is a square matrix whose entries are all real. To be more precise, they are determinant-1 orthogonal matrices:

    R^{T} = R^{-1}, \det R = 1\, .

    The collection of all n-by-n special orthogonal matrices forms a group called SO (n).

    The following is the form that every two-dimensional rotation matrix takes:

    R(\theta )={\begin{bmatrix}\cos \theta &-\sin \theta \\\sin \theta &\cos \theta \\\end{bmatrix}} .

    By multiplying the following matrix, column vectors are rotated:

    {\begin{bmatrix}x'\\y'\\\end{bmatrix}}={\begin{bmatrix}\cos \theta &-\sin \theta \\\sin \theta &\cos \theta \\\end{bmatrix}}{\begin{bmatrix}x\\y\\\end{bmatrix}}

    .

    After rotation, the coordinates of the original point (x,y) are:

    x'=x\cos \theta -y\sin \theta \, , y'=x\sin \theta +y\cos \theta \, .

    The direction of vector rotation is counterclockwise if θ is positive (e.g.

    90°), and clockwise if θ is negative (e.g.

    -90°).

    R(-\theta )={\begin{bmatrix}\cos \theta &\sin \theta \\-\sin \theta &\cos \theta \\\end{bmatrix}}\,

    .

    In the case of a right-handed Cartesian system,, rightward along the x axis and upward along the y axis, the rotation R(θ) is counterclockwise.

    For a left-handed Cartesian system to work,, with x pointing right and y pointing down, R(θ) is clockwise.

    In mathematics, such unusual perspectives are rarely employed, but in 2D computer graphics, they are commonplace, which typically start at the top left and move clockwise down the page.

    Other possible conventions that alter the meaning of a rotation produced by a matrix are discussed below.

    Particularly useful are the matrices for 90° and 180° rotations:

    R(90^\circ) = \begin{bmatrix} 0 & -1 \\[3pt] 1 & 0 \\ \end{bmatrix} (90° counterclockwise rotation)

    R(180^\circ) = \begin{bmatrix} -1 & 0 \\[3pt] 0 & -1 \\ \end{bmatrix} (180° rotation in either direction – a half-turn)

    R(270^\circ) = \begin{bmatrix} 0 & 1 \\[3pt] -1 & 0 \\ \end{bmatrix} (270° counterclockwise rotation, the same as a 90° clockwise rotation)

    Uniform scaling, also known as isotropic scaling, homogeneous dilation, and homothety, is a linear transformation in Euclidean geometry that enlarges or reduces objects by the same scale factor in all directions. When scaling everything by the same factor, the end result is geometrically similar to the original. In most cases, you can treat congruent shapes as similar with a scale factor of 1. (Some textbooks explicitly rule this out, just as some textbooks rule out the possibility of a square being a rectangle or a circle being an ellipse.)

    The more general approach is to use a different scale factor for each axis. When at least one of the scaling factors is distinct from the others, we have non-uniform scaling (anisotropic scaling, inhomogeneous dilation); directional scaling or stretching is a special case of this (in one direction). When an object is scaled non-uniformly, its shape alters as a result. For instance, a square whose sides are not parallel to the scaling axes becomes a rectangle or a parallelogram (the angles between lines parallel to the axes are preserved, but not all angles).

    A scaling matrix is a representation of a scaling.

    To scale an object by a vector v = (vx, vy, vz), each point p = (px, py, pz) would need to be multiplied with this scaling matrix:

    S_{v}={\begin{bmatrix}v_{x}&0&0\\0&v_{y}&0\\0&0&v_{z}\\\end{bmatrix}}.

    The product of the multiplication is as shown in the table below:

    S_{v}p={\begin{bmatrix}v_{x}&0&0\\0&v_{y}&0\\0&0&v_{z}\\\end{bmatrix}}{\begin{bmatrix}p_{x}\\p_{y}\\p_{z}\end{bmatrix}}={\begin{bmatrix}v_{x}p_{x}\\v_{y}p_{y}\\v_{z}p_{z}\end{bmatrix}}.

    A three-factor scaling modifies an object's dimensions as follows: its diameter is reduced by a factor between the scale factors, its surface area is increased by a factor between the smallest and largest product of two scale factors, and its volume is decreased by the product of all three scale factors.

    The scaling is uniform if and only if the scaling factors are equal (vx = vy = vz).

    When all but one of the scale factors is 1, the situation is as follows:, Our scaling is directional.

    In the case where vx = vy = vz = k, Scaling by a factor k is also known as an enlargement or a dilation, increasing the area by a factor of k² and the volume by a factor of k³.

    In its broadest sense, scaling refers to any affine transformation whose matrix can be diagonalized. When the three dimensions of scaling are not parallel to one another, this is also considered a case. Also included are scenarios in which one or more of the scale factors is zero (as in a projection) or negative. The latter is equivalent to a generalization of reflection in the plane, and it is achieved by taking the reflection at the point where two lines intersect a plane that need not be perpendicular to either of them.

    Within the realm of projective geometry, typical of the realm of computer graphics, homogeneous coordinates are used to represent points.

    To scale an object by a vector v = (vx, vy, vz), each homogeneous coordinate vector p = (px, py, pz, This projective transformation matrix would need to be multiplied by (1, 1):

    S_{v}={\begin{bmatrix}v_{x}&0&0&0\\0&v_{y}&0&0\\0&0&v_{z}&0\\0&0&0&1\end{bmatrix}}.

    The product of the multiplication is as shown in the table below:

    S_{v}p={\begin{bmatrix}v_{x}&0&0&0\\0&v_{y}&0&0\\0&0&v_{z}&0\\0&0&0&1\end{bmatrix}}{\begin{bmatrix}p_{x}\\p_{y}\\p_{z}\\1\end{bmatrix}}={\begin{bmatrix}v_{x}p_{x}\\v_{y}p_{y}\\v_{z}p_{z}\\1\end{bmatrix}}.

    Using this scaling matrix, we can achieve uniform scaling by a common factor s (uniform scaling) because the fourth component of a homogeneous coordinate can be seen as the denominator of the other three components:

    S_{v}={\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&{\frac {1}{s}}\end{bmatrix}}.

    For each vector p = (px, py, pz, If we had 1)

    S_{v}p={\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&{\frac {1}{s}}\end{bmatrix}}{\begin{bmatrix}p_{x}\\p_{y}\\p_{z}\\1\end{bmatrix}}={\begin{bmatrix}p_{x}\\p_{y}\\p_{z}\\{\frac {1}{s}}\end{bmatrix}}

    that would

    Enjoying the preview?
    Page 1 of 1