Arithmetic exception inside Extract

General information about Neurotechnology and its software

Arithmetic exception inside Extract

Postby erelender » May 03, 2019 07:17

We"re using the 30 day trial mode of FingerCell to evaluate and integrate into our app, but I"m having a problem with feature extraction from images constructed from in memory data. The fingerprint scanner sdk i use gives 300x400 grayscale raw image data. Here"s the code that I use:

Code: Select all
uint32_t w = d->deviceInfo.ImageWidth; //300
uint32_t h = d->deviceInfo.ImageHeight; //400

FingerCell fingerCell;

NBuffer buffer(w*h);
memcpy(buffer.GetPtr(), d->imageBuffer, w*h);

NImage image = NImage::FromData(NPF_GRAYSCALE_8U, w, w, h, w, buffer, 0, 0, w, h);
//NImage image = NImage::GetWrapper(NPF_GRAYSCALE_8U, w, h, w, d->imageBuffer, w*h, false);
//NImage image = NImage::FromFile("./VeriFinger_Sample_DB/012_3_7.tif");

NBuffer fpTemplate = fingerCell.Extract(image);

The "test.png" file that I use is saved correctly (no pixel shift/stride problem etc.), this implies that there was no problem importing the raw image data into NImage. But the extract method crashes with SIGFPE, Arithmetic exception. I"m not sure what the problem can be.

Additional info:
- Creating the NImage from the saved "test.png" also causes the same crash
- Loading a .tiff image from the sample db does not cause a crash.
Posts: 2
Joined: May 03, 2019 06:43

Re: Arithmetic exception inside Extract

Postby MartynasV » May 06, 2019 10:49


I don't see you setting resolution(DPI) on image. You need to set TRUE resolution(DPI) for image, you can do that with some program(e.g. IrfanView) or via code like shown bellow.
Code: Select all
NImage image = NImage.FromFile(@"IMAGE_PATH"); //load image.
image.SetVertResolution(500); // Set vertical resolution
image.SetHorzResolution(500); // Set horizontal resolution
// Extract
Martynas V
Posts: 513
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: Arithmetic exception inside Extract

Postby erelender » May 07, 2019 07:07

Thank you, that solved the problem.
Posts: 2
Joined: May 03, 2019 06:43

Return to Public

Who is online

Users browsing this forum: No registered users and 2 guests