@@ -24,7 +24,7 @@ namespace Ort
2424// Definition: Flattened image to blob (and normalizaed) for deep learning inference. Also reorganize from HWC to CHW.
2525// Note: Not in the header file since it is not used outside of this file.
2626template <typename T>
27- char * BlobFromImage (cv::Mat& iImg, T& iBlob) {
27+ char * BlobFromImage (const cv::Mat& iImg, T& iBlob) {
2828 int channels = iImg.channels ();
2929 int imgHeight = iImg.rows ;
3030 int imgWidth = iImg.cols ;
@@ -44,7 +44,7 @@ char* BlobFromImage(cv::Mat& iImg, T& iBlob) {
4444}
4545
4646
47- char * YOLO_V8::PreProcess (cv::Mat& iImg, std::vector<int > iImgSize, cv::Mat& oImg)
47+ char * YOLO_V8::PreProcess (const cv::Mat& iImg, std::vector<int > iImgSize, cv::Mat& oImg)
4848{
4949 if (iImg.channels () == 3 )
5050 {
@@ -169,7 +169,7 @@ const char* YOLO_V8::CreateSession(DL_INIT_PARAM& iParams) {
169169}
170170
171171
172- const char * YOLO_V8::RunSession (cv::Mat& iImg, std::vector<DL_RESULT>& oResult) {
172+ const char * YOLO_V8::RunSession (const cv::Mat& iImg, std::vector<DL_RESULT>& oResult) {
173173#ifdef benchmark
174174 clock_t starttime_1 = clock ();
175175#endif // benchmark
@@ -199,7 +199,7 @@ const char* YOLO_V8::RunSession(cv::Mat& iImg, std::vector<DL_RESULT>& oResult)
199199
200200
201201template <typename N>
202- char * YOLO_V8::TensorProcess (clock_t & starttime_1, cv::Mat& iImg, N& blob, std::vector<int64_t >& inputNodeDims,
202+ char * YOLO_V8::TensorProcess (clock_t & starttime_1, const cv::Mat& iImg, N& blob, std::vector<int64_t >& inputNodeDims,
203203 std::vector<DL_RESULT>& oResult) {
204204 Ort::Value inputTensor = Ort::Value::CreateTensor<typename std::remove_pointer<N>::type>(
205205 Ort::MemoryInfo::CreateCpu (OrtDeviceAllocator, OrtMemTypeCPU), blob, 3 * imgSize.at (0 ) * imgSize.at (1 ),
0 commit comments