-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
109 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule interface
updated
4 files
+10 −13 | proto/camera.proto | |
+9 −0 | proto/common.proto | |
+15 −4 | proto/frame.proto | |
+0 −11 | proto/inference.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "proto.h" | ||
|
||
|
||
void util::fillCvImg(cv::Mat& cvImg, const proto::Img& pbImg) { | ||
int height = pbImg.height(); | ||
int width = pbImg.width(); | ||
int channels = pbImg.channels(); | ||
void* dataPtr = const_cast<char*>(pbImg.data().c_str()); | ||
cvImg = cv::Mat(height, width, pbImg.type(), dataPtr); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include "opencv2/opencv.hpp" | ||
#include "img.h" | ||
#include "camera.pb.h" | ||
|
||
|
||
namespace util { | ||
|
||
template<typename T> | ||
void fillProtoImg(proto::Img* pbImg, const cv::Mat& cvImg, const img::Roi& roi) { | ||
pbImg->set_width(cvImg.size().width); | ||
pbImg->set_height(cvImg.size().height); | ||
pbImg->set_channels(cvImg.channels()); | ||
pbImg->set_offsetleft(roi.offsetLeft); | ||
pbImg->set_offsettop(roi.offsetTop); | ||
pbImg->set_scale(roi.scale); | ||
pbImg->set_type(cvImg.type()); | ||
pbImg->set_typestr(cv::typeToString(cvImg.type())); | ||
pbImg->set_data(cvImg.data, cvImg.size().width * cvImg.size().height * cvImg.channels() * sizeof(T)); | ||
} | ||
|
||
void fillCvImg(cv::Mat& cvImg, const proto::Img& pbImg); | ||
} |
Oops, something went wrong.