Skip to content

Fixed size of Labels output #31

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion CAPE/CAPE/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ add_executable(cape_offline
PlaneSeg.cpp
CylinderSeg.cpp
Histogram.cpp
Params.cpp write_labels.hpp)
Params.cpp
write_labels.h
write_labels.cpp)

target_link_libraries(cape_offline ${OpenCV_LIBS} ${Eigen_LIBRARIES})

Expand Down
2 changes: 1 addition & 1 deletion CAPE/CAPE/run_cape_offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <string>
#include <dirent.h>
#include <boost/algorithm/string.hpp>
#include "write_labels.hpp"
#include "write_labels.h"

using namespace std;

Expand Down
22 changes: 22 additions & 0 deletions CAPE/CAPE/write_labels.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// Created by michael on 23.07.2022.
//

#include "write_labels.h"

void writeLabelsTable(const string &path, size_t height, size_t width, cv::Mat_<uchar> &data) {
uchar *sCode;
ofstream fout(path);

for (int r = 0; r < height; r++) {
sCode = data.ptr<uchar>(r);
for (int c = 0; c < width; c++) {
fout << +(*sCode);
if (c != width - 1)
fout << ',';
sCode++;
}
fout << '\n';
}
fout.close();
}
15 changes: 15 additions & 0 deletions CAPE/CAPE/write_labels.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Created by michael on 22.07.2022.
//

#pragma once

#include <fstream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <Eigen/Dense>
#include <opencv2/opencv.hpp>

using namespace std;

void writeLabelsTable(const string &path, size_t height, size_t width, cv::Mat_<uchar> &data);
29 changes: 0 additions & 29 deletions CAPE/CAPE/write_labels.hpp

This file was deleted.