Skip to content

Commit 9c3dbf8

Browse files
Signature of getParams(...) method changed
1 parent 7cb6147 commit 9c3dbf8

File tree

7 files changed

+18
-15
lines changed

7 files changed

+18
-15
lines changed
277 KB
Binary file not shown.

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# **ObjectDetector interface C++ library**
66

7-
**v1.4.0**
7+
**v1.5.0**
88

99

1010

@@ -62,6 +62,7 @@
6262
| 1.2.0 | 22.08.2023 | - Added new setMask method. |
6363
| 1.3.0 | 12.09.2023 | - Changed params serialization method. |
6464
| 1.4.0 | 24.09.2023 | - Updated encode(...) and decode(...) methods of ObjectDetectorParams.<br />- Added decodeAndExecuteCommand(...) method.<br />- Added example of object detector implementation. |
65+
| 1.5.0 | 26.09.2023 | - Signature of getParams(...) method changed. |
6566

6667

6768

@@ -120,7 +121,7 @@ public:
120121
virtual float getParam(ObjectDetectorParam id) = 0;
121122

122123
/// Get object detector params structure.
123-
virtual ObjectDetectorParams getParams() = 0;
124+
virtual void getParams(ObjectDetectorParams& params) = 0;
124125

125126
/// Get list of objects.
126127
virtual std::vector<Object> getObjects() = 0;
@@ -232,10 +233,12 @@ virtual float getParam(ObjectDetectorParam id) = 0;
232233
**getParams(...)** method returns object detector params class object as well a list of detected objects. The particular implementation of the object detector must provide thread-safe **getParams(...)** method call. This means that the **getParams(...)** method can be safely called from any thread. Method declaration:
233234
234235
```cpp
235-
virtual ObjectDetectorParams getParams() = 0;
236+
virtual void getParams(ObjectDetectorParams& params) = 0;
236237
```
237238

238-
**Returns:** object detector parameters structure (see [**ObjectDetectorParams class**](#ObjectDetectorParams-class-description) description).
239+
| Parameter | Description |
240+
| --------- | ---------------------------------------------------- |
241+
| params | Object detector params object (ObjectDetectorParams) |
239242

240243

241244

@@ -320,7 +323,7 @@ static void encodeSetParamCommand(uint8_t* data, int& size, ObjectDetectorParam
320323
| ---- | ----- | -------------------------------------------------- |
321324
| 0 | 0x01 | SET_PARAM command header value. |
322325
| 1 | 0x01 | Major version of ObjectDetector class. |
323-
| 2 | 0x04 | Minor version of ObjectDetector class. |
326+
| 2 | 0x05 | Minor version of ObjectDetector class. |
324327
| 3 | id | Parameter ID **int32_t** in Little-endian format. |
325328
| 4 | id | Parameter ID **int32_t** in Little-endian format. |
326329
| 5 | id | Parameter ID **int32_t** in Little-endian format. |
@@ -365,7 +368,7 @@ static void encodeCommand(uint8_t* data, int& size, ObjectDetectorCommand id);
365368
| ---- | ----- | ----------------------------------------------- |
366369
| 0 | 0x00 | COMMAND header value. |
367370
| 1 | 0x01 | Major version of ObjectDetector class. |
368-
| 2 | 0x04 | Minor version of ObjectDetector class. |
371+
| 2 | 0x05 | Minor version of ObjectDetector class. |
369372
| 3 | id | Command ID **int32_t** in Little-endian format. |
370373
| 4 | id | Command ID **int32_t** in Little-endian format. |
371374
| 5 | id | Command ID **int32_t** in Little-endian format. |
@@ -1119,7 +1122,7 @@ public:
11191122
float getParam(ObjectDetectorParam id);
11201123

11211124
/// Get object detector params structure.
1122-
ObjectDetectorParams getParams();
1125+
void getParams(ObjectDetectorParams& params);
11231126

11241127
/// Get list of objects.
11251128
std::vector<Object> getObjects();

example/CustomObjectDetector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ float cr::detector::CustomObjectDetector::getParam(ObjectDetectorParam id)
259259

260260

261261

262-
cr::detector::ObjectDetectorParams cr::detector::CustomObjectDetector::getParams()
262+
void cr::detector::CustomObjectDetector::getParams(cr::detector::ObjectDetectorParams& params)
263263
{
264-
return m_params;
264+
params = m_params;
265265
}
266266

267267

example/CustomObjectDetector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class CustomObjectDetector: public ObjectDetector
3131
float getParam(ObjectDetectorParam id);
3232

3333
/// Get object detector params structure.
34-
ObjectDetectorParams getParams();
34+
void getParams(ObjectDetectorParams& params);
3535

3636
/// Get list of objects.
3737
std::vector<Object> getObjects();

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.13)
66
## LIBRARY-PROJECT
77
## name and version
88
###############################################################################
9-
project(ObjectDetector VERSION 1.4.0 LANGUAGES CXX)
9+
project(ObjectDetector VERSION 1.5.0 LANGUAGES CXX)
1010

1111

1212

src/ObjectDetector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,9 @@ class ObjectDetector
321321

322322
/**
323323
* @brief Get object detector params structure.
324-
* @return Object detector params structure.
324+
* @param params Object detector params object.
325325
*/
326-
virtual ObjectDetectorParams getParams() = 0;
326+
virtual void getParams(ObjectDetectorParams& params) = 0;
327327

328328
/**
329329
* @brief Get list of objects.

src/ObjectDetectorVersion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#define OBJECT_DETECTOR_MAJOR_VERSION 1
4-
#define OBJECT_DETECTOR_MINOR_VERSION 4
4+
#define OBJECT_DETECTOR_MINOR_VERSION 5
55
#define OBJECT_DETECTOR_PATCH_VERSION 0
66

7-
#define OBJECT_DETECTOR_VERSION "1.4.0"
7+
#define OBJECT_DETECTOR_VERSION "1.5.0"

0 commit comments

Comments
 (0)