Documentation ¶
Index ¶
- func DetectMultiScale(ctx *core.Context, classifierName string, img data.Map) (data.Array, error)
- func DrawRectsToImage(img data.Map, rects data.Array) (data.Map, error)
- func MountAlphaImage(ctx *core.Context, imgName string, back data.Map, rects data.Array) (data.Map, error)
- func NewCascadeClassifier(ctx *core.Context, params data.Map) (core.SharedState, error)
- func NewSharedImage(ctx *core.Context, params data.Map) (core.SharedState, error)
- type FromDeviceCreator
- type FromURICreator
- type RawData
- type TypeImageFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectMultiScale ¶
DetectMultiScale classifies and detect image.
classifierName: cascadeClassifier state name.
img: target image as RawData map structure.
func DrawRectsToImage ¶
DrawRectsToImage draws rectangle information on target image. The image is required to structured as RawData.
func MountAlphaImage ¶
func MountAlphaImage(ctx *core.Context, imgName string, back data.Map, rects data.Array) (data.Map, error)
MountAlphaImage draw target image on back image.
func NewCascadeClassifier ¶
NewCascadeClassifier returns cascadeClassifier state.
file: cascade configuration file path for detection. e.g. "haarcascade_frontalface_default.xml".
func NewSharedImage ¶
NewSharedImage returns shared image file to reduce I/O cost.
Types ¶
type FromDeviceCreator ¶
type FromDeviceCreator struct{}
FromDeviceCreator is a creator of a capture from device.
func (*FromDeviceCreator) CreateSource ¶
func (c *FromDeviceCreator) CreateSource(ctx *core.Context, ioParams *bql.IOParams, params data.Map) (core.Source, error)
CreateSource creates a frame generator using OpenCV video capture (`VideoCapture::open`).
WITH parameters.
device_id: [required] The ID of associated device.
format: Output format style, default is "cvmat".
width: Frame width, if set empty or "0" then will be ignore.
height: Frame height, if set empty or "0" then will be ignore.
fps: Frame per second, if set empty or "0" then will be ignore.
type FromURICreator ¶
type FromURICreator struct{}
FromURICreator is a creator of a capture from URI.
func (*FromURICreator) CreateSource ¶
func (c *FromURICreator) CreateSource(ctx *core.Context, ioParams *bql.IOParams, params data.Map) (core.Source, error)
CreateSource creates a frame generator using OpenCV video capture. URI can be set HTTP address or file path.
WITH parameters.
uri: [required] A capture data's URI (e.g. /data/test.avi).
format: Output format style, default is "cvmat".
frame_skip: The number of frame skip, if set empty or "0" then read all frames. FPS is depended on the URI's file (or device).
next_frame_error: When this source cannot read a new frame, occur error or not decided by the flag. If the flag set `true` then return error. Default value is true.
rewind: If set `true` then user can use `REWIND SOURCE` query.
type RawData ¶
type RawData struct { Format TypeImageFormat Width int Height int Data []byte }
RawData is represented of `cv::Mat_<cv::Vec3b>` structure.
func ConvertMapToRawData ¶
ConvertMapToRawData returns RawData from data.Map. This function is utility method for other plug-in.
func (*RawData) ConvertToDataMap ¶
ConvertToDataMap returns data.map. This function is utility method for other plug-in.
func (*RawData) ToJpegData ¶
ToJpegData convert JPGE format image bytes.
type TypeImageFormat ¶
type TypeImageFormat int
TypeImageFormat is an ID of image format type.
const ( // TypeCVMAT is OpenCV cv::Mat_<cv::Vec3b> format TypeCVMAT TypeImageFormat // TypeCVMAT4b is OpenCV cv::Mat_<cv::Vec4b> format TypeCVMAT4b // TypeJPEG is JPEG format TypeJPEG )
func GetTypeImageFormat ¶
func GetTypeImageFormat(str string) TypeImageFormat
GetTypeImageFormat returns image format type.
func (TypeImageFormat) String ¶
func (t TypeImageFormat) String() string