07-30-2014, 05:56 AM
Polymath (in disciplina)
* Expert *
Join Date: May 2004
To get you started, I've modified the comparison function to calculate and return the percent difference (rather than a Boolean):
Private Function ComparePixels() As Double
Dim lonU1 As Long, lonU2 As Long
Dim lonLoop As Long
Dim dblCnt As Double
lonU1 = UBound(lonPix_1())
lonU2 = UBound(lonPix_2())
If lonU1 = lonU2 and lonU1 > 0 Then 'handle only real images that are same size
For lonLoop = LBound(lonPix_1()) To lonU1
If lonPix_1(lonLoop) <> lonPix_2(lonLoop) Then
dblCnt = dblCnt + 1 'count bad pixels
'Calculate bad pixels as a fraction of total and convert to percent
ComparePixels = dblCnt / (lonU1 - LBound(lonPix_1()) + 1) * 100
ComparePixels = 100 'you could make this -1 to flag images are not the same size
You'll have to modify the calling functions to handle the Double that is returned.
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Last edited by Cerian Knight; 07-30-2014 at 06:02 AM.