【图形学】探秘图形学奥秘:图形变换的解密与实战

简介: 【图形学】探秘图形学奥秘:图形变换的解密与实战



🌌1. 初识模式识别

图形学技术是一门涉及计算机图形和图像处理的学科,其目标是通过算法和数学模型来创建、处理和呈现图形和图像。这项技术的应用范围非常广泛,涵盖了许多领域,包括计算机游戏、虚拟现实、计算机辅助设计(CAD)、医学图像处理、动画制作等。

以下是图形学技术的一些关键方面:

  1. 图形生成和渲染: 图形学技术用于生成和呈现视觉图像。这包括三维图形的创建、光照、阴影、颜色和纹理等方面的处理,以产生逼真的图形。
  2. 计算机辅助设计(CAD): 在工程学和设计领域,图形学技术被广泛用于创建和编辑数字化的设计图纸,促进设计过程的可视化和交互。
  3. 计算机游戏和虚拟现实: 图形学技术是游戏开发和虚拟现实领域的核心。它用于创建游戏中的角色、场景、特效以及虚拟现实环境,提供沉浸式的视觉体验。
  4. 医学图像处理: 在医学领域,图形学技术被用于处理和呈现医学图像,如CT扫描、MRI等,以协助医生进行诊断和手术规划。
  5. 动画制作: 图形学技术是制作动画的关键。通过在计算机上生成图形帧并进行渲染,动画制作得以实现。
  6. 图像处理: 图形学技术也包括对静态图像的处理,如图像编辑、滤镜应用、图像合成等。

在图形学技术的发展中,硬件加速、实时渲染、虚拟现实和增强现实等方面的创新不断推动着图形学的前沿。这门技术为数字世界的可视化和交互提供了强大的工具和方法。


🌌2. 图形变换

🌍2.1 开发环境及实现

  • 语言: C++
  • 平台: Microsoft Visual Studio 2022

🌍2.2 实验目的

  • 进行二维图形的各种几何变换,利用基本图形实现。

🌍2.3 实验要求

  1. 使用Microsoft Visual Studio 2022编程。
  2. 实现以下几何变换:
  • 平移变换
  • 旋转变换
  • 对称变换
  • 比例变换。

🌍2.4 实验原理

图形的几何变换一般是指对图形的几何信息经过变换后产生新的图形,图形几何变换既可以看作是坐标系不动而图形变动,变动后的图形在坐标系中的坐标值发生变化;出可以看作图形不动而坐标系变动,变动后的图形在新坐标系下具有新的坐标值。这两种情况本质上都是一样的,都是图形由新的坐标值表示,因此是新产生的图形。图形几何变换包括比例变换、对称变换、错切变换、旋转变换、平移变换及其复合变换。图形上所有的点在几何变换前后的坐标关系一般用解析几何方法可以求得,但这些几何关系用矩阵方法表示,运算更为方便。

图形基本几何变换是指比例变换、对称变换、错切变换、旋转变换和平移变换等。除平移变换外,这里其它四种几何变换都可以用组成图形的点向量(或称1×2阶矩阵)和2×2阶变换矩阵相乘表示,而平移变换需引入新方法来实现。


🌍2.5 实验步骤

对图形分别进行平移变换、旋转变换、对称变换以及比例变换。

程序代码示例如下:


🌕2.5.1 平移变换
#include <GL/glut.h>
#include <stdlib.h>
#include <math.h>
GLsizei winWidth = 600, winHeight = 600;
GLfloat xwcMin = 0.0, xwcMax = 225.0;
GLfloat ywcMin = 0.0, ywcMax = 225.0;
class wcPt2D
{
public:
  GLfloat x, y;
};
typedef GLfloat Matrix3x3[3][3];
Matrix3x3 matComposite;
const GLdouble pi = 3.14159;
void Init()
{
  glClearColor(1.0, 1.0, 1.0, 0.0);
}
void Matrix3x3SetIdentity(Matrix3x3 matIdent3x3)
{
  GLint row, col;
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      matIdent3x3[row][col] = (row == col);
    }
  }
}
void Matrix3x3PreMultiply(Matrix3x3 m1, Matrix3x3 m2)
{
  GLint row, col;
  Matrix3x3 matTemp;
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      matTemp[row][col] =
        m1[row][0] * m2[0][col] +
        m1[row][1] * m2[1][col] +
        m1[row][2] * m2[2][col];
    }
  }
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      m2[row][col] = matTemp[row][col];
    }
  }
}
void Translate2D(GLfloat tx, GLfloat ty)
{
  Matrix3x3 matTransl;
  Matrix3x3SetIdentity(matTransl);
  matTransl[0][2] = tx;
  matTransl[1][2] = ty;
  Matrix3x3PreMultiply(matTransl, matComposite);
}
void TransformVerts2D(GLint nVerts, wcPt2D* verts)//平移函数实现
{
  GLint k;
  GLfloat temp;
  for (k = 0; k < nVerts; k++)
  {
    temp = matComposite[0][0] * verts[k].x +
      matComposite[0][1] * verts[k].y +
      matComposite[0][2];
    verts[k].y = matComposite[1][0] * verts[k].x +
      matComposite[1][1] * verts[k].y +
      matComposite[1][2];
    verts[k].x = temp;
  }
}
void Trangle(wcPt2D* verts)
{
  GLint k;
  glBegin(GL_TRIANGLES);
  for (k = 0; k < 3; k++)
  {
    glVertex2f(verts[k].x, verts[k].y);
  }
  glEnd();
}
void WinReshapFcn(GLint newWidth, GLint newHeight)
{
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(xwcMin, xwcMax, ywcMin, ywcMax);
  glClear(GL_COLOR_BUFFER_BIT);
}
void DisplayFcn()
{
  glClear(GL_COLOR_BUFFER_BIT);
  GLint nVerts = 3;
  wcPt2D verts[3] = { {50,25},{150,25 },{100,100} };
  wcPt2D centroidPt;
  GLint k, xSum = 0, ySum = 0;
  for (size_t k = 0; k < nVerts; k++)
  {
    xSum += verts[k].x;
    ySum += verts[k].y;
  }
  centroidPt.x = GLfloat(xSum) / GLfloat(nVerts);
  centroidPt.y = GLfloat(ySum) / GLfloat(nVerts);
  wcPt2D pivPt, fixedPt;
  pivPt = centroidPt;
  fixedPt = centroidPt;
  GLfloat tx = 0, ty = 100;
  GLfloat sx = 0.5, sy = 0.5;
  GLdouble theta = pi / 2;
  glColor3f(0, 0, 1);
  Trangle(verts);
  Matrix3x3SetIdentity(matComposite);
  Translate2D(tx, ty);
  TransformVerts2D(nVerts, verts);//调用函数
  glColor3f(1, 0, 0);
  Trangle(verts);
  glFlush();
}
void draw_pixel(int ix, int iy)
{
  glBegin(GL_POINTS);
  glVertex2i(ix, iy);
  glEnd();
}
void myinit()
{
  glClearColor(1.0, 0.8, 1.0, 1.0);
  glColor3f(0.0, 0.5, 0.5);
  glPointSize(1.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(0.0, 1000.0, 0.0, 1000.0);
}
int main(int argc, char** argv)
{
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
  glutInitWindowSize(600, 500);
  glutInitWindowPosition(150.0, 150.0);
  glutCreateWindow("图像平移变换");
  glutDisplayFunc(DisplayFcn);
  glutReshapeFunc(WinReshapFcn);
  myinit();
  glutMainLoop();
}

运行结果:


🌕2.5.2 旋转变换
#include <GL/glut.h>
#include <stdlib.h>
#include <math.h>
GLsizei winWidth = 600, winHeight = 600;
GLfloat xwcMin = 0.0, xwcMax = 225.0;
GLfloat ywcMin = 0.0, ywcMax = 225.0;
class wcPt2D
{
public:
  GLfloat x, y;
};
typedef GLfloat Matrix3x3[3][3];
Matrix3x3 matComposite;
const GLdouble pi = 3.14159;
void Init()
{
  glClearColor(1.0, 1.0, 1.0, 0.0);
}
void Matrix3x3SetIdentity(Matrix3x3 matIdent3x3)
{
  GLint row, col;
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      matIdent3x3[row][col] = (row == col);
    }
  }
}
void Matrix3x3PreMultiply(Matrix3x3 m1, Matrix3x3 m2)
{
  GLint row, col;
  Matrix3x3 matTemp;
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      matTemp[row][col] =
        m1[row][0] * m2[0][col] +
        m1[row][1] * m2[1][col] +
        m1[row][2] * m2[2][col];
    }
  }
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      m2[row][col] = matTemp[row][col];
    }
  }
}
void Translate2D(GLfloat tx, GLfloat ty)
{
  Matrix3x3 matTransl;
  Matrix3x3SetIdentity(matTransl);
  matTransl[0][2] = tx;
  matTransl[1][2] = ty;
  Matrix3x3PreMultiply(matTransl, matComposite);
}
void Rotate2D(wcPt2D pivotPt, GLfloat theta)//旋转
{
  Matrix3x3 matRot;
  Matrix3x3SetIdentity(matRot);
  matRot[0][0] = cos(theta);
  matRot[0][1] = -sin(theta);
  matRot[0][2] = pivotPt.x * (1 - cos(theta)) +
    pivotPt.y * sin(theta);
  matRot[1][0] = sin(theta);
  matRot[1][1] = cos(theta);
  matRot[1][2] = pivotPt.y * (1 - cos(theta)) -
    pivotPt.x * sin(theta);
  Matrix3x3PreMultiply(matRot, matComposite);
}
void TransformVerts2D(GLint nVerts, wcPt2D* verts)//平移
{
  GLint k;
  GLfloat temp;
  for (k = 0; k < nVerts; k++)
  {
    temp = matComposite[0][0] * verts[k].x +
      matComposite[0][1] * verts[k].y +
      matComposite[0][2];
    verts[k].y = matComposite[1][0] * verts[k].x +
      matComposite[1][1] * verts[k].y +
      matComposite[1][2];
    verts[k].x = temp;
  }
}
void Trangle(wcPt2D* verts)
{
  GLint k;
  glBegin(GL_TRIANGLES);
  for (k = 0; k < 3; k++)
  {
    glVertex2f(verts[k].x, verts[k].y);
  }
  glEnd();
}
void WinReshapFcn(GLint newWidth, GLint newHeight)
{
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(xwcMin, xwcMax, ywcMin, ywcMax);
  glClear(GL_COLOR_BUFFER_BIT);
}
void DisplayFcn()
{
  GLint nVerts = 3;
  wcPt2D verts[3] = { {50,25},{150,25 },{100,100} };
  wcPt2D centroidPt;
  GLint k, xSum = 0, ySum = 0;
  for (size_t k = 0; k < nVerts; k++)
  {
    xSum += verts[k].x;
    ySum += verts[k].y;
  }
  centroidPt.x = GLfloat(xSum) / GLfloat(nVerts);
  centroidPt.y = GLfloat(ySum) / GLfloat(nVerts);
  wcPt2D pivPt, fixedPt;
  pivPt = centroidPt;
  fixedPt = centroidPt;
  GLfloat tx = 0, ty = 100;
  GLfloat sx = 0.5, sy = 0.5;
  GLdouble theta = pi / 2;
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(0, 0, 1);
  Trangle(verts);
  Matrix3x3SetIdentity(matComposite);
  Rotate2D(pivPt, theta);
  Translate2D(tx, ty);
  TransformVerts2D(nVerts, verts);
  glColor3f(1, 0, 0);
  Trangle(verts);
  glFlush();
}
void draw_pixel(int ix, int iy)
{
  glBegin(GL_POINTS);
  glVertex2i(ix, iy);
  glEnd();
}
void myinit()
{
  glClearColor(1.0, 0.8, 1.0, 1.0);
  glColor3f(0.0, 0.5, 0.5);
  glPointSize(1.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(0.0, 1000.0, 0.0, 1000.0);
}
int main(int argc, char** argv)
{
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
  glutInitWindowSize(600, 500);
  glutInitWindowPosition(150.0, 150.0);
  glutCreateWindow("图像旋转变换");
  glutDisplayFunc(DisplayFcn);
  glutReshapeFunc(WinReshapFcn);
  myinit();
  glutMainLoop();
}

运行结果:


🌕2.5.3 对称变换
#include <GL/glut.h>
#include <stdlib.h>
#include <math.h>
GLsizei winWidth = 600, winHeight = 600;
GLfloat xwcMin = 0.0, xwcMax = 225.0;
GLfloat ywcMin = 0.0, ywcMax = 225.0;
class wcPt2D
{
public:
  GLfloat x, y;
};
typedef GLfloat Matrix3x3[3][3];
Matrix3x3 matComposite;
const GLdouble pi = 3.14159;
void Init()
{
  glClearColor(1.0, 1.0, 1.0, 0.0);
}
void Matrix3x3SetIdentity(Matrix3x3 matIdent3x3)
{
  GLint row, col;
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      matIdent3x3[row][col] = (row == col);
    }
  }
}
void Matrix3x3PreMultiply(Matrix3x3 m1, Matrix3x3 m2)
{
  GLint row, col;
  Matrix3x3 matTemp;
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      matTemp[row][col] =
        m1[row][0] * m2[0][col] +
        m1[row][1] * m2[1][col] +
        m1[row][2] * m2[2][col];
    }
  }
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      m2[row][col] = matTemp[row][col];
    }
  }
}
void Translate2D(GLfloat tx, GLfloat ty)
{
  Matrix3x3 matTransl;
  Matrix3x3SetIdentity(matTransl);
  matTransl[0][2] = tx;
  matTransl[1][2] = ty;
  Matrix3x3PreMultiply(matTransl, matComposite);
}
void Rotate2D(wcPt2D pivotPt, GLfloat theta)//旋转
{
  Matrix3x3 matRot;
  Matrix3x3SetIdentity(matRot);
  matRot[0][0] = cos(theta);
  matRot[0][1] = -sin(theta);
  matRot[0][2] = pivotPt.x * (1 - cos(theta)) +
    pivotPt.y * sin(theta);
  matRot[1][0] = sin(theta);
  matRot[1][1] = cos(theta);
  matRot[1][2] = pivotPt.y * (1 - cos(theta)) -
    pivotPt.x * sin(theta);
  Matrix3x3PreMultiply(matRot, matComposite);
}
void TransformVerts2D(GLint nVerts, wcPt2D* verts)//平移
{
  GLint k;
  GLfloat temp;
  for (k = 0; k < nVerts; k++)
  {
    temp = matComposite[0][0] * verts[k].x +
      matComposite[0][1] * verts[k].y +
      matComposite[0][2];
    verts[k].y = matComposite[1][0] * verts[k].x +
      matComposite[1][1] * verts[k].y +
      matComposite[1][2];
    verts[k].x = temp;
  }
}
void Trangle(wcPt2D* verts)
{
  GLint k;
  glBegin(GL_TRIANGLES);
  for (k = 0; k < 3; k++)
  {
    glVertex2f(verts[k].x, verts[k].y);
  }
  glEnd();
}
void WinReshapFcn(GLint newWidth, GLint newHeight)
{
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(xwcMin, xwcMax, ywcMin, ywcMax);
  glClear(GL_COLOR_BUFFER_BIT);
}
void DisplayFcn()
{
  GLint nVerts = 3;
  wcPt2D verts[3] = { {50,25},{150,25 },{100,100} };
  wcPt2D centroidPt;
  GLint k, xSum = 0, ySum = 0;
  for (size_t k = 0; k < nVerts; k++)
  {
    xSum += verts[k].x;
    ySum += verts[k].y;
  }
  centroidPt.x = GLfloat(xSum) / GLfloat(nVerts);
  centroidPt.y = GLfloat(ySum) / GLfloat(nVerts);
  wcPt2D pivPt, fixedPt;
  pivPt = centroidPt;
  fixedPt = centroidPt;
  GLfloat tx = 0, ty = 100;
  GLfloat sx = 0.5, sy = 0.5;
  GLdouble theta = pi;
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(0, 0, 1);
  Trangle(verts);
  Matrix3x3SetIdentity(matComposite);
  Rotate2D(pivPt, theta);
  Translate2D(tx, ty);
  TransformVerts2D(nVerts, verts);
  glColor3f(1, 0, 0);
  Trangle(verts);
  glFlush();
}
void draw_pixel(int ix, int iy)
{
  glBegin(GL_POINTS);
  glVertex2i(ix, iy);
  glEnd();
}
void myinit()
{
  glClearColor(1.0, 0.8, 1.0, 1.0);
  glColor3f(0.0, 0.5, 0.5);
  glPointSize(1.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(0.0, 1000.0, 0.0, 1000.0);
}
int main(int argc, char** argv)
{
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
  glutInitWindowSize(600, 500);
  glutInitWindowPosition(150.0, 150.0);
  glutCreateWindow("图像对称变换");
  glutDisplayFunc(DisplayFcn);
  glutReshapeFunc(WinReshapFcn);
  myinit();
  glutMainLoop();
}

运行结果:


🌕2.5.4 比例变换
#include <GL/glut.h>
#include <stdlib.h>
#include <math.h>
GLsizei winWidth = 600, winHeight = 600;
GLfloat xwcMin = 0.0, xwcMax = 225.0;
GLfloat ywcMin = 0.0, ywcMax = 225.0;
class wcPt2D
{
public:
  GLfloat x, y;
};
typedef GLfloat Matrix3x3[3][3];
Matrix3x3 matComposite;
const GLdouble pi = 3.14159;
void Init()
{
  glClearColor(1.0, 1.0, 1.0, 0.0);
}
void Matrix3x3SetIdentity(Matrix3x3 matIdent3x3)
{
  GLint row, col;
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      matIdent3x3[row][col] = (row == col);
    }
  }
}
void Matrix3x3PreMultiply(Matrix3x3 m1, Matrix3x3 m2)
{
  GLint row, col;
  Matrix3x3 matTemp;
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      matTemp[row][col] =
        m1[row][0] * m2[0][col] +
        m1[row][1] * m2[1][col] +
        m1[row][2] * m2[2][col];
    }
  }
  for (row = 0; row < 3; row++)
  {
    for (col = 0; col < 3; col++)
    {
      m2[row][col] = matTemp[row][col];
    }
  }
}
void Translate2D(GLfloat tx, GLfloat ty)
{
  Matrix3x3 matTransl;
  Matrix3x3SetIdentity(matTransl);
  matTransl[0][2] = tx;
  matTransl[1][2] = ty;
  Matrix3x3PreMultiply(matTransl, matComposite);
}
void Scale2D(GLfloat sx, GLfloat sy, wcPt2D fixedPt)//缩放
{
  Matrix3x3 matScale;
  Matrix3x3SetIdentity(matScale);
  matScale[0][0] = sx;
  matScale[0][2] = (1 - sx) * fixedPt.x;
  matScale[1][1] = sy;
  matScale[1][2] = (1 - sy) * fixedPt.y;
  Matrix3x3PreMultiply(matScale, matComposite);
}
void TransformVerts2D(GLint nVerts, wcPt2D* verts)//平移
{
  GLint k;
  GLfloat temp;
  for (k = 0; k < nVerts; k++)
  {
    temp = matComposite[0][0] * verts[k].x +
      matComposite[0][1] * verts[k].y +
      matComposite[0][2];
    verts[k].y = matComposite[1][0] * verts[k].x +
      matComposite[1][1] * verts[k].y +
      matComposite[1][2];
    verts[k].x = temp;
  }
}
void Trangle(wcPt2D* verts)
{
  GLint k;
  glBegin(GL_TRIANGLES);
  for (k = 0; k < 3; k++)
  {
    glVertex2f(verts[k].x, verts[k].y);
  }
  glEnd();
}
void WinReshapFcn(GLint newWidth, GLint newHeight)
{
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(xwcMin, xwcMax, ywcMin, ywcMax);
  glClear(GL_COLOR_BUFFER_BIT);
}
void DisplayFcn()
{
  GLint nVerts = 3;
  wcPt2D verts[3] = { {50,25},{150,25 },{100,100} };
  wcPt2D centroidPt;
  GLint k, xSum = 0, ySum = 0;
  for (size_t k = 0; k < nVerts; k++)
  {
    xSum += verts[k].x;
    ySum += verts[k].y;
  }
  centroidPt.x = GLfloat(xSum) / GLfloat(nVerts);
  centroidPt.y = GLfloat(ySum) / GLfloat(nVerts);
  wcPt2D pivPt, fixedPt;
  pivPt = centroidPt;
  fixedPt = centroidPt;
  GLfloat tx = 0, ty = 100;
  GLfloat sx = 0.5, sy = 0.5;
  GLdouble theta = pi / 2;
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(0, 0, 1);
  Trangle(verts);
  Matrix3x3SetIdentity(matComposite);
  Scale2D(sx, sy, fixedPt);
  Translate2D(tx, ty);
  TransformVerts2D(nVerts, verts);
  glColor3f(1, 0, 0);
  Trangle(verts);
  glFlush();
}
void draw_pixel(int ix, int iy)
{
  glBegin(GL_POINTS);
  glVertex2i(ix, iy);
  glEnd();
}
void myinit()
{
  glClearColor(1.0, 0.8, 1.0, 1.0);
  glColor3f(0.0, 0.5, 0.5);
  glPointSize(1.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(0.0, 1000.0, 0.0, 1000.0);
}
int main(int argc, char** argv)
{
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
  glutInitWindowSize(600, 500);
  glutInitWindowPosition(150.0, 150.0);
  glutCreateWindow("图像比例变换");
  glutDisplayFunc(DisplayFcn);
  glutReshapeFunc(WinReshapFcn);
  myinit();
  glutMainLoop();
}

运行结果:


🌍2.4 研究体会

  1. 实验内容完成: 通过本次实验,我成功地完成了图像平移、旋转、对称和比例缩放等变换操作。为了提高图像显示效果的清晰度,我在旋转、对称和缩放变换中添加了平移操作,以避免变换后的图像与原图重叠。这使我对图像变换操作有了深入的理解和实际操作经验。
  2. 自学与应用场景差距: 通过构造几何图像并进行变换操作,我意识到在实际应用场景中,通常是对给定的图像进行变换操作,而不是自己构造图像。虽然我在Python中对图像操作较为熟悉,但在C++中感觉到需要从头编写并控制每个功能。尽管这样的学习方式较为理想,但在实际应用中可能需要更多的库函数支持。
  3. 学习过程中的挑战和成就感: 实验中我花费了较多时间在图像生成的控制上,包括输出面板底色、图像初始位置和输出框大小等方面。由于之前主要在Dev-C++平台编程,初次使用Visual Studio 2022平台感到不太顺手,但通过自学和网上查找资料逐渐适应。最终看到运行结果时,感受到了付出的回报,同时也认识到在学习过程中需要保持耐心和专注。这次实验使我更加深入地了解了图形学,也激发了我对编程的热情和学习的动力。

📝总结

图形学领域宛如一片广阔而未被完全探索的创意海洋,邀请你勇敢踏足数字艺术和计算机图形学的神秘领域。这是一场富有创意和技术挑战的学习之旅,从基础概念到算法实现,逐步揭示更深层次的图形分析、渲染技术和智能图形识别的奥秘。

目录
相关文章
|
消息中间件 设计模式 Java
Spring 四种方式教你异步接口返回结果
Spring 四种方式教你异步接口返回结果
Spring 四种方式教你异步接口返回结果
|
存储 自然语言处理 算法
RAG系统文本分块优化指南:9种实用策略让检索精度翻倍
本文深入探讨了RAG系统中的九种文本分块策略。固定大小分块简单高效,但可能破坏语义完整性;基于句子和语义的分块保留上下文,适合语义任务;递归与滑动窗口分块灵活控制大小;层次化和主题分块适用于结构化内容;特定模态分块处理多媒体文档;智能代理分块则通过大语言模型实现动态优化。开发者需根据文档类型、需求及资源选择合适策略,以提升RAG系统的性能和用户体验。作者Cornellius Yudha Wijaya详细分析了各策略的技术特点与应用场景。
2882 1
RAG系统文本分块优化指南:9种实用策略让检索精度翻倍
|
缓存 Java API
Spring WebFlux 2025 实操指南详解高性能非阻塞 API 开发全流程核心技巧
本指南基于Spring WebFlux 2025最新技术栈,详解如何构建高性能非阻塞API。涵盖环境搭建、响应式数据访问、注解与函数式两种API开发模式、响应式客户端使用、测试方法及性能优化技巧,助你掌握Spring WebFlux全流程开发核心实践。
1890 0
|
人工智能 前端开发 Java
Spring AI Alibaba + 通义千问,开发AI应用如此简单!!!
本文介绍了如何使用Spring AI Alibaba开发一个简单的AI对话应用。通过引入`spring-ai-alibaba-starter`依赖和配置API密钥,结合Spring Boot项目,只需几行代码即可实现与AI模型的交互。具体步骤包括创建Spring Boot项目、编写Controller处理对话请求以及前端页面展示对话内容。此外,文章还介绍了如何通过添加对话记忆功能,使AI能够理解上下文并进行连贯对话。最后,总结了Spring AI为Java开发者带来的便利,简化了AI应用的开发流程。
12078 2
Spring AI Alibaba + 通义千问,开发AI应用如此简单!!!
|
机器学习/深度学习 传感器 数据采集
深度学习之设备异常检测与预测性维护
基于深度学习的设备异常检测与预测性维护是一项利用深度学习技术分析设备运行数据,实时检测设备运行过程中的异常情况,并预测未来可能的故障,以便提前进行维护,防止意外停机和生产中断。
1426 1
|
Docker 容器
GitLab Runner注册大揭秘:高效CI/CD的入门指南
GitLab Runner注册大揭秘:高效CI/CD的入门指南
1190 0
GitLab Runner注册大揭秘:高效CI/CD的入门指南
|
运维 前端开发 API
运维,如何快速查找后端的接口
运维,如何快速查找后端的接口
|
机器学习/深度学习 人机交互 API
【机器学习】Whisper:开源语音转文本(speech-to-text)大模型实战
【机器学习】Whisper:开源语音转文本(speech-to-text)大模型实战
7110 0
|
Web App开发 缓存 JavaScript
Windows下的Node.js安装与环境变量配置
Windows下的Node.js安装与环境变量配置
5950 1