CompareScreenshotsStable¶
-
MacroModule
¶ author wspindler
package FMEstable/ReleaseMeVis
definition CompareScreenshotsStable.def see also MetaSimilarityMeasure
,ImageCompare
,ImageHash
,Checksum
,CompareInventorSceneSampling
,XMarkerListCompare
,DicomTreeCompare
,PCLCompare
keywords compare
,test
,screenshot
,inventor
,MetaSimilarityMeasure
Purpose¶
CompareScreenshotsStable
compares two images: the template image (from File 1
) with the reference image (File 2
which is considered the “correct”, “expected”, or “reference” image). Both are shown at the outputs outScreenshot1Image
and outScreenshot2Image
, respectively, as well as their color coded difference at outDifferenceImage
. A visual presentation is available as outHorizontalView
in the user interface of the module as well as a same-named output connector. A strength gives a hint about how much the images differ, it is calculated according to the comparison metric SimilarityMeasure
. A zero strength in similarity
indicates incomparable images (as explained below) as well as a strong difference, a higher and positive value a small or no difference.
For example similarity
SSD, NCC, and NMI indicate a maximum similarity (= equal images) with the value 1, other measures use different values, see MetaSimilarityMeasure
for details.
The comparison is performed especially to be used for tests. The following properties are considered/compared:
A zero similarity
and a Status Code
!= Ok is calculated in the following cases:
- any undefined or invalid input image or empty input path
- different image extents in any image dimension
- different color models (for example HSV versus RGB)
- image with extents > 1 in z-, t-, or u-dimension
A successful comparison is indicated with Ok in Status Code
and may lead to zero or non-zero values in similarity
dependent on the strength of the image difference.
Note
On python programming level there is also a helper function under Packages/FMEstable/ReleaseMeVis/Modules/Scripts/python/fmeTestSupport/ScreenShotComparsion.py which makes use of this module to simplify screenshot comparisons in python tests.
Output Fields¶
outScreenshot1Image¶
outScreenshot2Image¶
-
name:
outScreenshot2Image
, type:
Image
¶ The reference (defining the “truth” or “expected”) image.
outDifferenceImage¶
-
name:
outDifferenceImage
, type:
Image
¶ The color coded difference of the first (current) and second (reference) screenshot. Low or black values indicate small differences, large (bright/white) values indicate high differences. See the color bar in right hand side of
outHorizontalView
for the color coded intensities describing the strength of the difference.
outHorizontalView¶
-
name:
outHorizontalView
, type:
SoNode
¶ The view containing, from left to right, the current, reference and difference image with corresponding label below. Right from the difference image, a vertical bar with a color spectrum is shown as legend, starting on top with black (from no or small difference) to the white bottom (large difference).
Parameter Fields¶
Field Index¶
[] : Trigger |
SimilarityMeasure : Enum |
Clear : Trigger |
Status Code : Enum |
doNotClearOnFailedUpdate : Bool |
Status Message : String |
File 1 : String |
Update : Trigger |
File 2 : String |
|
Has Valid Output : Bool |
|
On Input Change Behavior : Enum |
|
Similarity : Double |
Visible Fields¶
On Input Change Behavior¶
-
name:
onInputChangeBehavior
, type:
Enum
, default:
Clear
, deprecated name:
shouldAutoUpdate,shouldUpdateAutomatically
¶ Declares how the module should react if a value of an input field changes.
Values:
Title | Name | Deprecated Name |
---|---|---|
Update | Update | TRUE |
Clear | Clear | FALSE |
[]¶
-
name:
updateDone
, type:
Trigger
, persistent:
no
¶ Notifies that an update was performed (Check status interface fields to identify success or failure).
Has Valid Output¶
-
name:
hasValidOutput
, type:
Bool
, persistent:
no
¶ Indicates validity of output field values (success of computation).
Status Code¶
-
name:
statusCode
, type:
Enum
, persistent:
no
¶ Reflects module’s status (successful or failed computations), Ok indicates a successful operation, for example cleared outputs or values or comparison. Note: to detect a valid
similarity
value only check for an enabledHas Valid Output
.
Status Message¶
-
name:
statusMessage
, type:
String
, persistent:
no
¶ Gives additional, detailed information about status code as human-readable message.
SimilarityMeasure¶
-
name:
inSimilarityMeasure
, type:
Enum
, default:
NCC
¶ The metric/measure algorithm to compare the screenshots, see
MetaSimilarityMeasure
for a detailed description of the difference measures. A typically useful metric NCC.
File 1¶
-
name:
inScreenshotFilename1
, type:
String
, default:
/Repository/FMEstable/ReleaseMeVis/Projects/CompareScreenshotsStable/Modules/networks/LaGomeraPlant_NoDifference.png
¶ The template image to compare with in ScreenshotFileName2.