View Source Evision.MCC.CCheckerDetector (Evision v1.0.0-rc.0)

Summary

Types

t()

Type that represents an MCC.CCheckerDetector struct.

Functions

Clears the algorithm state

Returns the implementation of the CCheckerDetector.

Set the net which will be used to find the approximate bounding boxes for the color charts. And returns the implementation of the CCheckerDetector.

Draws the checker to the given image.

Draws the checker to the given image.

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read

Get the best color checker. By the best it means the one detected with the highest confidence.

getColorChartType

getDetectionParams

Get the list of all detected colorcheckers

Gets the reference color for chart.

Find the ColorCharts in the given image.

Find the ColorCharts in the given image.

Find the ColorCharts in the given image.

Find the ColorCharts in the given image.

Reads algorithm parameters from a file storage

Sets the color chart type for MCC detection.

Sets the detection paramaters for mcc.

Enables or disables the use of the neural network for detection.

Stores algorithm parameters in a file storage

Types

@type t() :: %Evision.MCC.CCheckerDetector{ref: reference()}

Type that represents an MCC.CCheckerDetector struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

@spec clear(Keyword.t()) :: any() | {:error, String.t()}
@spec clear(t()) :: t() | {:error, String.t()}

Clears the algorithm state

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()

Python prototype (for reference only):

clear() -> None
@spec create() :: t() | {:error, String.t()}

Returns the implementation of the CCheckerDetector.

Return
  • retval: CCheckerDetector

Python prototype (for reference only):

create() -> retval
@spec create(Keyword.t()) :: any() | {:error, String.t()}
@spec create(Evision.DNN.Net.t()) :: t() | {:error, String.t()}

Set the net which will be used to find the approximate bounding boxes for the color charts. And returns the implementation of the CCheckerDetector.

Positional Arguments
  • net: Evision.DNN.Net.t().

    the neural network, if the network in empty, then the function will return false.

Return
  • retval: CCheckerDetector

It is not necessary to use this, but this usually results in better detection rate.

Python prototype (for reference only):

create(net) -> retval
@spec draw(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

draw(self, checkers, img)

View Source
@spec draw(t(), [Evision.MCC.Ptr_CChecker.t()], Evision.Mat.maybe_mat_in()) ::
  Evision.Mat.t() | {:error, String.t()}

Draws the checker to the given image.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()

  • checkers: [Ptr_CChecker].

    The checkers which will be drawn by this object.

Keyword Arguments
  • color: Evision.scalar().

    The color by with which the squares of the checker will be drawn

  • thickness: integer().

    The thickness with which the sqaures will be drawn

Return
  • img: Evision.Mat.t().

    image in color space BGR

Python prototype (for reference only):

draw(checkers, img[, color[, thickness]]) -> img
Link to this function

draw(self, checkers, img, opts)

View Source
@spec draw(
  t(),
  [Evision.MCC.Ptr_CChecker.t()],
  Evision.Mat.maybe_mat_in(),
  [color: term(), thickness: term()] | nil
) :: Evision.Mat.t() | {:error, String.t()}

Draws the checker to the given image.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()

  • checkers: [Ptr_CChecker].

    The checkers which will be drawn by this object.

Keyword Arguments
  • color: Evision.scalar().

    The color by with which the squares of the checker will be drawn

  • thickness: integer().

    The thickness with which the sqaures will be drawn

Return
  • img: Evision.Mat.t().

    image in color space BGR

Python prototype (for reference only):

draw(checkers, img[, color[, thickness]]) -> img
@spec empty(Keyword.t()) :: any() | {:error, String.t()}
@spec empty(t()) :: boolean() | {:error, String.t()}

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()
Return
  • retval: bool

Python prototype (for reference only):

empty() -> retval
Link to this function

getBestColorChecker(named_args)

View Source
@spec getBestColorChecker(Keyword.t()) :: any() | {:error, String.t()}
@spec getBestColorChecker(t()) :: t() | {:error, String.t()}

Get the best color checker. By the best it means the one detected with the highest confidence.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()
Return
  • retval: Evision.MCC.CCheckerDetector.t()

@return checker A single colorchecker, if atleast one colorchecker

             was detected, 'nullptr' otherwise.

Python prototype (for reference only):

getBestColorChecker() -> retval
Link to this function

getColorChartType(named_args)

View Source
@spec getColorChartType(Keyword.t()) :: any() | {:error, String.t()}
@spec getColorChartType(t()) :: Evision.MCC.ColorChart.t() | {:error, String.t()}

getColorChartType

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()
Return
  • retval: ColorChart

Python prototype (for reference only):

getColorChartType() -> retval
Link to this function

getDefaultName(named_args)

View Source
@spec getDefaultName(Keyword.t()) :: any() | {:error, String.t()}
@spec getDefaultName(t()) :: binary() | {:error, String.t()}

getDefaultName

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()
Return

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.

Python prototype (for reference only):

getDefaultName() -> retval
Link to this function

getDetectionParams(named_args)

View Source
@spec getDetectionParams(Keyword.t()) :: any() | {:error, String.t()}
@spec getDetectionParams(t()) ::
  Evision.MCC.DetectorParametersMCC.t() | {:error, String.t()}

getDetectionParams

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()
Return
  • retval: DetectorParametersMCC

Python prototype (for reference only):

getDetectionParams() -> retval
Link to this function

getListColorChecker(named_args)

View Source
@spec getListColorChecker(Keyword.t()) :: any() | {:error, String.t()}
@spec getListColorChecker(t()) :: [Evision.MCC.CChecker.t()] | {:error, String.t()}

Get the list of all detected colorcheckers

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()
Return
  • retval: [CChecker]

@return checkers vector of colorcheckers

Python prototype (for reference only):

getListColorChecker() -> retval
Link to this function

getRefColors(named_args)

View Source
@spec getRefColors(Keyword.t()) :: any() | {:error, String.t()}
@spec getRefColors(t()) :: Evision.Mat.t() | {:error, String.t()}

Gets the reference color for chart.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()
Return
  • retval: Evision.Mat.t()

Python prototype (for reference only):

getRefColors() -> retval
Link to this function

getUseDnnModel(named_args)

View Source
@spec getUseDnnModel(Keyword.t()) :: any() | {:error, String.t()}
@spec getUseDnnModel(t()) :: boolean() | {:error, String.t()}

getUseDnnModel

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()
Return
  • retval: bool

Python prototype (for reference only):

getUseDnnModel() -> retval
@spec process(Keyword.t()) :: any() | {:error, String.t()}
@spec process(t(), Evision.Mat.maybe_mat_in()) :: boolean() | {:error, String.t()}

Find the ColorCharts in the given image.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()

  • image: Evision.Mat.

    image in color space BGR

Keyword Arguments
  • nc: integer().

    number of charts in the image, if you don't know the exact then keeping this number high helps.

Return
  • retval: bool

Differs from the above one only in the arguments. This version searches for the chart in the full image. The found charts are not returned but instead stored in the detector, these can be accessed later on using getBestColorChecker() and getListColorChecker() @return true if atleast one chart is detected otherwise false

Python prototype (for reference only):

process(image[, nc]) -> retval
Link to this function

process(self, image, opts)

View Source
@spec process(t(), Evision.Mat.maybe_mat_in(), [{:nc, term()}] | nil) ::
  boolean() | {:error, String.t()}

Find the ColorCharts in the given image.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()

  • image: Evision.Mat.

    image in color space BGR

Keyword Arguments
  • nc: integer().

    number of charts in the image, if you don't know the exact then keeping this number high helps.

Return
  • retval: bool

Differs from the above one only in the arguments. This version searches for the chart in the full image. The found charts are not returned but instead stored in the detector, these can be accessed later on using getBestColorChecker() and getListColorChecker() @return true if atleast one chart is detected otherwise false

Python prototype (for reference only):

process(image[, nc]) -> retval
Link to this function

processWithROI(named_args)

View Source
@spec processWithROI(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

processWithROI(self, image, regionsOfInterest)

View Source
@spec processWithROI(t(), Evision.Mat.maybe_mat_in(), [
  {number(), number(), number(), number()}
]) ::
  boolean() | {:error, String.t()}

Find the ColorCharts in the given image.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()

  • image: Evision.Mat.

    image in color space BGR

  • regionsOfInterest: [Rect].

    regions of image to look for the chart, if it is empty, charts are looked for in the entire image

Keyword Arguments
  • nc: integer().

    number of charts in the image, if you don't know the exact then keeping this number high helps.

Return
  • retval: bool

The found charts are not returned but instead stored in the detector, these can be accessed later on using getBestColorChecker() and getListColorChecker() @return true if atleast one chart is detected otherwise false

Python prototype (for reference only):

processWithROI(image, regionsOfInterest[, nc]) -> retval
Link to this function

processWithROI(self, image, regionsOfInterest, opts)

View Source
@spec processWithROI(
  t(),
  Evision.Mat.maybe_mat_in(),
  [{number(), number(), number(), number()}],
  [{:nc, term()}] | nil
) :: boolean() | {:error, String.t()}

Find the ColorCharts in the given image.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()

  • image: Evision.Mat.

    image in color space BGR

  • regionsOfInterest: [Rect].

    regions of image to look for the chart, if it is empty, charts are looked for in the entire image

Keyword Arguments
  • nc: integer().

    number of charts in the image, if you don't know the exact then keeping this number high helps.

Return
  • retval: bool

The found charts are not returned but instead stored in the detector, these can be accessed later on using getBestColorChecker() and getListColorChecker() @return true if atleast one chart is detected otherwise false

Python prototype (for reference only):

processWithROI(image, regionsOfInterest[, nc]) -> retval
@spec read(Keyword.t()) :: any() | {:error, String.t()}
@spec read(t(), Evision.FileNode.t()) :: t() | {:error, String.t()}

Reads algorithm parameters from a file storage

Positional Arguments

Python prototype (for reference only):

read(fn) -> None
@spec save(Keyword.t()) :: any() | {:error, String.t()}
@spec save(t(), binary()) :: t() | {:error, String.t()}

save

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()
  • filename: String

Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).

Python prototype (for reference only):

save(filename) -> None
Link to this function

setColorChartType(named_args)

View Source
@spec setColorChartType(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

setColorChartType(self, chartType)

View Source
@spec setColorChartType(t(), Evision.MCC.ColorChart.t()) :: t() | {:error, String.t()}

Sets the color chart type for MCC detection.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()

  • chartType: ColorChart.

    ColorChart enum specifying the type of color chart to detect.

Python prototype (for reference only):

setColorChartType(chartType) -> None
Link to this function

setDetectionParams(named_args)

View Source
@spec setDetectionParams(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

setDetectionParams(self, params)

View Source
@spec setDetectionParams(t(), Evision.MCC.DetectorParametersMCC.t()) ::
  t() | {:error, String.t()}

Sets the detection paramaters for mcc.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()

  • params: DetectorParametersMCC.

    DetectorParametersMCC structure containing detection configuration parameters.

Python prototype (for reference only):

setDetectionParams(params) -> None
Link to this function

setUseDnnModel(named_args)

View Source
@spec setUseDnnModel(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

setUseDnnModel(self, useDnn)

View Source
@spec setUseDnnModel(t(), boolean()) :: t() | {:error, String.t()}

Enables or disables the use of the neural network for detection.

Positional Arguments
  • self: Evision.MCC.CCheckerDetector.t()

  • useDnn: bool.

    Boolean flag to indicate whether to use neural network (true) or not (false).

Python prototype (for reference only):

setUseDnnModel(useDnn) -> None
@spec write(Keyword.t()) :: any() | {:error, String.t()}
@spec write(t(), Evision.FileStorage.t()) :: t() | {:error, String.t()}

Stores algorithm parameters in a file storage

Positional Arguments

Python prototype (for reference only):

write(fs) -> None
@spec write(t(), Evision.FileStorage.t(), binary()) :: t() | {:error, String.t()}

write

Positional Arguments

Has overloading in C++

Python prototype (for reference only):

write(fs, name) -> None