Skip to content

Commit

Permalink
* updating some test code for compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan Walter committed Sep 23, 2023
1 parent 1ed8122 commit c65b4a1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Application/src/tracker/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ struct Tmp {
};

int main(int argc, char**argv) {
CommandLine cmd(argc, argv);
CommandLine::init(argc, argv);
auto&cmd = CommandLine::instance();
cmd.cd_home();

print("Sizeof transform = ", sizeof(gui::Transform));
Expand All @@ -35,8 +36,7 @@ int main(int argc, char**argv) {
SETTING(filename) = path.remove_extension("pv");

pv::File video(path, pv::FileMode::READ);
if(!video.is_open())
throw U_EXCEPTION("Cannot open video file ",path,".");
video.print_info();

file::Path settings_file(path.replace_extension("settings"));
GlobalSettings::map().set_do_print(true);
Expand Down
21 changes: 11 additions & 10 deletions Application/src/tracker/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <gui/Graph.h>
#include <misc/PixelTree.h>
#include <processing/CPULabeling.h>
#include <misc/PVBlob.h>

int main() {
using namespace gui;
Expand All @@ -16,10 +17,10 @@ int main() {
cv::circle(image.get(), Vec2(50, 50), 10, White, -1);
cv::imshow("raw", image.get());

auto blobs = CPULabeling::run_fast(image.get());
for (auto && [lines, pixels] : blobs) {
auto blob = std::make_shared<pv::Blob>(lines, pixels);
auto outlines = pixel::find_outer_points(blob, 0);
auto blobs = CPULabeling::run(image.get());
for (auto && pair : blobs) {
auto blob = std::make_shared<pv::Blob>(std::move(pair.lines), std::move(pair.pixels), pair.extra_flags, std::move(pair.pred));
auto outlines = pixel::find_outer_points(blob.get(), 0);

}

Expand All @@ -40,7 +41,7 @@ int main() {
IMGUIBase base("Test", graph, [&](){
std::lock_guard<std::recursive_mutex> lock(graph.lock());
//graph.image(Vec2(10, 10), image);
graph.circle(Vec2(100, 100), 50, Blue, Red);
graph.circle(Loc(100, 100), Radius{50}, FillClr{Blue}, LineClr{Red});

graph.section("tmp", [](DrawStructure&base, auto section) {
static Button button("test", Bounds(300, 300, 100, 35));
Expand All @@ -49,18 +50,18 @@ int main() {
//static Circle button(Vec2(300, 30), 50, Blue, Blue);
base.wrap_object(button);

static Rect rect(Bounds(), Transparent, White);
static Rect rect(Bounds(), FillClr{Transparent}, LineClr{White});
base.wrap_object(rect);
auto text = base.text("boundary_text", Vec2(50, 150));
auto text = base.text("boundary_text", Loc(50, 150));
rect.set_bounds(text->bounds());
});

graph.wrap_object(g);

static Checkbox checkbox(Vec2(50, 250), "Hi");
static Checkbox checkbox(Loc(50, 250), std::string("Hi"));
graph.wrap_object(checkbox);

auto str = DEBUG::format("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
auto str = format<FormatterType::NONE>("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
str = Meta::toStr(DurationUS{uint64_t(timer.elapsed() * 1000 * 1000)});

if(SETTING(terminate))
Expand All @@ -73,7 +74,7 @@ int main() {

base.loop();

Debug("Terminating");
print("Terminating");

return 0;
}

0 comments on commit c65b4a1

Please sign in to comment.