Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mvrilo/cam
cam is a package for Go that provides a high level api (similar to net/http) and a small set of plugins for working with camera frames.
https://github.com/mvrilo/cam
cam camera camera-frames computer-vision computervision go gocv golang opencv video webcam
Last synced: 2 days ago
JSON representation
cam is a package for Go that provides a high level api (similar to net/http) and a small set of plugins for working with camera frames.
- Host: GitHub
- URL: https://github.com/mvrilo/cam
- Owner: mvrilo
- License: mit
- Created: 2020-07-29T12:17:44.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-12T10:12:32.000Z (almost 4 years ago)
- Last Synced: 2024-06-20T14:03:37.039Z (3 months ago)
- Topics: cam, camera, camera-frames, computer-vision, computervision, go, gocv, golang, opencv, video, webcam
- Language: Go
- Homepage:
- Size: 176 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cam
[![GoDoc](https://godoc.org/github.com/mvrilo/cam?status.svg)](https://godoc.org/github.com/mvrilo/cam)
[![Go Report Card](https://goreportcard.com/badge/github.com/mvrilo/cam)](https://goreportcard.com/report/github.com/mvrilo/cam)`cam` is a package for Go that provides a high level api (similar to `net/http`) and a small set of plugins for working with camera frames. For the device communication, implementing the `Device interface`, we use [GoCV](https://gocv.io/) and [OpenCV](https://opencv.org/), more can be easily added. Contributions are welcomed.
## Dependencies
- For the `gocv` device implementation you will only need [OpenCV](https://docs.opencv.org/4.4.0/) installed. You can see instructions for installation on [the opencv docs](https://docs.opencv.org/4.4.0/df/d65/tutorial_table_of_content_introduction.html) and [in the GoCV page](https://gocv.io/getting-started/).
## Installation
```
go get github.com/mvrilo/cam
```## Example
```go
package mainimport (
"image"
"image/color"
"log""github.com/mvrilo/cam"
"github.com/mvrilo/cam/middlewares/pixelize"
"github.com/mvrilo/cam/middlewares/window"
"gocv.io/x/gocv"_ "github.com/mvrilo/cam/gocv"
)func main() {
cam.Use(pixelize.New(32))
cam.Handle(func(f cam.Frame) {
text := "hello world"
blue := color.RGBA{0, 0, 255, 0}
data, ok := f.Data().(gocv.Mat)
if !ok {
return
}
gocv.PutText(&data, text, image.Pt(200, 200), gocv.FontHersheyPlain, 10, blue, 8)
})
cam.Use(window.New("cam example"))
log.Fatal(cam.ListenAndServe(0, nil))
}
```![hello world](assets/example.png)
## Author
Murilo Santana <>