JeVois
1.20
JeVois Smart Embedded Machine Vision Toolkit
|
|
#include <jevois/Core/PythonModule.H>
Pre-Processor interface exposed to the python side.
This wrapper is passed down to the process() function of a python post-processor, it provides a python-friendly interface to b2i(), blobsizes(), etc
Definition at line 406 of file PythonModule.H.
Public Member Functions | |
PreProcessorForPython (PreProcessor *pp) | |
Construct from an existing PreProcessor. More... | |
boost::python::tuple | imagesize () const |
Access the last processed image size. More... | |
boost::python::list | blobs () const |
Access the last computed blobs (or empty if process() has not yet been called) More... | |
boost::python::tuple | blobsize (size_t num) const |
Access the width and height of a given blob, accounting for NCHW or NHWC. More... | |
boost::python::tuple | b2i (float x, float y, size_t blobnum) |
Convert coordinates from blob back to original image. More... | |
boost::python::tuple | getUnscaledCropRect (size_t blobnum) |
Get unscaled crop rectangle in image coordinates. More... | |
boost::python::tuple | i2b (float x, float y, size_t blobnum) |
Convert coordinates from image to blob. More... | |
jevois::dnn::PreProcessorForPython::PreProcessorForPython | ( | PreProcessor * | pp | ) |
Construct from an existing PreProcessor.
Caller must ensure that pp outlives us.
Definition at line 667 of file PythonModule.C.
boost::python::tuple jevois::dnn::PreProcessorForPython::b2i | ( | float | x, |
float | y, | ||
size_t | blobnum | ||
) |
Convert coordinates from blob back to original image.
Given coords x,y should be in [0..w-1]x[0..h-1] where w,h are the blob's width and height. This is useful to convert detected boxes back into original input coordinates. Returned as a tuple (x, y).
Definition at line 687 of file PythonModule.C.
boost::python::list jevois::dnn::PreProcessorForPython::blobs | ( | ) | const |
Access the last computed blobs (or empty if process() has not yet been called)
Definition at line 676 of file PythonModule.C.
References jevois::python::pyVecToList().
boost::python::tuple jevois::dnn::PreProcessorForPython::blobsize | ( | size_t | num | ) | const |
Access the width and height of a given blob, accounting for NCHW or NHWC.
Returned as a tuple (width, height).
Definition at line 681 of file PythonModule.C.
boost::python::tuple jevois::dnn::PreProcessorForPython::getUnscaledCropRect | ( | size_t | blobnum | ) |
Get unscaled crop rectangle in image coordinates.
This is useful to display an image overlay on top of the input image. Returned as a tuple (x, y, w, h).
Definition at line 694 of file PythonModule.C.
boost::python::tuple jevois::dnn::PreProcessorForPython::i2b | ( | float | x, |
float | y, | ||
size_t | blobnum | ||
) |
Convert coordinates from image to blob.
Given coords x,y should be in [0..w-1]x[0..h-1] where w,h are the image's width and height. This is useful to convert mouse coordinates (after they have been converted from screen to image coords) to locations within an input blob.
Definition at line 700 of file PythonModule.C.
boost::python::tuple jevois::dnn::PreProcessorForPython::imagesize | ( | ) | const |
Access the last processed image size.
Returned as a tuple (width, height).
Definition at line 670 of file PythonModule.C.