Plugin lcvphoto

This module contains elements for photo processing. It resembles open cv's photo module.

import lcvphoto 1.0

Summary

TypeFastNlMeansDenoisingDenoises a grayscale or color image.
TypeFastNlMeansDenoisingMultiDenoises a grayscale or color image using multiple frames.
TypeDenoiseTvl1Denoises a grayscale or color image.
TypeHueSaturationLightnessChanges the hue, saturation and lightness of an image
TypeLevelsPerforms levels adjustments on an image.
TypeAutoLevelsGiven the histogram AutoLevels will aoutmatically compute levels of an image.
TypeBrightnessAndContrastAdjust the brightness and the contrast
TypeSticherStiches a set of images toghether based on the list of matrixes and a set of parameters.
TypeAlignMTBAligns a set of input images in accordance to a list of parameters.
TypeCalibrateDebevecCalibrates the lightness of the image in regards to the exsposure the image was shot in.
TypeCalibrateRobertsonCalibrates the lightness of the image in regard to exsposure the image was shot in.
TypeMergeDebevecThe resulting HDR image is calculated as weighted average of the exposures considering exposure values and camera response.
TypeMergeRobertsonThe resulting HDR image is calculated as weighted average of the exposures considering exposure values and camera response.
TypeToneMapFirst step of transforming the image from the HDR to something that is viewable by the user
TypeTonemapDragoDrago tonemapper.
TypeTonemapMantiukMantiuk tonemapper.
TypeTonemapReinardReinard tonemapper.
TypeLevelSlidersVisual levels sliders.
TypeHueSaturationLightnessSlidersVisual sliders for hue saturation lightness.

FastNlMeansDenoising type

InheritsMatFilter
Propertybool colorAlgorithm
Propertyfloat h
Propertyfloat hColor
Propertyint templateWindowSize
Propertyint searchWindowSize

Denoises a grayscale or color image.

Performs denoising using the Non-local Means Denoising algorithm. Sample in:

samples/photo/fastnlmeansdenoising.qml

bool colorAlgorithm property

False to use fastNlMeansDenoising, true to use fastNlMeansDenoisingColored. By default, this is autodetected based on the number of channels in the source.

float h property

Parameter regulating filter strength. Defaults to 3.

float hColor property

The same as h but for color components. Defaults to 3. Only relevant when using the color algorithm (see colorAlgorithm).

int templateWindowSize property

Size in pixels of the template patch that is used to compute weights. Should be odd. Defaults to 7.

int searchWindowSize property

Size in pixels of the window that is used to compute weighted average for a given pixel. Has a large performance impact. Should be odd. Defaults to 21.

FastNlMeansDenoisingMulti type

InheritsFastNlMeansDenoising
Propertyint temporalWindowSize

Denoises a grayscale or color image using multiple frames.

Variant of FastNlMeansDenoising using a history of frames. Implemented with a sliding window, which makes it suitable for video input.

All FastNlMeansDenoising options also apply to FastNlMeansDenoisingMulti.

Usage notes for video input:

  • The algorithm is rather slow, which can be a problem for live video processing. Tweak the input framerate, searchWindowSize and temporalWindowSize as required.
  • The output will lag (temporalWindowSize - 1) / 2 frames behind the input.
  • Output will only start when the buffer is filled; expect temporalWindowSize - 1 black output frames directly after recompiling the QML.

int temporalWindowSize property

Size of the sliding window in frames. Higher values keep a longer history, which requires more memory and processing power and increases output delay. Must be an odd number. Defaults to 3.

DenoiseTvl1 type

Denoises a grayscale or color image.

Performs denoising using the primal-dual algorithm.

int bufferSize property

Number of observations or noised versions of the image to be restored.

real lambda property

As it is enlarged, the smooth (blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly speaking, as it becomes smaller, the result will be more blur but more sever outliers will be removed.

int nIters property

Number of iterations that the algorithm will run. The more iterations the better, but it is hard to quantitatively refine this statement, so just use the default and increase it if the results are poor.

HueSaturationLightness type

InheritsMatFilter
Propertyint hue
Propertyint saturation
Propertyint lightness

Changes the hue, saturation and lightness of an image

int hue property

Controls the hue

int saturation property

Controls the saturation

int lightness property

Controls the lightness

Levels type

InheritsMatFilter
Propertylightness
Propertychannels

Performs levels adjustments on an image.

lightness property

Controls the lightness overall channels

[white, contrast, black]

channels property

Recieves the channel index and lightness parameters for the image.

channel index: [white, contrast, black]

Levels{
    lightness: [10, 1.0, 255]
    channels: {
        0: [0, 1.0, 170]
    }
}

AutoLevels type

InheritsMatFilter

Given the histogram AutoLevels will aoutmatically compute levels of an image.

BrightnessAndContrast type

InheritsMatFilter
Propertydouble brightness
Propertydouble contrast

Adjust the brightness and the contrast

double brightness property

Can be any value.

double contrast property

Should be between 0 and 10.

Sticher type

InheritsMatFilter
Propertylcvcore#MatList input
PropertyObject params

Stiches a set of images toghether based on the list of matrixes and a set of parameters.

lcvcore#MatList input property

Matrix input list to the Stitcher.

Object params property

Input parameters:

  • mode : Stitcher.Panorama or Stitcher.Scans
  • tryUseGpu : true for gpu usage, false otherwise

AlignMTB type

InheritsMatFilter

Aligns a set of input images in accordance to a list of parameters.

Params:

  • int maxBits
  • int excludeRange
  • bool cut

CalibrateDebevec type

InheritsMatFilter
Propertylist input
PropertyMat output

Calibrates the lightness of the image in regards to the exsposure the image was shot in.

list input property

List of images.

{qmlProperty:list times} List of exposure times.

{qmlProperty:Object params} Calibration parameters

Params:

  • int samples
  • float lambda
  • bool random

Mat output property

Outputs single image based on calibrations

Output will contain much more data than the input.

CalibrateRobertson type

InheritsMatFilter
Propertylist input
Propertylist times
PropertyObject params
PropertyMat output

Calibrates the lightness of the image in regard to exsposure the image was shot in.

list input property

List of images.

list times property

Exposure time.

Object params property

Calibration parameters.

Params:

  • int maxIter
  • float threshold

Mat output property

Outputs single image based on calibrations.

Output will contain much more data than the input.

MergeDebevec type

Inherits

The resulting HDR image is calculated as weighted average of the exposures considering exposure values and camera response.

Merges images.

If calibrated with CalibrateDebevec, MergeDebevec must be used.

Parameters:

  • src vector of input images
  • dst result image
  • times vector of exposure time values for each image
  • response 256x1 matrix with inverse camera response function for each pixel value, it should have the same number of channels as images.

MergeRobertson type

Inherits

The resulting HDR image is calculated as weighted average of the exposures considering exposure values and camera response.

Merges images.

If calibrated with CalibrateRobertson, MergeRobertson must be used.

Parameters:

  • src vector of input images
  • dst result image
  • times vector of exposure time values for each image
  • response 256x1 matrix with inverse camera response function for each pixel value, it should have the same number of channels as images.

ToneMap type

Inherits
PropertyMat input
PropertyObject params

First step of transforming the image from the HDR to something that is viewable by the user

Mat input property

Input image,

Object params property

Conversion parameters.

TonemapDrago type

InheritsToneMap

Drago tonemapper.

Available parameters:

  • float gamma
  • float saturation
  • float bias

TonemapMantiuk type

InheritsToneMap

Mantiuk tonemapper.

Available parameters:

  • float gamma
  • float scale
  • float saturation

TonemapReinard type

InheritsToneMap

Reinard tonemapper.

Available parameters:

  • float gamma
  • float intensity
  • float lightAdapt
  • float colorAdapt

LevelSliders type

InheritsRectangle
Propertyalias input
Propertylightness
PropertylevelByChannel

Visual levels sliders.

alias input property

Input image.

lightness property

Contains the set lightness values.

levelByChannel property

Contains the set level values per channel.

HueSaturationLightnessSliders type

InheritsRectangle
Propertyalias hue
Propertyalias saturation
Propertyalias lightness

Visual sliders for hue saturation lightness.

alias hue property

Contains the hue that's controled by the slider

alias saturation property

Contains the saturation that's controled by the slider

alias lightness property

Contains the lightness that's controled by the slider