1. 程式人生 > >DLIB庫example中3d_point_cloud_ex.cpp(3D點雲)學習與實現

DLIB庫example中3d_point_cloud_ex.cpp(3D點雲)學習與實現

!免責!以下全是個人理解,新人菜鳥難免出錯,希望指正。

一、函式學習

1、perspective_window::overlay_dot

(類,繼承自drawable_window, noncopyable)perspective_window:
This is a simple window that is just a container for a perspective_display. It exists to make it easy to throw perspective_displays onto the screen without having to put together your own drawable_window objects.(這是一個簡單的視窗,它只是一個perspective_display的容器。它的存在使得很容易perspective_displays放到螢幕上,而不必將自己的drawable_window物件放在一起。)

 (類perspective_display的一個結構體在perspective_window中重新引用)overlay_dot:

This object represents a dot that is drawn on the screen.Each dot is represented by one point and a color.(此物件表示在螢幕上繪製的點。 每個點由一個點和一個顏色表示。)

2、 dlib::rand rnd;

     該物件表示偽隨機數生成器。

3、 dlib::vector<double> val(sin(i),cos(i),i/4);

       三維向量容器

4、rgb_pixel color = colormap_jet(i,0,20);

      rgb_pixel:這是一個表示RGB彩色圖形畫素的簡單結構。

     colormap_jet(i,0,20):將值對映為顏色。 特別地,我們使用噴射顏色方案,其中值<= min_value是深藍色,較大的值變為淺藍色,然後是黃色,然後當它們接近max_val時最終變為紅色。

5、 win.add_overlay(points);

  win 是 perspective_window物件 。add_overlay是perspective_window的方法

將給定的疊加點新增到此物件中,以便顯示它。

二、效果