# class
ImageComparer
Compares images.
# Properties
Property | Description |
---|---|
Name | The name of the ImageComparer object. (Inherited from Object) |
# Methods
Method | Description |
---|---|
AddObserver | Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object) |
CompareImages | 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. Returns 0 on success. |
GetClass | Get the name of the ImageComparer class. (Inherited from Object) |
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 | 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 | 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 | 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 | 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 average pixel-error of the model. |
IsA | Returns true if ImageComparer is a or is a descendant of the class named as the type parameter. (Inherited from Object) |
IsNull | Returns true if the ImageComparer object is invalid. (Inherited from Object) |
IsSameObjectAs | Returns true if the ImageComparer object is valid. (Inherited from Object) |
NonNull | Returns true if the ImageComparer object is valid. (Inherited from Object) |
PrintInfo | Prints the content/info of the ImageComparer object to the log. (Inherited from Object) |
RemoveObserver | Removes a previously added observer object. (Inherited from Object) |
SetDiffHighlightsExportPath | 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". |
SetImageDiffExportPath | The export-path for the resulting comparison. Can be used to get a visual feedback of the results of the comparison. |
SetImageMasks | 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. |
SetImagePathAfterImg | 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. |
SetImagePathBeforeImg | 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. |
SetImages | The two images that will be compared. Both images needs to be of the same type and the same size. |
SetSilhouetteDifferenceError | 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 value is set for the case where the background behind the model blends in somewhat with the model and the difference in silhouette will not be fully seen. |
# Static methods
Method | Description |
---|---|
IsClassA | Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object) |
SafeCast | SafeCast makes sure the input object is of a class that can be cast into spImageComparer, and if this is the case, returns the object cast into spImageComparer. (Inherited from Object) |
# Properties details
# Name
The name of the ImageComparer object. (Inherited from Object)
# Methods details
# AddObserver
Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
# CompareImages
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. Returns 0 on success.
# GetClass
Get the name of the ImageComparer class. (Inherited from Object)
# 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
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
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
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
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 average pixel-error of the model.
# IsA
Returns true if ImageComparer is a or is a descendant of the class named as the type parameter. (Inherited from Object)
# IsNull
Returns true if the ImageComparer object is invalid. (Inherited from Object)
# IsSameObjectAs
Returns true if the ImageComparer object is valid. (Inherited from Object)
# NonNull
Returns true if the ImageComparer object is valid. (Inherited from Object)
# PrintInfo
Prints the content/info of the ImageComparer object to the log. (Inherited from Object)
# RemoveObserver
Removes a previously added observer object. (Inherited from Object)
# SetDiffHighlightsExportPath
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".
# SetImageDiffExportPath
The export-path for the resulting comparison. Can be used to get a visual feedback of the results of the comparison.
# SetImageMasks
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.
# SetImagePathAfterImg
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.
# SetImagePathBeforeImg
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.
# SetImages
The two images that will be compared. Both images needs to be of the same type and the same size.
# SetSilhouetteDifferenceError
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 value is set for the case where the background behind the model blends in somewhat with the model and the difference in silhouette will not be fully seen.
# Static methods details
# IsClassA
Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)
# SafeCast
SafeCast makes sure the input object is of a class that can be cast into spImageComparer, and if this is the case, returns the object cast into spImageComparer. (Inherited from Object)