File Exchange

image thumbnail

ROI of Palmprint Images

Matlab function to detect the Region of Interest (ROI) of Palm-print images in the CASIA Database



View License

Locating the ROI of Palmprint images is a popular problem in biometrics and image processing. This is the primary step in developing a biometric system based on palmprint image recognition.
The code provided here attempts to locate the ROI of a given palm print image (either left hand or right hand), assuming that the naming convention used by CASIA database is maintained.
Simple alternations of the code should make it usable even for images outside this database. The current code checks the file name to classify the image as either left hand or right hand.
The output ROI will be a 192x192 (uint8) segment of the input image.

The method employed is simple and aimed to provide an efficient calculation. However, further optimizations should be possible since these requirements were not looked into in this version.
Please refer the reference given below for a step-by-step approach to the ROI detection.

You can browse the entire CASIA database at:

References: David Zhang, Wai-Kin Kong, Jane You and Michael Wong, Online Palmprint Identification, published in IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI) Vol. 25, No. 9, September 2003

Sudaraka Mallawaarachchi - 23/07/2015

Comments and Ratings (15)

carson soh

I using CASIA Multi Spectral Palm Print Database

carson soh

I using your coding on the ROI part, but i faced alot of problem which is the error on
1) Expected MinPeakDistance to be a scalar with value < 7.
2) Index exceeds matrix dimension.
3) Wrong ROI taken.

carson soh

Dear Sir, thank you very much for supporting the coding. I would like to ask is this work on the multi spectral palm vein image? (For the extraction of ROI region)

Adi Cohen

Gaurav Singh


I have a small doubt, how do i use "bemd" function and what is it suppose to perform.

However, "DetectROI" function is very accurate and it serves the purpose.

Hello Sen,

Yes, I think you are correct. I will upload the corrected version asap.

The functions must still be working without an issue, just the outputs are mixed up I think...

Thank you very much for all the support :)


sen (view profile)

Dear Sir

 Thank you for your reply! I have some other questions.In line 16 I think it should be "ROIR(i).image", and line 23 should be "ROIL(i).image", line 24 should be "num2str(j)",so are in line 31,40, and 43, am I right? Thank you very much!

Hello Sen,

Yes, you are correct, it is my mistake, the ROI size should be 192x192, not 128x128. I'll fix that and upload again.

Thank you for the support :)


sen (view profile)

Dear Sir
      Your code is very nice.I have a question that in your code ROI size is 128 firstly( line 5 and 6 in "sample_test.m"),but at last the size is 192(line 8 and 9),why?


sen (view profile)

I have addressed all your issues and uploaded an improved code. Please check it out.

Thank you


A B (view profile)

please could you send me your paper at

Purvi Shetty

Please could you mail me your paper at


i want to do my project of master computing



Corrected a small issue with respect to the palm print size. Will not have an impact on the output...


Updated image, included reference and improved the ROI detection accuracy and added an edge detector useful for authentication

MATLAB Release
MATLAB 8.1 (R2013a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video