ImageEn

TIEVisionImageHasher Code Samples


Code samples for TIEVisionImageHasher (Automatically generated by the Every Method demo).

// Automated test of Perceptual Image Hash - Typical Values
// TIEVisionImageHasher (ievHashPHash) - Hash: 168BE96365198C82 - Similarity (0.75+ = near-duplicate) of copies - Half Size: 1.00, Brighter: 1.00, Blurred: 1.00, Flipped (different): 0.30
hasher := IEVisionLib().createImageHasher( ievHashPHash );
hash1 := hasher.compute( ImageEnView1.IEBitmap.GetIEVisionImage( True ));
hash2 := hasher.compute( ImageEnView2.IEBitmap.GetIEVisionImage( True ));
if hasher.similarity( hash1, hash2 ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );

// Or more simply
if IEVisionCompareHashes( ImageEnView1.IEBitmap.GetPerceptualHash( ievHashPHash ), ImageEnView2.IEBitmap.GetPerceptualHash( ievHashPHash ), ievHashPHash ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );



// Automated test of Perceptual Image Hash - Alpha Channel - Typical Values
// TIEVisionImageHasher (ievHashPHash) - Hash: CDEAF2525CBE9AAF - Similarity (0.75+ = near-duplicate) of copies - Half Size: 1.00, Brighter: 0.97, Blurred: 0.97, Flipped (different): 0.38
hasher := IEVisionLib().createImageHasher( ievHashPHash );
hash1 := hasher.compute( ImageEnView1.IEBitmap.GetIEVisionImage( True ));
hash2 := hasher.compute( ImageEnView2.IEBitmap.GetIEVisionImage( True ));
if hasher.similarity( hash1, hash2 ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );

// Or more simply
if IEVisionCompareHashes( ImageEnView1.IEBitmap.GetPerceptualHash( ievHashPHash ), ImageEnView2.IEBitmap.GetPerceptualHash( ievHashPHash ), ievHashPHash ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );



// Automated test of Perceptual Image Hash - 32-Bit RGBA - Typical Values
// TIEVisionImageHasher (ievHashPHash) - Hash: 64CF8912F4B528D7 - Similarity (0.75+ = near-duplicate) of copies - Half Size: 0.85, Brighter: 0.90, Blurred: 0.90, Flipped (different): 0.32
hasher := IEVisionLib().createImageHasher( ievHashPHash );
hash1 := hasher.compute( ImageEnView1.IEBitmap.GetIEVisionImage( True ));
hash2 := hasher.compute( ImageEnView2.IEBitmap.GetIEVisionImage( True ));
if hasher.similarity( hash1, hash2 ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );

// Or more simply
if IEVisionCompareHashes( ImageEnView1.IEBitmap.GetPerceptualHash( ievHashPHash ), ImageEnView2.IEBitmap.GetPerceptualHash( ievHashPHash ), ievHashPHash ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );



// Automated test of Perceptual Image Hash - Random Values
// TIEVisionImageHasher (ievHashMarrHildreth) - Hash: F8127D1A0B4FC09637D812749F464FE3B3E6D21241E3F0383C93C8D2125B3496496C92DBD21264FC81FFC0B60F931264C4B27C9CBFA693927E1E0C391C1E371392DB7C0E474381F0 - Similarity (0.75+ = near-duplicate) of copies - Half Size: 0.97, Brighter: 1.00, Blurred: 1.00, Flipped (different): 0.04
hasher := IEVisionLib().createImageHasher( ievHashMarrHildreth );
hash1 := hasher.compute( ImageEnView1.IEBitmap.GetIEVisionImage( True ));
hash2 := hasher.compute( ImageEnView2.IEBitmap.GetIEVisionImage( True ));
if hasher.similarity( hash1, hash2 ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );

// Or more simply
if IEVisionCompareHashes( ImageEnView1.IEBitmap.GetPerceptualHash( ievHashMarrHildreth ), ImageEnView2.IEBitmap.GetPerceptualHash( ievHashMarrHildreth ), ievHashMarrHildreth ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );



// Automated test of Perceptual Image Hash - Alpha Channel - Random Values
// TIEVisionImageHasher (ievHashMarrHildreth) - Hash: 13EDBC1F86CB266CD9D26D09326607236048DA68087D9138FFB76CD207DF99E938DCB724E46C02FD9F4695B7249BB93B1E0E01249337134D86C0B13B6649D9DB1247E26CC8DF164D - Similarity (0.75+ = near-duplicate) of copies - Half Size: 0.97, Brighter: 0.97, Blurred: 0.98, Flipped (different): 0.03
hasher := IEVisionLib().createImageHasher( ievHashMarrHildreth );
hash1 := hasher.compute( ImageEnView1.IEBitmap.GetIEVisionImage( True ));
hash2 := hasher.compute( ImageEnView2.IEBitmap.GetIEVisionImage( True ));
if hasher.similarity( hash1, hash2 ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );

// Or more simply
if IEVisionCompareHashes( ImageEnView1.IEBitmap.GetPerceptualHash( ievHashMarrHildreth ), ImageEnView2.IEBitmap.GetPerceptualHash( ievHashMarrHildreth ), ievHashMarrHildreth ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );



// Automated test of Perceptual Image Hash - 32-Bit RGBA - Random Values
// TIEVisionImageHasher (ievHashMarrHildreth) - Hash: 000800237079EE4C00198081734A4C9390363593CBF262DEE44EC964CDFB2CBDA11FB32600723709B938FCCD870072190CB727036DD80000092D9FCCDB08000001C000024ED24800 - Similarity (0.75+ = near-duplicate) of copies - Half Size: 0.79, Brighter: 0.93, Blurred: 0.85, Flipped (different): 0.00
hasher := IEVisionLib().createImageHasher( ievHashMarrHildreth );
hash1 := hasher.compute( ImageEnView1.IEBitmap.GetIEVisionImage( True ));
hash2 := hasher.compute( ImageEnView2.IEBitmap.GetIEVisionImage( True ));
if hasher.similarity( hash1, hash2 ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );

// Or more simply
if IEVisionCompareHashes( ImageEnView1.IEBitmap.GetPerceptualHash( ievHashMarrHildreth ), ImageEnView2.IEBitmap.GetPerceptualHash( ievHashMarrHildreth ), ievHashMarrHildreth ) >= 0.75 then
  ShowMessage( 'Near-duplicate' );