Skip to content

Commit

Permalink
That's one.
Browse files Browse the repository at this point in the history
  • Loading branch information
aleozlx committed Feb 5, 2020
1 parent 109107d commit 77ca25f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
14 changes: 7 additions & 7 deletions Analyzer/WindowAnalyzerS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool WindowAnalyzerS::Draw() {
a+=1;
}
ImGui::Text("test: %d %d %p", a, gslic_settings.spixel_size, frame_tex.data);
ImGui::Image(imSuperpixels.id(), imSuperpixels.size(), ImVec2(0,0), ImVec2(1,1), ImVec4(1.0f,1.0f,1.0f,1.0f), ImVec4(1.0f,1.0f,1.0f,0.5f));
//ImGui::Image(imSuperpixels.id(), imSuperpixels.size(), ImVec2(0,0), ImVec2(1,1), ImVec4(1.0f,1.0f,1.0f,1.0f), ImVec4(1.0f,1.0f,1.0f,0.5f));
ImGui::End();
return _is_shown;
}
Expand All @@ -52,16 +52,16 @@ IWindow* WindowAnalyzerS::Show() {
void WindowAnalyzerS::ReloadSuperpixels() {
#ifdef FEATURE_GSLICR
spt::GSLIC _superpixel(this->gslic_settings);
auto superpixel = _superpixel.Compute(this->frame);
superpixel->GetContour(this->superpixel_contour);
cv::cvtColor(this->frame, this->frame_tex, cv::COLOR_BGR2RGB);
this->frame_tex.setTo(cv::Scalar(200, 5, 240), this->superpixel_contour);
//auto superpixel = _superpixel.Compute(this->frame);
//superpixel->GetContour(this->superpixel_contour);
//cv::cvtColor(this->frame, this->frame_tex, cv::COLOR_BGR2RGB);
//this->frame_tex.setTo(cv::Scalar(200, 5, 240), this->superpixel_contour);

// Convert to texture Format
cv::cvtColor(this->frame_tex, this->frame_tex, cv::COLOR_RGB2RGBA);
//cv::cvtColor(this->frame_tex, this->frame_tex, cv::COLOR_RGB2RGBA);
#else
cv::cvtColor(this->frame, this->frame_tex, cv::COLOR_BGR2RGBA);
#endif
this->imSuperpixels.Load(this->frame_tex.data);
//this->imSuperpixels.Load(this->frame_tex.data);
}

Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ seg_engine_GPU::seg_engine_GPU(const settings& in_settings) : seg_engine(in_sett

gSLICr::engines::seg_engine_GPU::~seg_engine_GPU()
{
delete tmp_idx_img; // hate it
delete accum_map;
}

Expand Down
6 changes: 4 additions & 2 deletions include/superpixel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace spt {

virtual unsigned int GetNumSuperpixels() = 0;

virtual ~ISuperpixel() {}
virtual ~ISuperpixel() = default;
};

#ifdef FEATURE_OCVSLIC
Expand Down Expand Up @@ -54,7 +54,7 @@ namespace spt {
public:
GSLIC();

GSLIC(gSLICr::objects::settings settings);
explicit GSLIC(gSLICr::objects::settings settings);

ISuperpixel *Compute(cv::InputArray frame) override;

Expand All @@ -64,6 +64,8 @@ namespace spt {

unsigned int GetNumSuperpixels() override;

~GSLIC() override = default;

protected:
unsigned int width, height;
unsigned int actual_num_superpixels = 0;
Expand Down

1 comment on commit 77ca25f

@aleozlx
Copy link
Owner Author

@aleozlx aleozlx commented on 77ca25f Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.