Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 0 additions & 160 deletions host/core/depth/depth_packet.hpp

This file was deleted.

42 changes: 2 additions & 40 deletions host/core/disparity_stream_post_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,22 @@


DisparityStreamPostProcessor::DisparityStreamPostProcessor(
bool produce_d_color,
bool produce_d_mm
bool produce_d_color
)
: _produce_depth_color(produce_d_color)
, _produce_depth_mm(produce_d_mm)
{
// TODO: remove hardcode
_lut_disp_to_depth_mm = generateLUTDisparityToDepthMM(1280, 69.0f, 0.035f);
}

std::vector<uint16_t> DisparityStreamPostProcessor::getLutDisparityToMillimeters() const
{
return _lut_disp_to_depth_mm;
}



void DisparityStreamPostProcessor::onNewData(
const StreamInfo &data_info,
const StreamData &data
)
{
assert(data_info.name == c_stream_in);

if (_produce_depth_mm)
{
prepareDepthMMAndNotifyObservers(data_info, data);
}

if (_produce_depth_color)
{
prepareDepthColorAndNotifyObservers(data_info, data);
Expand Down Expand Up @@ -67,29 +55,3 @@ void DisparityStreamPostProcessor::prepareDepthColorAndNotifyObservers(

notifyObservers(depth_si, depth_d);
}


void DisparityStreamPostProcessor::prepareDepthMMAndNotifyObservers(
const StreamInfo &data_info,
const StreamData &data
)
{
// TODO: remove hardcode
StreamInfo depth_si(c_stream_out_mm.c_str(), 720*1280*2, { 720, 1280}, 2);

std::vector<uint16_t> depth_raw(depth_si.size);
const unsigned char* disp_uc = (const unsigned char*) data.data;

for (int i = 0; i < data.size; ++i)
{
const unsigned char &disp = *(disp_uc + i);
depth_raw[i] = _lut_disp_to_depth_mm[disp];
}

StreamData depth_d;
depth_d.packet_number = data.packet_number;
depth_d.data = depth_raw.data();
depth_d.size = depth_raw.size();

notifyObservers(depth_si, depth_d);
}
17 changes: 1 addition & 16 deletions host/core/disparity_stream_post_processor.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

// This file is created as temporary solution for calculation
// of distance data from disparity

#include <vector>

Expand All @@ -16,10 +14,7 @@ class DisparityStreamPostProcessor
, public DataObserver<StreamInfo, StreamData>
{
public:
DisparityStreamPostProcessor(bool produce_d_color, bool produce_d_mm);

std::vector<uint16_t> getLutDisparityToMillimeters() const;

DisparityStreamPostProcessor(bool produce_d_color);

protected:
// class DataObserver
Expand All @@ -29,18 +24,8 @@ class DisparityStreamPostProcessor
private:
const std::string c_stream_in = "disparity";
const std::string c_stream_out_color = "depth_color_h";
const std::string c_stream_out_mm = "depth_mm_h";

const bool _produce_depth_color = false;
const bool _produce_depth_mm = false;


std::vector<uint16_t> _lut_disp_to_depth_mm;

std::vector<uint16_t> generateDispToDepthMM(
unsigned width, float fov, float base_line_dist) const;


void prepareDepthColorAndNotifyObservers(const StreamInfo &data_info, const StreamData &data);
void prepareDepthMMAndNotifyObservers(const StreamInfo &data_info, const StreamData &data);
};
45 changes: 0 additions & 45 deletions host/core/float16_to_float32_converter.hpp

This file was deleted.

55 changes: 0 additions & 55 deletions host/core/landmarks_parser.hpp

This file was deleted.

Loading