Skip to content

Commit

Permalink
Merge pull request #37 from luxonis/gen2_camera_orientation
Browse files Browse the repository at this point in the history
Color/MonoCamera: add API to configure image orientation
  • Loading branch information
alex-luxonis committed Jan 11, 2021
2 parents a269e39 + 15cbd6d commit e1f3b68
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "70d5310805cee5ac3ff90d1fd2f4b617122a225b")
set(DEPTHAI_DEVICE_SIDE_COMMIT "d55d55a15e273298bb94006c6b7bc1a4b31a10a2")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
6 changes: 6 additions & 0 deletions include/depthai/pipeline/node/ColorCamera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ class ColorCamera : public Node {
// Get which color camera to use
[[deprecated("Use 'setBoardSocket()' instead")]] int64_t getCamId() const;

// Set camera image orientation
void setImageOrientation(CameraImageOrientation imageOrientation);

// Get camera image orientation
CameraImageOrientation getImageOrientation() const;

// setColorOrder - RGB or BGR
void setColorOrder(ColorCameraProperties::ColorOrder colorOrder);

Expand Down
6 changes: 6 additions & 0 deletions include/depthai/pipeline/node/MonoCamera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class MonoCamera : public Node {
// Get which mono camera to use
[[deprecated("Use 'getBoardSocket()' instead.")]] int64_t getCamId() const;

// Set camera image orientation
void setImageOrientation(CameraImageOrientation imageOrientation);

// Get camera image orientation
CameraImageOrientation getImageOrientation() const;

void setResolution(MonoCameraProperties::SensorResolution resolution);
MonoCameraProperties::SensorResolution getResolution() const;

Expand Down
12 changes: 12 additions & 0 deletions src/pipeline/node/ColorCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace node {

ColorCamera::ColorCamera(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId) : Node(par, nodeId) {
properties.boardSocket = CameraBoardSocket::AUTO;
properties.imageOrientation = CameraImageOrientation::AUTO;
properties.colorOrder = ColorCameraProperties::ColorOrder::BGR;
properties.interleaved = true;
properties.previewHeight = 300;
Expand Down Expand Up @@ -72,6 +73,17 @@ int64_t ColorCamera::getCamId() const {
return (int64_t)properties.boardSocket;
}

// Set camera image orientation
void ColorCamera::setImageOrientation(CameraImageOrientation imageOrientation) {
properties.imageOrientation = imageOrientation;
}

// Get camera image orientation
CameraImageOrientation ColorCamera::getImageOrientation() const {
// TODO: in case of AUTO, see if possible to return actual value determined by device?
return properties.imageOrientation;
}

// setColorOrder - RGB or BGR
void ColorCamera::setColorOrder(ColorCameraProperties::ColorOrder colorOrder) {
properties.colorOrder = colorOrder;
Expand Down
11 changes: 11 additions & 0 deletions src/pipeline/node/MonoCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ int64_t MonoCamera::getCamId() const {
return (int64_t)properties.boardSocket;
}

// Set camera image orientation
void MonoCamera::setImageOrientation(CameraImageOrientation imageOrientation) {
properties.imageOrientation = imageOrientation;
}

// Get camera image orientation
CameraImageOrientation MonoCamera::getImageOrientation() const {
// TODO: in case of AUTO, see if possible to return actual value determined by device?
return properties.imageOrientation;
}

void MonoCamera::setResolution(MonoCameraProperties::SensorResolution resolution) {
properties.resolution = resolution;
}
Expand Down

0 comments on commit e1f3b68

Please sign in to comment.