#include <SimplygonSDK.h>
compares images
Definition at line 20609 of file SimplygonSDK.h.
◆ CompareImages()
virtual int SimplygonSDK::IImageComparer::CompareImages |
( |
| ) |
|
|
pure virtual |
Compares the images either set from "SetImages" or the two images set from the "ImagePathBeforeImg" and "ImagePathAfterImg" strings. Will return -1 if two images were not set (in the same manner)
Returns -2 if images aren't of the same size
Returns -3 if images are not 2D images (ImageData supports 3D images for example - don't try to use these)
Returns -4 if ImgMasks are set, but are not same size as the Before and AfterImg.
On success, will return 0
◆ GetClass()
virtual const char* SimplygonSDK::IImageComparer::GetClass |
( |
| ) |
|
|
virtual |
GetClass returns the name of the class of the object.
- Returns
- the name of the actual class of the object, as a const char string
Reimplemented from SimplygonSDK::IObject.
◆ GetDiffHighlights()
Returns the image for the most heavily impacted areas of the comparison. Can be used to get a visual feedback of the results of the comparison, to see the highlighted "problem areas".
◆ GetHighlightAreaCoverage()
virtual unsigned int SimplygonSDK::IImageComparer::GetHighlightAreaCoverage |
( |
| ) |
|
|
pure virtual |
Returns the sum of all pixels that are in a "high-problem" area. Used together with the TotalMaskCoverage value, this can let you know how large the problem-areas are compared to the size of the model.
◆ GetImageDiff()
Returns the image for the resulting comparison. Can be used to get a visual feedback of the results of the comparison.
◆ GetMaxPixelError()
virtual float SimplygonSDK::IImageComparer::GetMaxPixelError |
( |
| ) |
|
|
pure virtual |
Returns the size of the largest problem-areas. Preferably this value should be not much larger than the 1-2 range, or the model should probably be further away from the camera to get a good looking LOD-switch.
◆ GetTotalMaskCoverage()
virtual unsigned int SimplygonSDK::IImageComparer::GetTotalMaskCoverage |
( |
| ) |
|
|
pure virtual |
Returns the number of pixels that either the before- or the after-masks covers. Can be good to know when looking at the TotalPixelError and HighlightAreaCoverage numbers, to get a feel for the big the error of the image is relative to how big the measured area actually was.
◆ GetTotalPixelError()
virtual float SimplygonSDK::IImageComparer::GetTotalPixelError |
( |
| ) |
|
|
pure virtual |
Return the sum of all pixel-errors of the whole image. Can be used to get a feel for the over-all similarity between the two images. Especially when scaled with the TotalMaskCoverage value. That way you can get the avarage pixel-error of the model.
◆ IsA()
virtual bool SimplygonSDK::IImageComparer::IsA |
( |
const char * |
type | ) |
const |
|
virtual |
The IsA function returns true if the object is a or is a descendant of the class named as the type parameter
- Parameters
-
type | is the name of the class to check if the object is, or is a descendant of |
- Returns
- true if the object is of the specified class, false if not
Reimplemented from SimplygonSDK::IObject.
◆ IsClassA()
static bool SimplygonSDK::IImageComparer::IsClassA |
( |
const char * |
type | ) |
|
|
inlinestatic |
The IsClassA function returns true if IImageComparer is a or is a descendant of the class named as the type parameter
- Parameters
-
type | is the name of the class to check if the class is, or is a descendant of |
- Returns
- true if the class is of the specified class, false if not
Definition at line 20630 of file SimplygonSDK.h.
◆ SafeCast()
SafeCast makes sure the pointer is of a class that can be cast into a IImageComparer pointer, and if this is possible, returns the cast pointer.
- Parameters
-
- Returns
- a pointer to the IImageComparer object, if the cast can be made, and a NULL pointer otherwise
Definition at line 20643 of file SimplygonSDK.h.
◆ SetDiffHighlightsExportPath()
virtual void SimplygonSDK::IImageComparer::SetDiffHighlightsExportPath |
( |
const char * |
value | ) |
|
|
pure virtual |
Sets the export-path for the most heavily impacted areas of the comparison. Can be used to get a visual feedback of the results of the comparison, to see the highlighted "problem areas".
- Parameters
-
value | the file path to the image |
◆ SetImageDiffExportPath()
virtual void SimplygonSDK::IImageComparer::SetImageDiffExportPath |
( |
const char * |
value | ) |
|
|
pure virtual |
Sets the export-path for the resulting comparison. Can be used to get a visual feedback of the results of the comparison.
- Parameters
-
value | the file path to the image |
◆ SetImageMasks()
virtual void SimplygonSDK::IImageComparer::SetImageMasks |
( |
IBoolArray * |
beforeImgMask, |
|
|
IBoolArray * |
afterImgMask |
|
) |
| |
|
pure virtual |
Sets the two image-masks for the comparison. Both image-masks needs to be of the same size as the compared images (same item-count as the number of pixels in the images). True means a pixel in the compared image contains a part of the rendered object, false means the pixel is only "background" and does not need to be compared. When a pixel in the mask is set to "true" in one image and "false" in the other image, this means that there is a silhouette-error. How much this error should be measured can be set with the "SilhouetteDifferenceError" setting. If masks are not set, all pixels in the images will be compared as is, without taking into account what part of the images are of the actual model and which parts are just background.
- Parameters
-
beforeImgMask | the bool array for the before image mask |
afterImgMask | the bool array for the after image mask |
◆ SetImagePathAfterImg()
virtual void SimplygonSDK::IImageComparer::SetImagePathAfterImg |
( |
const char * |
value | ) |
|
|
pure virtual |
Sets the path to the other of the images to be compared. Both images needs to be of the same type and size for this to work. This can be used instead of setting the images from the "SetImage" function, and will only be used if the "SetImage" function was never used.
- Parameters
-
value | the file path to the image |
◆ SetImagePathBeforeImg()
virtual void SimplygonSDK::IImageComparer::SetImagePathBeforeImg |
( |
const char * |
value | ) |
|
|
pure virtual |
Sets the path to one of the images to be compared. Both images needs to be of the same type and size for this to work. This can be used instead of setting the images from the "SetImage" function, and will only be used if the "SetImage" function was never used.
- Parameters
-
value | the file path to the image |
◆ SetImages()
virtual void SimplygonSDK::IImageComparer::SetImages |
( |
IImageData * |
beforeImg, |
|
|
IImageData * |
afterImg |
|
) |
| |
|
pure virtual |
Sets the two images that will be compared. Both images needs to be of the same type and the same size.
- Parameters
-
beforeImg | the image data obejct for the before image |
afterImg | the image data obejct for the after image |
◆ SetSilhouetteDifferenceError()
virtual void SimplygonSDK::IImageComparer::SetSilhouetteDifferenceError |
( |
float |
value | ) |
|
|
pure virtual |
Decides how big of an impact the silhouette-difference between the two masks will be. 0.0 means the silhouette difference will not be taken into account at all, and 1.0 means it will be counted as maximum possible error. Default is set to 0.5. This is because a lot of times the background behind the model blends in somewhat with the model, and most times the difference in silhouette will not be fully seen.
- Parameters
-
value | the value of silhouette-difference (0.0 - 1.0) |
The documentation for this class was generated from the following file: