Commit 45298370 authored by gllm's avatar gllm
Browse files

Merge branch...

Merge branch '38-example_client-restaurer-la-possibilite-d-afficher-un-modele-pour-faciliter-la-calib-avec-le-world' of ssh://gitlab.artificiel.org:30001/ofxaddons/ofxCloudLib into 38-example_client-restaurer-la-possibilite-d-afficher-un-modele-pour-faciliter-la-calib-avec-le-world
parents dff406dc fa9b1ba6
<?xml version="1.0"?>
<client_parameters>
<_i__display_images>1</_i__display_images>
<____draw_render>1</____draw_render>
<_d__draw_ruler>1</_d__draw_ruler>
<_x__display_rejected>1</_x__display_rejected>
<_g__display_gui>1</_g__display_gui>
<_o__enable_ortho>1</_o__enable_ortho>
<target_num_points>10000</target_num_points>
<voxel_resolution>0.005</voxel_resolution>
<enflure>1</enflure>
<cloud_color>255, 255, 0, 255</cloud_color>
<cloud_calibration>
<cloud_offset>0, 0, 0</cloud_offset>
<cloud_rotation>0, 0, 0</cloud_rotation>
</cloud_calibration>
<world_calibration>
<world_offset>0, 0, 0</world_offset>
<world_rotation>0, 0, 0</world_rotation>
<world_scale>1</world_scale>
</world_calibration>
<CloudCropper>
<perform_crop>1</perform_crop>
<crop_dimensions>10, 10, 10</crop_dimensions>
</CloudCropper>
<Outliers_Filter>
<minimum_points>2</minimum_points>
<search_radius>0.5</search_radius>
</Outliers_Filter>
<nom>n4</nom>
<gasacolu>
<gamma>1</gamma>
<saturation>1</saturation>
<contraste>1</contraste>
<luminance>1</luminance>
</gasacolu>
</client_parameters>
<?xml version="1.0"?>
<client_parameters>
<_i__display_images>1</_i__display_images>
<____draw_render>1</____draw_render>
<_d__draw_ruler>1</_d__draw_ruler>
<_x__display_rejected>1</_x__display_rejected>
<_g__display_gui>1</_g__display_gui>
<_o__enable_ortho>1</_o__enable_ortho>
<target_num_points>10000</target_num_points>
<voxel_resolution>0.005</voxel_resolution>
<enflure>1</enflure>
<cloud_color>255, 255, 0, 255</cloud_color>
<cloud_calibration>
<cloud_offset>-3.64015, 2.29488, 2.60725</cloud_offset>
<cloud_rotation>70.3582, -7.89046, -55.2145</cloud_rotation>
</cloud_calibration>
<world_calibration>
<world_offset>0, 0, 0</world_offset>
<world_rotation>0, 0, 0</world_rotation>
<world_scale>1</world_scale>
</world_calibration>
<CloudCropper>
<perform_crop>1</perform_crop>
<crop_dimensions>7.24073, 10, 10</crop_dimensions>
</CloudCropper>
<Outliers_Filter>
<minimum_points>2</minimum_points>
<search_radius>0.5</search_radius>
</Outliers_Filter>
<nom>n4</nom>
<gasacolu>
<gamma>1</gamma>
<saturation>1</saturation>
<contraste>1</contraste>
<luminance>1</luminance>
</gasacolu>
</client_parameters>
<?xml version="1.0"?>
<client_parameters>
<_i__display_images>1</_i__display_images>
<____draw_render>1</____draw_render>
<_d__draw_ruler>1</_d__draw_ruler>
<_x__display_rejected>1</_x__display_rejected>
<_g__display_gui>1</_g__display_gui>
<_o__enable_ortho>1</_o__enable_ortho>
<target_num_points>10000</target_num_points>
<voxel_resolution>0.005</voxel_resolution>
<enflure>1</enflure>
<cloud_color>255, 255, 0, 255</cloud_color>
<cloud_calibration>
<cloud_offset>0, 0, 0</cloud_offset>
<cloud_rotation>0, 0, 0</cloud_rotation>
</cloud_calibration>
<world_calibration>
<world_offset>0, 0, 0</world_offset>
<world_rotation>0, 0, 0</world_rotation>
<world_scale>1</world_scale>
</world_calibration>
<CloudCropper>
<perform_crop>1</perform_crop>
<crop_dimensions>10, 10, 10</crop_dimensions>
</CloudCropper>
<Outliers_Filter>
<minimum_points>2</minimum_points>
<search_radius>0.5</search_radius>
</Outliers_Filter>
<nom>n5</nom>
<gasacolu>
<gamma>1</gamma>
<saturation>1</saturation>
<contraste>1</contraste>
<luminance>1</luminance>
</gasacolu>
</client_parameters>
<?xml version="1.0"?>
<client_parameters>
<_i__display_images>1</_i__display_images>
<____draw_render>1</____draw_render>
<_d__draw_ruler>1</_d__draw_ruler>
<_x__display_rejected>1</_x__display_rejected>
<_g__display_gui>1</_g__display_gui>
<_o__enable_ortho>1</_o__enable_ortho>
<target_num_points>10000</target_num_points>
<voxel_resolution>0.005</voxel_resolution>
<enflure>1</enflure>
<cloud_color>255, 255, 0, 255</cloud_color>
<cloud_calibration>
<cloud_offset>-0.516452, 0, 2.81549</cloud_offset>
<cloud_rotation>30.0625, 43.182, -1.79924</cloud_rotation>
</cloud_calibration>
<world_calibration>
<world_offset>0, 0, 0</world_offset>
<world_rotation>0, 0, 0</world_rotation>
<world_scale>1</world_scale>
</world_calibration>
<CloudCropper>
<perform_crop>1</perform_crop>
<crop_dimensions>10, 10, 10</crop_dimensions>
</CloudCropper>
<Outliers_Filter>
<minimum_points>2</minimum_points>
<search_radius>0.5</search_radius>
</Outliers_Filter>
<nom>n5</nom>
<gasacolu>
<gamma>1</gamma>
<saturation>1</saturation>
<contraste>1</contraste>
<luminance>1</luminance>
</gasacolu>
</client_parameters>
......@@ -554,7 +554,7 @@ void ofApp::update_pointcloud()
*/
filtered_mesh_.clear();
if (cloud_final_->size() > 1) {
// if (cloud_final_->size() > 1) {
for (size_t i = 1; i < cloud_final_->size(); i++) {
filtered_mesh_.addVertex(ofVec3f(cloud_final_->points[i].x, cloud_final_->points[i].y, cloud_final_->points[i].z));
......
#ifndef Calibration_h
#define Calibration_h
#include "ofMain.h"
class Marqueur {
public:
Marqueur(size_t id, glm::vec3 position, glm::vec3 dimension) {
position_=position;
dimension_=dimension;
id_=id;
}
void draw() {
ofPushStyle();
ofPushMatrix();
ofDrawBox(position_, dimension_.x, dimension_.y, dimension_.z);
ofTranslate(position_);
ofDrawBitmapString("M"+ofToString(id_),0,0);
ofPopMatrix();
ofPopStyle();
}
glm::vec3 position_;
glm::vec3 dimension_;
size_t id_;
};
class Calibration {
public:
Calibration () {};
void setup(std::string json_path) {
ofFile file(json_path);
if(file.exists()){
file >> js_;
for(auto & marqueur: js_["marqueurs"]){
marqueurs_.push_back(make_unique<Marqueur>(marqueur["id"],
glm::vec3(marqueur["position"][0], marqueur["position"][1], marqueur["position"][2]),
glm::vec3(marqueur["dimension"][0],marqueur["dimension"][1],marqueur["dimension"][2])));
}
return true;
} else {
std::cout << "Calibration: configuration non-existante: " << json_path << std::endl;
return false;
}
}
void draw() {
for (const auto & marqueur: marqueurs_) {
marqueur->draw();
}
}
std::vector<std::unique_ptr<Marqueur>> marqueurs_;
ofJson js_;
};
#endif /* Calibration_h */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment