|
WSQ image library adds the power of WSQ (FBI's Wavelet Scalar Quantization) file format to your software projects using only a few lines of code.
The source code of WSQ image library contains 20,099,433 lines of code and saves you months of tedious work.
The library also supports 11 other graphic file formats and allows conversion between them.
Click here for Free WSQ Viewer (for Linux) which demonstrates capabilities of WSQ image library.
Linux 64-bit version of WSQ image library is available here.
Windows version of WSQ image library is available here.
WSQ image library for Texas Instruments family microprocessors (embedded systems) is available here.
Importance of WSQ format
Electronic fingerprints submitted to the FBI either through Integrated Automated Fingerprint Identification System (IAFIS), or Electronic Fingerprint Image Print System (EFIPS) may not be compressed with any technique other than WSQ.
Price of WSQ image library
WSQ image library (for Linux 32-bit) costs
253.00 U.S. dollars for the first licence (single developer licence) and 19.00 U.S. dollars per every additional licence (client computer), which is the lowest price on the market.
WSQ image library (for Linux 32-bit) runtime free / royalty free license costs 4000.00 U.S. dollars.
Linux 32-bit, Linux 64-bit, and Windows versions of WSQ Image Library are considered separate products and each has its own pricing.
The multiplatform package (for Linux 32-bit and Windows) of WSQ Image Library runtime free / royalty free license has a discount price of 6000.00 U.S. dollars.
The multiplatform package (for Linux 64-bit and Windows) of WSQ Image Library runtime free / royalty free license has a discount price of 6000.00 U.S. dollars.
The multiplatform package (for Linux 32-bit and Linux 64-bit) of WSQ Image Library runtime free / royalty free license has a discount price of 5000.00 U.S. dollars.
The multiplatform package (for Linux 32-bit, Linux 64-bit and Windows) of WSQ Image Library runtime free / royalty free license has a discount price of 7000.00 U.S. dollars.
To order WSQ image library please click here
WSQ image library (for Linux 32-bit) specifications
Table 1 Supported formats for reading
| Format | Description
| | WSQ | FBI's Wavelet Scalar Quantization
| | BMP | Windows Bitmap Graphics
| | TIFF | Macintosh Tagged Information File Format images
| | TIF | PC Tagged Information File Format images
| | JPG, JPEG | Joint Photographic Experts Group images
| | PNG | Portable Network Graphics images
| | GIF | Compuserve Graphic Interchange Format images
| | TGA | Truevision Targa Graphic images
| | PCX | ZSoft Paintbrush images (PC Paintbrush Bitmap Graphic)
| | RGB | Silicon Graphics International true color images
| | PSD | Photoshop images
| | CEL | Autodesk images / Animator Graphic (FLC and FLI formats)
| | IFF | Amiga Bitmap Graphic (8 bits)
|
Table 2 Supported formats for writing
| Format | Description
| | WSQ | FBI's Wavelet Scalar Quantization
| | BMP | Windows Bitmap Graphics
| | TIF | Tagged Information File Format (no LZW compression)
| | PNG | Portable Network Graphics
| | JPG | Joint Photographic Experts Group
| | RGB | Silicon Graphics International (uncompressed)
| | TGA | Truevision Targa Graphic
|
Table 3 Format of WSQ image library
| Feature | Format
| | Operating system | Linux 32-bit (x86 platform)
| | Library format | Shared Library (*.so)
| | Format of exported functions | C language
| Calling convention of exported functions (default) | __cdecl
| Calling conventions of exported functions available through additional wrapper DLL interface | JNIEXPORT
| | Internal engine | C++
|
Table 4 Functions available in the library
| Function | Description
| | int ReadImageFromFile(const char* fileName, int* width, int* height, unsigned char** imageData) | Creates an image data array from an image file. The extension of the file name determines the file type. Returns an 1 if successful, 0 otherwise.
| | int SaveImageToFile(const char* fileName, int filetype, int width, int height, unsigned char* imageData) | Saves the contents of an image data array to a file. Returns 1 if successful, 0 otherwise.
"filetype" denotes integer with possible values: 1 - WSQ 2 - Windows BMP 3 - TIFF 4 - PNG 5 - JPEG 6 - Targa 7 - RGB
| | char* GenerateSerialNumber() | Generates serial number for registration of WSQ image library.
| | int UnlockWSQLibrary(char* authorization_code) | Registers WSQ image library on the computer. Returns 1 if successful, 0 otherwise.
| | void WriteWSQ_bitrate(double bitrate) | Sets current WSQ bitrate. For example 0.75, 2.25 (-1.0 if unknown)
| | double ReadWSQ_bitrate() | Reads current WSQ bitrate. For example 0.75, 2.25 (-1.0 if unknown)
| | void WriteWSQ_ppi(int ppi) | Sets current WSQ ppi (pixels per inch). Value "-1" is used for unknown ppi.
| | int ReadWSQ_ppi() | Reads current WSQ ppi (pixels per inch). Value "-1" is used for unknown ppi.
| | void WriteWSQ_comment(char *comment) | Sets current WSQ comment text.
| | char* ReadWSQ_comment() | Reads current WSQ comment text.
| | void WriteTIFFcompression(int tiff_compression) | Sets the TIFF compression type. Available options are:
0 - NONE
1 - ZIP compression
(if ZIP compression is used, you also need to set TIFF "predictor" parameter)
2 - MACINTOSH compression
| | void WriteTIFFpredictor(int tiff_predictor) | Sets the TIFF ZIP compression predictor value.
| | int WSQ_decode_stream(unsigned char *input_data_stream, const int input_stream_length, unsigned char **output_data_stream, int *width, int *height, int *ppi, unsigned char **comment_text) | Decodes memory stream (memory block) from WSQ format into uncompressed format. Returns 1 if successful, or error code otherwise.
| | int WSQ_encode_stream(unsigned char *input_data_stream, const int width, const int height, const double bitrate, const int ppi, char *comment_text, unsigned char **output_data_stream, int *output_stream_length) | Encodes memory stream (memory block) from uncompressed format into WSQ format. Returns 1 if successful, or error code otherwise.
|
WSQ format description
In the USA, fingerprints have traditionally been collected on cards, each card containing the inked impressions of all ten fingers. The U.S. Federal Bureau of Investigation's fingerprint database began in 1924 with a cataloged collection of 810,188 cards. By the start of World War II, this collection had grown to over 10 million cards, and by 1946 had reached over 100 million cards.
In 1995 this collection was contained on over 200 million cards stored in filing cabinets occupying one acre of floor space in the J. Edgar Hoover building in Washington D.C. and archive size was increasing at the rate of 30,000 to 50,000 new cards per day.
Digitization of fingerprint cards seemed to be the most obvious choice and the project named FBI's Integrated Automated Fingerprint Identification System (IAFIS) was started to cope with the design and implementation of a national standard for collecting, encoding, storing, and retrieving digitized fingerprint images. According to the FBI standard fingerprints are stored as 8-bit grayscale images. Each fingerprint card, when digitized at 500 dpi requires about 10 Mbytes of storage. The FBI's entire collection would therefore consume two petabytes (2,000,000,000 megabytes) of electronic storage space.
The need for an effective compression technique was then very urgent. Unfortunately, neither the well-known lossless methods nor the JPEG methods were found to be satisfactory. Most lossy compression methods, such as JPEG, discard the smallest (highest frequency) details in images, and at higher compression ratios unacceptably distort the image. Contained within fingerprints are tiny details that are considered admissible points of identification in a court of law. To JPEG, these details may be regarded as noise and removed. The JPEG quantization matrix also allows blocking artifacts to occur in the image at compression ratios above about 10:1. Shifting bits to the high frequencies to preserve small details will only make the blocking worse.
Lossless compression methods, such as LZW and JBIG, cannot achieve the high compression ratios of WSQ on fingerprint data, with 2:1 typically being the best.
A new compression technique (with small acceptable loss), called Wavelet Scalar Quantization (WSQ) was developed and it became the FBI standard for the compression of 500 dpi fingerprint images.
WSQ is a lossy compression method that is well-suited for preserving the very high resolution details of grayscale images while maintaining high compression ratios of typically 12:1 to 15:1 on images that have not undergone "quality enhancements" (such as histogram equalization) to improve the appearance of the image.
Table 5 WSQ file format specifications
| Feature | Description
| | Name | FBI's Wavelet Scalar Quantization file format.
Also known as: FBI Fingerprint Format or FBI WSQ
| | Application | The standard file format used by the FBI for storage and interchange of grayscale fingerprint images
| | Originator | FBI (U.S. Federal Bureau of Investigation)
| | Type | Bitmap
| | Colors | 8 bit grayscale
| | Compression | Wavelet Scalar Quantization
| | Maximum image size | 64K x 64K
| | Multiple images per file | No
|
Using WSQ image library is very easy. Only 2-3 steps and a few lines of code are needed. Several examples are provided below.
Step 1
Load WSQ library and declare its functions. Add following lines to your code:
| |
#include <stdio.h>
#include <dlfcn.h>
void* handle;
typedef int (*_ReadImageFromFile)(const char* fileName, int* width, int* height, \
unsigned char** imageData);
_ReadImageFromFile ReadImageFromFile = 0;
typedef int (*_SaveImageToFile)(const char* fileName, int file_type, int width, \
int height, unsigned char* imageData);
_SaveImageToFile SaveImageToFile = 0;
typedef int (*_RegisterWSQ)();
_RegisterWSQ RegisterWSQ = 0;
handle = dlopen ("./libWSQ_library.so", RTLD_LAZY);
ReadImageFromFile = (_ReadImageFromFile)dlsym (handle, "ReadImageFromFile");
SaveImageToFile = (_SaveImageToFile)dlsym (handle, "SaveImageToFile");
RegisterWSQ = (_RegisterWSQ)dlsym (handle, "RegisterWSQ"); |
Step 2
Call and use WSQ library functions:
| |
ReadImageFromFile(fileName, &width, &height, &data);
or
SaveImageToFile(fileName, file_type, width, height, data);
|
Step 3
Unload WSQ library. Add following lines to your code:
To download GNU C Compiler GCC 4.0.4 sample project click here here
Step 1
Load WSQ library and declare its functions. Add following lines to your code:
| |
typedef int (*ReadImageFromFile)(const char* fileName, int* width, int* height, \
unsigned char** imageData);
typedef int (*SaveImageToFile)(const char* fileName, int file_type, int width, \
int height, unsigned char* imageData);
typedef int (*RegisterWSQ)();
QLibrary* m_lib;
QString appPath = qApp->applicationDirPath();
QString libraryName = appPath + "/libWSQ_library.so";
m_lib = new QLibrary(libraryName);
ReadImageFromFile pReadImageFromFile = (ReadImageFromFile) m_lib->resolve("ReadImageFromFile");
SaveImageToFile pSaveImageToFile = (SaveImageToFile) m_lib->resolve("SaveImageToFile");
RegisterWSQ pRegisterWSQ = (RegisterWSQ) m_lib->resolve("RegisterWSQ"); |
Step 2
Call and use WSQ library functions:
| |
pReadImageFromFile(fileName, &width, &height, &data);
or
pSaveImageToFile(fileName, file_type, width, height, data); |
Step 3
Unload WSQ library. Add following line to your code:
| |
if(m_lib)
{delete m_lib;}; |
To download Trolltech Qt 3.3 C++ (KDevelop 3.3.5 [using KDE 3.3.5]) sample project click here
Click here for important notes for Sun Java developers
Step 1
Add declarations of WSQ library functions using JNIEXPORT wrapper interface:
| |
System.loadLibrary("WSQ_library_jniexport");
public static native int[] ReadImageFromFile(int[] dimension, String fileName);
public static native void SaveImageToFile(int[] data, int width, int height, String fileName, int type);
public static native void RegisterWSQ();
|
Step 2
Call and use WSQ library functions:
| |
int[] data = WSQ_Demo.ReadImageFromFile(dimension, fileName)
or
WSQ_Demo.SaveImageToFile(pixels, width, height, fileName, type) |
To download Sun Java (J2SE Development Kit 5.0 Update 7 with NetBeans IDE 5.5) sample project click here here
Step 1
Add declarations of WSQ library functions:
| |
function ReadImageFromFile (const file_name: PCHAR; width: PInteger; height: PInteger;
imageData: PPCHAR): Integer; cdecl; external 'libWSQ_library.so' name 'ReadImageFromFile';
function SaveImageToFile(const filename: PCHAR; filetype: Integer; width: Integer;
height: Integer; imageData: PCHAR):Integer;
cdecl; external 'libWSQ_library.so' name 'SaveImageToFile';
function RegisterWSQ():Integer; cdecl; external 'libWSQ_library.so' name 'RegisterWSQ';
|
Step 2
Call and use WSQ library functions:
| |
ReadImageFromFile(PCHAR(open_dialog.FileName), @width, @height, @imagedata);
or
SaveImageToFile(PCHAR(save_dialog.FileName), save_dialog.FilterIndex,
OutputImage.Picture.Bitmap.Width, OutputImage.Picture.Bitmap.Height, imagedata);
|
To download Lazarus 0.9.28.2 sample project click here
Click here for important notes for PHP developers
Step 1
Add following lines to "php.ini" file:
| |
extension=wsq.so
wsq.library_location=/path/to/libWSQ_library.so |
Step 2
Call and use WSQ library functions:
| |
//converts image from WSQ format to JPG format
wsq_convert_image("./sample_image.wsq","./output_JPG_image",5);
or
$image1 = wsq_read_image_from_file("./sample_image.wsq");
or
wsq_save_image_to_file($image2, $output_fileName, 5); //save image as JPG |
To download PHP 4.4.7 sample project click here here
|