ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Fingerprint Scans Comparison
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Apr 02 2014 :  02:59:29  Show Profile  Reply
Hello,

Before I take this work up I wanted to know if it is possible to compare two images which in my case are fingerprint scans.

There is a very big database of company persons in which each persons name, address and fingerprints are stored. Now I have to compare each fingerprint to find duplicates.

I would like to know if there are any possibilities of being able to compare two fingerprints and detecting the differences.

TIA



Yogi Yang

xequte

38459 Posts

Posted - Apr 02 2014 :  11:40:07  Show Profile  Reply
Hi

ImageEnProc has a CompareWith function to show the difference in two images. Try the "Show Image Differences" demo at:

http://www.imageen.com/demos/

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

spetric

Croatia
308 Posts

Posted - Apr 04 2014 :  12:48:30  Show Profile  Reply
Hi,

you can not automatically compare fingerprints in simple manner, i.e. comparing two images on pixel per pixel bases, as fingerprints control points are not in the same position on both images. Also, beside translation, fingerprints may be rotated with respect to each other.


You're actually dealing with object recognition/comparison, not with image comparison/difference.

So, you'll have to play with image invariants (moments) in order to compare
two objects on two images.

I don't know if IEVision has such capabilites, but old Intel IPL library has fast image moments calculation and it can be simply "connected" with TIEBitmap (at least in C++). I think there exists Delphi header as well. I'm using old IPL extensively, together with ImageEn.


I haven't try new Intel's IPP library, but as it uses stdcall API convention, it'll probably work with Delphi/C++ Builder.

Alternatives, such as OpenCV may work as well, as it contains some object/pattern recognition routines. Unfortunately, I have succeeded to work only with versions 1.0, 1.1. (with C++ Builder and ImageEn), but higher OpenCV versions will not work with Delphi/C++ Builder (library can not be converted to OMF format).

Here is one fresh article that deals with such type of biometrics calculation (using image moments):

link to arcicle

Edit: I have problem to copy link's location...ok now it works.

HTH,
Siniša

Go to Top of Page

yogiyang

India
727 Posts

Posted - Apr 05 2014 :  04:02:00  Show Profile  Reply
@spetric,

Thank you for your inputs.

quote:
I don't know if IEVision has such capabilites, but old Intel IPL library has fast image moments calculation and it can be simply "connected" with TIEBitmap (at least in C++). I think there exists Delphi header as well. I'm using old IPL extensively, together with ImageEn.


Can you please give me link for old Intel IPL lib download?

I am asknig as I could not find any link to download it.

Regards,



Yogi Yang
Go to Top of Page

spetric

Croatia
308 Posts

Posted - Apr 07 2014 :  00:07:50  Show Profile  Reply
Hi,

IPL library (which was freeware) is obsolete and replaced by IPP (which costs around 199USD). You'll hardly find IPL anywhere on the web...so I have put it on the opendrive.

Ipl 2.5 (with Delphi headers):

http://spetric.opendrive.com/files/MF8zOTE4NzU2NV9pdGJzVV81OTlj/ipl25.zip

Ipl 2.5-SP1 (service pack 1 - libraries only):

http://spetric.opendrive.com/files/MF8zOTE4NzYxMV91V2Rxdl85ZWMw/ipl25-sp1.zip

This is the last and latest version of IPL.

Here is a code snippet (c++) how to "connect" TIEBitamp and IPL data.
Note: TIEBItmap must be contiguous in memory.
Function pximg_CreateIplImageFromIEBmp will create ipl header from TIEBitmap:

//---------------------------------------------------------------------------
// creates ipl header
// NOTE: This is version with DWORD alignment!!!
// parameter type are mine constants...you can put your constants or anything similar.
//
IplImage* __fastcall pximg_CreateIplHeader(int ipl_width, int ipl_height, int type)
{
IplImage *img;
switch (type)
   {
   case px_IPL_RGB_24:
   default:
        img  = iplCreateImageHeader(
            3,                      // number of channels
            0,                      // no alpha channel
            IPL_DEPTH_8U,           // data of byte type
            "RGB",                  // color model
            "BGR",                  // color order
            IPL_DATA_ORDER_PIXEL,   // channel arrangement
            IPL_ORIGIN_BL,          // bottom left orientation
            IPL_ALIGN_DWORD,        // 4 bytes align
            ipl_width,              // image width
            ipl_height,             // image height
            NULL,                   // no ROI
            NULL,                   // no mask ROI
            NULL,                   // no image ID
            NULL );                 // not tiled
        break;
   case px_IPL_HLS_24:
        img  = iplCreateImageHeader(
            3,                      // number of channels
            0,                      // no alpha channel
            IPL_DEPTH_8U,           // data of byte type
            "HLS",                  // color model
            "HLS",                  // color order
            IPL_DATA_ORDER_PIXEL,   // channel arrangement
            IPL_ORIGIN_BL,          // bottom left orientation
            IPL_ALIGN_DWORD,        // 4 bytes align
            ipl_width,              // image width
            ipl_height,             // image height
            NULL,                   // no ROI
            NULL,                   // no mask ROI
            NULL,                   // no image ID
            NULL );                 // not tiled
        break;
   case px_IPL_XYZ_24:
        img  = iplCreateImageHeader(
            3,                      // number of channels
            0,                      // no alpha channel
            IPL_DEPTH_8U,           // data of byte type
            "XYZ",                  // color model
            "XYZ",                  // color order
            IPL_DATA_ORDER_PIXEL,   // channel arrangement
            IPL_ORIGIN_BL,          // bottom left orientation
            IPL_ALIGN_DWORD,        // 4 bytes align
            ipl_width,              // image width
            ipl_height,             // image height
            NULL,                   // no ROI
            NULL,                   // no mask ROI
            NULL,                   // no image ID
            NULL );                 // not tiled
        break;
   case px_IPL_YCR_24:
        img  = iplCreateImageHeader(
            3,                      // number of channels
            0,                      // no alpha channel
            IPL_DEPTH_8U,           // data of byte type
            "YCr",                  // color model
            "YCr",                  // color order
            IPL_DATA_ORDER_PIXEL,   // channel arrangement
            IPL_ORIGIN_BL,          // bottom left orientation
            IPL_ALIGN_DWORD,        // 4 bytes align
            ipl_width,              // image width
            ipl_height,             // image height
            NULL,                   // no ROI
            NULL,                   // no mask ROI
            NULL,                   // no image ID
            NULL );                 // not tiled
        break;
   case px_IPL_GRAY_8:
        img  = iplCreateImageHeader(
            1,                      // number of channels
            0,                      // no alpha channel
            IPL_DEPTH_8U,           // data of byte type
            "GRAY",                 // color model
            "GRAY",                 // color order
            IPL_DATA_ORDER_PIXEL,   // channel arrangement
            IPL_ORIGIN_BL,          // bottom left orientation
            IPL_ALIGN_DWORD,        // 4 bytes align
            ipl_width,              // image width
            ipl_height,             // image height
            NULL,                   // no ROI
            NULL,                   // no mask ROI
            NULL,                   // no image ID
            NULL );                 // not tiled
        break;
   case px_IPL_RGB_48:
        img  = iplCreateImageHeader(
            3,                      // number of channels
            0,                      // no alpha channel
            IPL_DEPTH_16U,          // data of byte type
            "RGB",                  // color model
            "BGR",                  // color order
            IPL_DATA_ORDER_PIXEL,   // channel arrangement
            IPL_ORIGIN_BL,          // bottom left orientation
            IPL_ALIGN_DWORD,        // 4 bytes align
            ipl_width,              // image width
            ipl_height,             // image height
            NULL,                   // no ROI
            NULL,                   // no mask ROI
            NULL,                   // no image ID
            NULL );                 // not tiled
         break;
   case px_IPL_RGB_48_SIGNED:
        img  = iplCreateImageHeader(
            3,                      // number of channels
            0,                      // no alpha channel
            IPL_DEPTH_16S,          // data of byte type
            "RGB",                  // color model
            "BGR",                  // color order
            IPL_DATA_ORDER_PIXEL,   // channel arrangement
            IPL_ORIGIN_BL,          // bottom left orientation
            IPL_ALIGN_DWORD,        // 4 bytes align
            ipl_width,              // image width
            ipl_height,             // image height
            NULL,                   // no ROI
            NULL,                   // no mask ROI
            NULL,                   // no image ID
            NULL );                 // not tiled
        break;
   case px_IPL_GRAY_32_FLOAT:
        img  = iplCreateImageHeader(
            1,                      // number of channels
            0,                      // no alpha channel
            IPL_DEPTH_32F,          // data of byte type
            "GRAY",                 // color model
            "GRAY",                 // color order
            IPL_DATA_ORDER_PIXEL,   // channel arrangement
            IPL_ORIGIN_BL,          // bottom left orientation
            IPL_ALIGN_DWORD,        // 4 bytes align
            ipl_width,              // image width
            ipl_height,             // image height
            NULL,                   // no ROI
            NULL,                   // no mask ROI
            NULL,                   // no image ID
            NULL );                 // not tiled
        break;
   }
return img;
}
//---------------------------------------------------------------------------
IplImage* __fastcall pximg_CreateIplImage(int ipl_width, int ipl_height, int type, int doFill)
{
IplImage *img = pximg_CreateIplHeader(ipl_width, ipl_height, type);
if (type == px_IPL_GRAY_32_FLOAT)
   iplAllocateImageFP(img, doFill, 0.0);
else
   iplAllocateImage(img, doFill, 0);
return img;
}
//---------------------------------------------------------------------------
int __fastcall pximg_GetIplTypeFromIEBmp(TIEBitmap *ieBitmap)
{
int type;
if (ieBitmap->PixelFormat == ie24RGB)
    type = px_IPL_RGB_24;
else if (ieBitmap->PixelFormat == ie8g)
    type = px_IPL_GRAY_8;
else if (ieBitmap->PixelFormat == ie1g)
    type = px_IPL_GRAY_1;
else if (ieBitmap->PixelFormat == ie32f)
    type = px_IPL_GRAY_32_FLOAT;
else
    type = px_IPL_RGB_48_SIGNED;        // and if it's not???
//TODO: bah...this should be rewritten
return type;
}
//---------------------------------------------------------------------------
IplImage* __fastcall pximg_CreateIplImageFromIEBmp(TIEBitmap *ieBitmap)
{
int type = pximg_GetIplTypeFromIEBmp(ieBitmap);
IplImage *img = pximg_CreateIplHeader(ieBitmap->Width, ieBitmap->Height, type);
img->imageData = img->imageDataOrigin = (char*)((LPVOID)ieBitmap->Scanline[ieBitmap->Height-1]);
return img;
}


Go to Top of Page

yogiyang

India
727 Posts

Posted - Apr 07 2014 :  22:44:36  Show Profile  Reply
@spetric,

Thank you very much for your help and the link.

I will download it and play with it.

Once again Thanks.

I really appreicate your help.

Regards,



Yogi Yang
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: