65.9K
CodeProject is changing. Read more.
Home

WSQ to BMP converter

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.93/5 (12 votes)

Jul 27, 2012

CPOL
viewsIcon

69820

downloadIcon

3312

A WSQ to BMP converter.

Introduction

This is a C# conversion of JNBIS, a decoder library for WSQ images. JNBIS is written in Java. The code basically has been converted from NBIS Version 1.1 which was written in the C programming language. The NBIS (NIST Biometric Image Software) distribution was developed by NIST (National Institute of Standards and Technology) for the FBI (Federal Bureau of Investigation) and DHS (Department of Homeland Security).

Using the code

Using this converter is straightforward:

FileStream fs = File.OpenRead(@"C:\sample_image.wsq");
byte[] fileData = new byte[fs.Length];
fs.Read(fileData, 0, fileData.Length);
 
WsqDecoder decoder = new WsqDecoder();
Bitmap bmp = decoder.Decode(fileData);
bmp.Save(@"C:\sample_image.bmp");

You can use the WSQ sample image file from the Cognaxon website.