Spinnaker SDK C++
4.2.0.21
 
 

 
Loading...
Searching...
No Matches
Inference.cpp File Reference

Enumerations

enum  InferenceNetworkType { DETECTION , CLASSIFICATION }
 
enum  FileUploadPersistence { FLASH , DDR }
 

Functions

const std::vector< std::string > labelClassification (arrayLabelClassification, end(arrayLabelClassification))
 
const std::vector< std::string > labelDetection (arrayLabelDetection, end(arrayLabelDetection))
 
int PrintDeviceInfo (INodeMap &nodeMap)
 
bool CameraDeleteFile (INodeMap &nodeMap)
 
bool CameraOpenFile (INodeMap &nodeMap)
 
bool CameraWriteToFile (INodeMap &nodeMap)
 
bool CameraCloseFile (INodeMap &nodeMap)
 
std::vector< char > LoadFileIntoMemory (const string &filename)
 
int UploadFileToCamera (INodeMap &nodeMap, const std::string &fileSelectorEntryName, const std::string &filePath)
 
int DeleteFileOnCamera (INodeMap &nodeMap, const std::string &fileSelectorEntryName)
 
int SetChunkEnable (INodeMap &nodeMap, const gcstring &entryName, const bool enable)
 
int ConfigureChunkData (INodeMap &nodeMap)
 
int DisableChunkData (INodeMap &nodeMap)
 
int DisplayChunkData (const ImagePtr pImage)
 
int DisableTrigger (INodeMap &nodeMap)
 
int ConfigureTrigger (INodeMap &nodeMap)
 
int ConfigureInference (INodeMap &nodeMap, bool isEnabled)
 
int ConfigureTestPattern (INodeMap &nodeMap, bool isEnabled)
 
int AcquireImages (const CameraPtr &pCam, INodeMap &nodeMap, INodeMap &nodeMapTLDevice)
 
int RunSingleCamera (const CameraPtr &pCam)
 
int main (int, char **)
 

Variables

const InferenceNetworkType chosenInferenceNetworkType = CLASSIFICATION
 
const FileUploadPersistence chosenFileUploadPersistence = DDR
 
const std::string networkFilePath
 
const std::string injectedImageFilePath
 
const unsigned int injectedImageWidth = (chosenInferenceNetworkType == CLASSIFICATION ? 640 : 720)
 
const unsigned int injectedImageHeight = (chosenInferenceNetworkType == CLASSIFICATION ? 400 : 540)
 
const char * arrayLabelClassification [] = {"daisy", "dandelion", "roses", "sunflowers", "tulips"}
 
const char * arrayLabelDetection []
 

Enumeration Type Documentation

◆ FileUploadPersistence

Enumerator
FLASH 
DDR 

◆ InferenceNetworkType

Enumerator
DETECTION 

This network determines the most likely class given a set of predetermined, trained options.

Object detection can also provide a location within the image (in the form of a "bounding box" surrounding the class), and can detect multiple objects.

CLASSIFICATION 

This network determines the best option from a list of predetermined options; the camera gives a percentage that determines the likelihood of the currently perceived image being one of the classes it has been trained to recognize.

Function Documentation

◆ AcquireImages()

int AcquireImages ( const CameraPtr pCam,
INodeMap &  nodeMap,
INodeMap &  nodeMapTLDevice 
)

◆ CameraCloseFile()

bool CameraCloseFile ( INodeMap &  nodeMap)
Examples
Inference.cpp.

◆ CameraDeleteFile()

bool CameraDeleteFile ( INodeMap &  nodeMap)
Examples
Inference.cpp.

◆ CameraOpenFile()

bool CameraOpenFile ( INodeMap &  nodeMap)
Examples
Inference.cpp.

◆ CameraWriteToFile()

bool CameraWriteToFile ( INodeMap &  nodeMap)
Examples
Inference.cpp.

◆ ConfigureChunkData()

int ConfigureChunkData ( INodeMap &  nodeMap)

◆ ConfigureInference()

int ConfigureInference ( INodeMap &  nodeMap,
bool  isEnabled 
)
Examples
Inference.cpp.

◆ ConfigureTestPattern()

int ConfigureTestPattern ( INodeMap &  nodeMap,
bool  isEnabled 
)
Examples
Inference.cpp.

◆ ConfigureTrigger()

int ConfigureTrigger ( INodeMap &  nodeMap)

◆ DeleteFileOnCamera()

int DeleteFileOnCamera ( INodeMap &  nodeMap,
const std::string &  fileSelectorEntryName 
)
Examples
Inference.cpp.

◆ DisableChunkData()

int DisableChunkData ( INodeMap &  nodeMap)

◆ DisableTrigger()

int DisableTrigger ( INodeMap &  nodeMap)
Examples
Inference.cpp.

◆ DisplayChunkData()

int DisplayChunkData ( const ImagePtr  pImage)

◆ labelClassification()

const std::vector< std::string > labelClassification ( arrayLabelClassification  ,
end(arrayLabelClassification  
)
Examples
Inference.cpp.

◆ labelDetection()

const std::vector< std::string > labelDetection ( arrayLabelDetection  ,
end(arrayLabelDetection  
)
Examples
Inference.cpp.

◆ LoadFileIntoMemory()

std::vector< char > LoadFileIntoMemory ( const string &  filename)
Examples
Inference.cpp.

◆ main()

int main ( int  ,
char **   
)

◆ PrintDeviceInfo()

int PrintDeviceInfo ( INodeMap &  nodeMap)

◆ RunSingleCamera()

int RunSingleCamera ( const CameraPtr pCam)

◆ SetChunkEnable()

int SetChunkEnable ( INodeMap &  nodeMap,
const gcstring entryName,
const bool  enable 
)
Examples
Inference.cpp.

◆ UploadFileToCamera()

int UploadFileToCamera ( INodeMap &  nodeMap,
const std::string &  fileSelectorEntryName,
const std::string &  filePath 
)
Examples
Inference.cpp.

Variable Documentation

◆ arrayLabelClassification

const char* arrayLabelClassification[] = {"daisy", "dandelion", "roses", "sunflowers", "tulips"}
Examples
Inference.cpp.

◆ arrayLabelDetection

const char* arrayLabelDetection[]
Initial value:
= {"background", "aeroplane", "bicycle", "bird", "boat", "bottle",
"bus", "car", "cat", "chair", "cow", "diningtable",
"dog", "horse", "motorbike", "person", "pottedplant", "sheep",
"sofa", "train", "monitor"}
Examples
Inference.cpp.

◆ chosenFileUploadPersistence

const FileUploadPersistence chosenFileUploadPersistence = DDR
Examples
Inference.cpp.

◆ chosenInferenceNetworkType

const InferenceNetworkType chosenInferenceNetworkType = CLASSIFICATION
Examples
Inference.cpp.

◆ injectedImageFilePath

const std::string injectedImageFilePath
Initial value:
=
(chosenInferenceNetworkType == CLASSIFICATION ? "Injected_Image_Classification.raw"
: "Injected_Image_Detection.raw")
const InferenceNetworkType chosenInferenceNetworkType
Definition Inference.cpp:74
@ CLASSIFICATION
This network determines the best option from a list of predetermined options; the camera gives a perc...
Definition Inference.cpp:71
Examples
Inference.cpp.

◆ injectedImageHeight

const unsigned int injectedImageHeight = (chosenInferenceNetworkType == CLASSIFICATION ? 400 : 540)
Examples
Inference.cpp.

◆ injectedImageWidth

const unsigned int injectedImageWidth = (chosenInferenceNetworkType == CLASSIFICATION ? 640 : 720)
Examples
Inference.cpp.

◆ networkFilePath

const std::string networkFilePath
Initial value:
=
(chosenInferenceNetworkType == CLASSIFICATION ? "Network_Classification" : "Network_Detection")
Examples
Inference.cpp.