fisheyedewarp

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 6 Imported by: 0

README

FisheyeDewarp 🐟👁️

GoDoc Go Report Card License

FisheyeDewarp dewarps fisheye distortion in images.

Installation

Use go get to install this package:

go get github.com/dev6699/fisheyedewarp
Sample usage

Check cmd/fisheyedewarp/main.go for more details.

  • For help
./fisheyedewarp --help
Usage of ./fisheyedewarp:
  -fov float
    	Input fisheye field of view in degrees. Must be between 0 and 180. (default 180)
  -img string
    	Path to the input fisheye image file. (default "images/fisheye.jpg")
  -pfov float
    	Output perspective field of view in degrees. Must be between 0 and 180. (default 120)
  -ptype string
    	Type of projection to apply. Options: 'Linear', 'EqualArea', 'Orthographic', 'Stereographic' (default "Linear")

Examples
Image 1 Image 2
Original Fisheye Linear projection, 120 PFOV
Image 3 Image 4
Linear projection, 130 PFOV Linear projection, 140 PFOV

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dewarp

func Dewarp(img gocv.Mat, fov float64, pfov float64, projectionType ProjectionType) (*gocv.Mat, error)

Dewarp transforms a fisheye image into a perspective image based on the provided field of view (FOV) values and projection type.

  • fov (float64): The field of view of the input fisheye image in degrees. A value of 180 represents a full hemispherical fisheye image. The valid range is 0 < fov <= 180. Default value is 180 for a full hemisphere.
  • pfov (float64): The output perspective field of view in degrees. Values must be 0 < pfov < 180. The default value is 120 degrees both vertically and horizontally for a circular fisheye image and diagonally for a full frame fisheye. The pFOV relative to the input fov determines the proportional area of the fisheye image that will be transformed.

Types

type ProjectionType

type ProjectionType string

ProjectionType defines the type of projection for the dewarping operation.

const (
	Linear        ProjectionType = "Linear"
	EqualArea     ProjectionType = "EqualArea"
	Orthographic  ProjectionType = "Orthographic"
	Stereographic ProjectionType = "Stereographic"
)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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