Module: houghCircles

Module reads in a message containing a pointer to an image and writes out the circles that are found in the image by OpenCV’s HoughCricle Transform.

The module PDF Description contains further information on this module’s function, how to run it, as well as testing.


class HoughCircles : public SysModel

Public Functions

HoughCircles()

The constructor for the HoughCircles module. It also sets some default values at its creation.

~HoughCircles()

This is the destructor

void UpdateState(uint64_t CurrentSimNanos)

This module reads an OpNav image and extracts circle information from its content using OpenCV’s HoughCircle Transform. It performs a greyscale, a bur, and a threshold on the image to facilitate circle-finding.

Return

void

Parameters
  • CurrentSimNanos: The clock time at which the function was called (nanoseconds)

void SelfInit()

Selfinit performs the first stage of initialization for this module. It’s primary function is to create messages that will be written to.

Return

void

void CrossInit()

CrossInit performs the second stage of initialization for this module. It’s primary function is to link the input messages that were created elsewhere.

Return

void

void Reset(uint64_t CurrentSimNanos)

This method performs a complete reset of the module. Local module variables that retain time varying states between function calls are reset to their default values.

Return

void

Parameters
  • this: The configuration data associated with the module

Public Members

std::string filename

Filename for module to read an image directly.

std::string opnavCirclesOutMsgName

The name of the CirclesOpnavMsg output message.

std::string imageInMsgName

The name of the ImageFswMsg output message.

std::string saveDir

The name of the directory to save images.

uint64_t sensorTimeTag

[ns] Current time tag for sensor out

int32_t blurrSize

[px] Size of the blurring box in pixels

int32_t cannyThresh

[px] Canny edge detection Threshold

int32_t voteThresh

[-] Threshold in number of votes to qualify a circle as detected

int32_t houghMinDist

[px] Min distance between 2 detected circles

int32_t houghMinRadius

[-] Min radius of a detected circle

int32_t houghMaxRadius

[-] Max radius of a detected circle

int32_t dpValue

[-] Subscaling of image for circle searching, 1 searches full image

double noiseSF

[-] Scale Factor for noise control

int32_t expectedCircles

[-] Number of expected circles to be found

int32_t saveImages

[-] 1 to save images to file for debugging

BSKLogger bskLogger

BSK Logging

Private Members

uint64_t OutputBufferCount

[-] Count on the number of output message buffers

int32_t opnavCirclesOutMsgID

ID for the outgoing message.

int32_t imageInMsgID

ID for the outgoing message.