Go to the documentation of this file.
8 #include "spdlog/fmt/fmt.h"
14 Camera::Camera(
const std::shared_ptr<PipelineImpl>& par, int64_t nodeId, std::unique_ptr<Properties> props)
239 if(
data.size() <= 0) {
240 throw std::runtime_error(
"Camera | mesh data must not be empty");
244 std::string assetKey;
247 meshAsset.
data = std::vector<uint8_t>(
data.begin(),
data.end());
248 assetKey =
"warpMesh";
253 std::ifstream streamMesh(warpMesh, std::ios::binary);
254 if(!streamMesh.is_open()) {
255 throw std::runtime_error(fmt::format(
"Camera | Cannot open mesh at path: {}", warpMesh.
u8string()));
257 std::vector<std::uint8_t>
data = std::vector<std::uint8_t>(std::istreambuf_iterator<char>(streamMesh), {});
Properties & properties
Underlying properties.
std::string u8string() const
Get path in utf-8.
Camera(const std::shared_ptr< PipelineImpl > &par, int64_t nodeId)
Properties::WarpMeshSource getMeshSource() const
Gets the source of the warp mesh.
void setBoardSocket(CameraBoardSocket boardSocket)
RawCameraControl structure.
void setVideoSize(int width, int height)
Set video output size.
void setCamera(std::string name)
std::tuple< int, int > getStillSize() const
Get still size as tuple.
void setInputRefs(std::initializer_list< Input * > l)
CameraImageOrientation imageOrientation
void setImageOrientation(CameraImageOrientation imageOrientation)
Set camera image orientation.
void setIsp3aFps(int isp3aFps)
WarpMeshSource warpMeshSource
int getPreviewHeight() const
Get preview height.
AssetManager assetManager
std::vector< std::uint8_t > data
void loadMeshData(span< const std::uint8_t > warpMesh)
std::tuple< int, int > getSize() const
Get sensor resolution as size.
constexpr auto data(C &c) -> decltype(c.data())
Properties & getProperties()
tl::optional< float > calibAlpha
std::shared_ptr< RawCameraControl > rawControl
CameraBoardSocket boardSocket
RawCameraControl initialControl
Asset is identified with string key and can store arbitrary binary data.
CameraBoardSocket getBoardSocket() const
int getHeight() const
Get sensor resolution height.
int getPreviewWidth() const
Get preview width.
std::tuple< int, int > getPreviewSize() const
Get preview size as tuple.
constexpr auto size(const C &c) -> decltype(c.size())
int getStillHeight() const
Get still height.
std::shared_ptr< dai::Asset > set(Asset asset)
void setRawOutputPacked(bool packed)
int getWidth() const
Get sensor resolution width.
std::string getCamera() const
Base Properties structure.
static constexpr int AUTO
tl::optional< float > getCalibrationAlpha() const
Get calibration alpha parameter that determines FOV of undistorted frames.
void setOutputRefs(std::initializer_list< Output * > l)
void loadMeshFile(const dai::Path &warpMesh)
std::tuple< int, int > getMeshStep() const
Gets the distance between mesh points.
void setMeshSource(Properties::WarpMeshSource source)
Set the source of the warp mesh or disable.
void setCalibrationAlpha(float alpha)
Set calibration alpha parameter that determines FOV of undistorted frames.
void setMeshStep(int width, int height)
void setSize(std::tuple< int, int > size)
Set desired resolution. Sets sensor size to best fit.
int getVideoWidth() const
Get video width.
bool previewKeepAspectRatio
void setPreviewSize(int width, int height)
Set preview output size.
int getStillWidth() const
Get still width.
Represents paths on a filesystem; accepts utf-8, Windows utf-16 wchar_t, or std::filesystem::path.
CameraImageOrientation getImageOrientation() const
Get camera image orientation.
std::tuple< int, int > getVideoSize() const
Get video size as tuple.
tl::optional< bool > rawPacked
Camera node. Experimental node, for both mono and color types of sensors.
void setStillSize(int width, int height)
Set still output size.
int getVideoHeight() const
Get video height.
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:18