Skip to content

Commit

Permalink
Detecting wood content in laser scans. (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
edisonlee0212 authored Feb 5, 2025
1 parent 98f8606 commit 52c7daf
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 287 deletions.
1 change: 0 additions & 1 deletion EvoEngine_Plugins/LogScanning/include/LogScan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ struct LogScanProfile {
float encoder_value = 0.f;
std::vector<glm::vec2> points;
std::vector<int> brightness;
std::vector<glm::vec2> BuildBoundary(const JoeScanConfig& joe_scan_config);
};

class LogScan : public IAsset {
Expand Down
46 changes: 37 additions & 9 deletions EvoEngine_Plugins/LogScanning/include/LogScanReconstruction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,49 @@
using namespace evo_engine;
namespace log_scanning_plugin {
class LogScanReconstruction {
public:
glm::vec2 profile_center{};

glm::vec2 points_min = glm::vec2(FLT_MAX);
glm::vec2 points_max = glm::vec2(FLT_MIN);

struct ReconstructionParameter {
float boundary_outlier_percentage = 0.01f;
float tie_width_inch = 9.f;
float tie_height_inch = 7.f;
float max_split_depth_detection_inch = 2.f;
bool OnInspect(const std::shared_ptr<EditorLayer>& editor_layer);
};

struct ProcessedPoint {
glm::vec2 position = glm::vec2(0.f);
enum class Face { Top, Bottom, Left, Right };
Face face = Face::Top;
glm::vec4 color = glm::vec4(1.f);
};

std::vector<ProcessedPoint> processed_points{};

struct CellData {
int blocker_size = 0;
bool occluded = false;
enum class Type {
Invalid,
ValidTop,
ValidBottom,
ValidLeft,
ValidRight,
Skipped,
} type = Type::Invalid;
};
class ProfileGrid : public eco_sys_lab_plugin::CellGrid<CellData> {
public:
void Clear() override;

void Block(const glm::vec2& start, const glm::vec2& direction);
void AddPoint(const glm::vec2& grid_center, const ProcessedPoint& processed_point,
const ReconstructionParameter& reconstruction_parameter);
void SkipCenterRegion(const glm::vec2& grid_center, const ReconstructionParameter& reconstruction_parameter);
};
ProfileGrid profile_grid;
void Initialize(const ReconstructionParameter& reconstruction_parameter, const LogScanProfile& target_profile);

public:
glm::vec2 profile_center;
struct ReconstructionParameter {};
void Initialize(const ReconstructionParameter& reconstruction_parameter, const LogScanProfile& target_profile,
const JoeScanConfig& joe_scan_config);
void Clear();
};
} // namespace log_scanning_plugin
Loading

0 comments on commit 52c7daf

Please sign in to comment.