Fawkes API  Fawkes Development Version
firevision::ImageDiff Class Reference

Image difference checker. More...

#include <>>

Public Member Functions

 ImageDiff (ScanlineModel *scanline_model)
 Constructor. More...
 
 ImageDiff ()
 Constructor. More...
 
 ~ImageDiff ()
 Destructor. More...
 
void setBufferA (unsigned char *yuv422planar_buffer, unsigned int width, unsigned int height)
 Set first buffer. More...
 
void setBufferB (unsigned char *yuv422planar_buffer, unsigned int width, unsigned int height)
 Set second buffer. More...
 
bool different ()
 Check if images are different. More...
 
unsigned int numDifferingPixels ()
 Number of differing pixels. More...
 

Detailed Description

Image difference checker.

Author
Tim Niemueller

Definition at line 35 of file imagediff.h.

Constructor & Destructor Documentation

◆ ImageDiff() [1/2]

firevision::ImageDiff::ImageDiff ( ScanlineModel scanline_model)

Constructor.

Parameters
scanline_modelscanlinemodel to use, if null all pixels are compared.

Definition at line 43 of file imagediff.cpp.

◆ ImageDiff() [2/2]

firevision::ImageDiff::ImageDiff ( )

Constructor.

Use this constructor to compare all pixels.

Definition at line 52 of file imagediff.cpp.

◆ ~ImageDiff()

firevision::ImageDiff::~ImageDiff ( )

Destructor.

Definition at line 59 of file imagediff.cpp.

Member Function Documentation

◆ different()

bool firevision::ImageDiff::different ( )

Check if images are different.

This method will compare the two images. If any pixel marked by the scanline or any pixel at all if no scanline model is given differ the images are considered to be different. The same applies if any buffer is unset or the widths or heights are not the same.

Returns
true if images are different, false otherwise

Definition at line 102 of file imagediff.cpp.

References fawkes::upoint_t::x.

Referenced by firevision::FilterGeodesicDilation::apply(), and firevision::FilterGeodesicErosion::apply().

◆ numDifferingPixels()

unsigned int firevision::ImageDiff::numDifferingPixels ( )

Number of differing pixels.

Executes the same routine as different(). But instead of just saying that the images are different will tell how many pixels differ.

Returns
number of different pixels

Definition at line 152 of file imagediff.cpp.

References fawkes::upoint_t::x.

◆ setBufferA()

void firevision::ImageDiff::setBufferA ( unsigned char *  yuv422planar_buffer,
unsigned int  width,
unsigned int  height 
)

Set first buffer.

Parameters
yuv422planar_bufferbuffer
widthimage width in pixels
heightimage height in pixels

Definition at line 70 of file imagediff.cpp.

Referenced by firevision::FilterGeodesicDilation::apply(), and firevision::FilterGeodesicErosion::apply().

◆ setBufferB()

void firevision::ImageDiff::setBufferB ( unsigned char *  yuv422planar_buffer,
unsigned int  width,
unsigned int  height 
)

Set second buffer.

Parameters
yuv422planar_bufferbuffer
widthimage width in pixels
heightimage height in pixels

Definition at line 85 of file imagediff.cpp.

Referenced by firevision::FilterGeodesicDilation::apply(), and firevision::FilterGeodesicErosion::apply().


The documentation for this class was generated from the following files: