Skip to content
Snippets Groups Projects
Commit ffbed97a authored by Nicolas Pope's avatar Nicolas Pope
Browse files

More warning fixes

parent 2fc1ad86
No related branches found
No related tags found
No related merge requests found
Pipeline #11205 passed
...@@ -34,7 +34,7 @@ class TextureObject { ...@@ -34,7 +34,7 @@ class TextureObject {
TextureObject(const TextureObject &t); TextureObject(const TextureObject &t);
~TextureObject(); ~TextureObject();
int pitch() const { return pitch_; } size_t pitch() const { return pitch_; }
T *devicePtr() { return ptr_; }; T *devicePtr() { return ptr_; };
__host__ __device__ T *devicePtr(int v) { return &ptr_[v*pitch2_]; } __host__ __device__ T *devicePtr(int v) { return &ptr_[v*pitch2_]; }
__host__ __device__ int width() const { return width_; } __host__ __device__ int width() const { return width_; }
...@@ -148,8 +148,8 @@ TextureObject<T>::TextureObject(size_t width, size_t height) { ...@@ -148,8 +148,8 @@ TextureObject<T>::TextureObject(size_t width, size_t height) {
cudaTextureObject_t tex = 0; cudaTextureObject_t tex = 0;
cudaCreateTextureObject(&tex, &resDesc, &texDesc, NULL); cudaCreateTextureObject(&tex, &resDesc, &texDesc, NULL);
texobj_ = tex; texobj_ = tex;
width_ = width; width_ = (int)width;
height_ = height; height_ = (int)height;
needsfree_ = true; needsfree_ = true;
pitch2_ = pitch_ / sizeof(T); pitch2_ = pitch_ / sizeof(T);
//needsdestroy_ = true; //needsdestroy_ = true;
......
...@@ -111,7 +111,7 @@ static SOCKET tcpConnect(URI &uri) { ...@@ -111,7 +111,7 @@ static SOCKET tcpConnect(URI &uri) {
// TODO(Nick) - Check all returned addresses. // TODO(Nick) - Check all returned addresses.
auto addr = addrs; auto addr = addrs;
rc = ::connect(csocket, addr->ai_addr, addr->ai_addrlen); rc = ::connect(csocket, addr->ai_addr, (socklen_t)addr->ai_addrlen);
if (rc < 0) { if (rc < 0) {
if (errno == EINPROGRESS) { if (errno == EINPROGRESS) {
......
...@@ -43,8 +43,8 @@ static vector<uint64_t> sparse_census_16x16(const Mat &arr) { ...@@ -43,8 +43,8 @@ static vector<uint64_t> sparse_census_16x16(const Mat &arr) {
result.resize(arr.cols*arr.rows, 0); result.resize(arr.cols*arr.rows, 0);
/* Loops adapted to avoid edge out-of-bounds checks */ /* Loops adapted to avoid edge out-of-bounds checks */
for (size_t v=7; v < arr.rows-7; v++) { for (int v=7; v < arr.rows-7; v++) {
for (size_t u=7; u < arr.cols-7; u++) { for (int u=7; u < arr.cols-7; u++) {
uint64_t r = 0; uint64_t r = 0;
/* 16x16 sparse kernel to 8x8 mask (64 bits) */ /* 16x16 sparse kernel to 8x8 mask (64 bits) */
......
...@@ -78,7 +78,7 @@ void Calibrate::Settings::write(FileStorage& fs) const { ...@@ -78,7 +78,7 @@ void Calibrate::Settings::write(FileStorage& fs) const {
void Calibrate::Settings::read(ftl::Configurable *node) { void Calibrate::Settings::read(ftl::Configurable *node) {
boardSize.width = node->value<vector<int>>("board_size", {10,10})[0]; boardSize.width = node->value<vector<int>>("board_size", {10,10})[0];
boardSize.height = node->value<vector<int>>("board_size", {10,10})[1]; boardSize.height = node->value<vector<int>>("board_size", {10,10})[1];
squareSize = node->value("square_size", 50); squareSize = node->value("square_size", 50.0f);
nrFrames = node->value("num_frames", 20); nrFrames = node->value("num_frames", 20);
aspectRatio = node->value("fix_aspect_ratio", false); aspectRatio = node->value("fix_aspect_ratio", false);
calibZeroTangentDist = node->value("assume_zero_tangential_distortion", false); calibZeroTangentDist = node->value("assume_zero_tangential_distortion", false);
......
...@@ -53,8 +53,8 @@ class Disparity : public ftl::Configurable { ...@@ -53,8 +53,8 @@ class Disparity : public ftl::Configurable {
protected: protected:
//nlohmann::json &config_; //nlohmann::json &config_;
size_t min_disp_; int min_disp_;
size_t max_disp_; int max_disp_;
cv::Mat mask_l_; cv::Mat mask_l_;
private: private:
......
...@@ -263,9 +263,9 @@ bool LocalSource::get(cv::Mat &l, cv::Mat &r) { ...@@ -263,9 +263,9 @@ bool LocalSource::get(cv::Mat &l, cv::Mat &r) {
} }
if (downsize_ != 1.0f) { if (downsize_ != 1.0f) {
cv::resize(l, l, cv::Size(l.cols * downsize_, l.rows * downsize_), cv::resize(l, l, cv::Size((int)(l.cols * downsize_), (int)(l.rows * downsize_)),
0, 0, cv::INTER_LINEAR); 0, 0, cv::INTER_LINEAR);
cv::resize(r, r, cv::Size(r.cols * downsize_, r.rows * downsize_), cv::resize(r, r, cv::Size((int)(r.cols * downsize_), (int)(r.rows * downsize_)),
0, 0, cv::INTER_LINEAR); 0, 0, cv::INTER_LINEAR);
} }
......
...@@ -32,8 +32,8 @@ void RGBDSource::getRGBD(cv::Mat &rgb, cv::Mat &depth) { ...@@ -32,8 +32,8 @@ void RGBDSource::getRGBD(cv::Mat &rgb, cv::Mat &depth) {
Eigen::Vector4f RGBDSource::point(uint ux, uint uy) { Eigen::Vector4f RGBDSource::point(uint ux, uint uy) {
const auto &params = getParameters(); const auto &params = getParameters();
const float x = ((float)ux-params.width/2) / params.fx; const float x = ((float)ux-params.width/2) / (float)params.fx;
const float y = ((float)uy-params.height/2) / params.fy; const float y = ((float)uy-params.height/2) / (float)params.fy;
unique_lock<mutex> lk(mutex_); unique_lock<mutex> lk(mutex_);
const float depth = depth_.at<float>(uy,ux); const float depth = depth_.at<float>(uy,ux);
...@@ -50,6 +50,7 @@ bool RGBDSource::snapshot(const std::string &fileprefix) { ...@@ -50,6 +50,7 @@ bool RGBDSource::snapshot(const std::string &fileprefix) {
cv::imwrite(fileprefix+"-RGB.jpg", rgb); cv::imwrite(fileprefix+"-RGB.jpg", rgb);
cv::imwrite(fileprefix+"-DEPTH.png",depth); cv::imwrite(fileprefix+"-DEPTH.png",depth);
return true;
} }
RGBDSource *RGBDSource::create(nlohmann::json &config, ftl::net::Universe *net) { RGBDSource *RGBDSource::create(nlohmann::json &config, ftl::net::Universe *net) {
......
...@@ -103,7 +103,7 @@ static void disparityToDepth(const cv::Mat &disparity, cv::Mat &depth, const cv: ...@@ -103,7 +103,7 @@ static void disparityToDepth(const cv::Mat &disparity, cv::Mat &depth, const cv:
cv::Vec4d homg_pt = _Q*cv::Vec4d(x, y, d, 1.0); cv::Vec4d homg_pt = _Q*cv::Vec4d(x, y, d, 1.0);
//dptr[x] = Vec3d(homg_pt.val); //dptr[x] = Vec3d(homg_pt.val);
//dptr[x] /= homg_pt[3]; //dptr[x] /= homg_pt[3];
dptr[x] = (homg_pt[2] / homg_pt[3]) / 1000.0f; // Depth in meters dptr[x] = (float)(homg_pt[2] / homg_pt[3]) / 1000.0f; // Depth in meters
if( fabs(d) <= FLT_EPSILON ) if( fabs(d) <= FLT_EPSILON )
dptr[x] = 1000.0f; dptr[x] = 1000.0f;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment