gocv

package
v0.0.0-...-4dafad4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

README

Go OpenCV (GOlang openCV)

Wrap the core types in OpenCV.

Supporting Types and Examples

OpenCV C++ Go OpenCV Constructor
cv::Point2i GcvPoint2i NewGcvPoint2i(x, y int)
cv::Point2f GcvPoint2f32_ NewGcvPoint2f32(x, y float64)
cv::Point2d GcvPoint2f64_ NewGcvPoint2f64(x, y float64)
cv::Point3i GcvPoint3i NewGcvPoint3i(x, y, z int)
cv::Point3f GcvPoint3f32_ NewGcvPoint3f32(x, y, z float64)
cv::Point3d GcvPoint3f64_ NewGcvPoint3f64(x, y, z float64)
cv::Size2i GcvSize2i NewGcvSize2i(x, y int)
cv::Size2f GcvSize2f32_ NewGcvSize2f64(x, y float64)
cv::Size2d GcvSize2f64_ NewGcvSize2f64(x, y float64)

Note for Renamed Types

Some of the types are renamed to *_. The reason is that we'd like to wrap a better interface for them.
For example, the original NewGcvPoint2f32 takes strictly two float32, and we are not able to pass float64 or int, which doesn't make too much sense.
After wrapping an extra level, we are now able to pass int, float32, and float64 to these methods.
Also note that renaming doesn't affect any usage, except you are manipulating the types yourself.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GcvCalibrateCamera

func GcvCalibrateCamera(objPts, imgPts, camMat, distCoeffs *mat64.Dense,
	dims [2]int, flags int) (calCamMat, rvec, tvec *mat64.Dense)

func GcvInitCameraMatrix2D

func GcvInitCameraMatrix2D(objPts, imgPts *mat64.Dense, dims [2]int,
	aspectRatio float64) (camMat *mat64.Dense)

GcvInitCameraMatrix2D takes one 3-by-N matrix and one 2-by-N Matrix as input. Each column in the input matrix represents a point in real world (objPts) or in image (imgPts). Return: the camera matrix.

func GcvMatToMat64

func GcvMatToMat64(mat GcvMat) *mat64.Dense

Convert Mat, which defined by SWIG, to *mat64.Dense. The reason is the latter is much easier to handle in Go. GcvMat is assumed to be 2-dimensional matrix.

func GcvRodrigues

func GcvRodrigues(src *mat64.Dense) (dst *mat64.Dense)

GcvRodrigues takes a 3D column vector, and apply cv::Rodrigues to it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL