Ocx Documentation
Ocx Documentation
Overview
The Docscanner project is an ActiveX control (OCX) designed for fingerprint acquisition,
processing, and matching. It serves as a comprehensive solution for biometric identification
systems, particularly those requiring fingerprint-based authentication or identification.
Purpose
The primary purpose of the Docscanner project is to provide a robust, embeddable component
that enables applications to:
1. Acquire fingerprint images from hardware scanners
2. Process these images to enhance quality and extract features
3. Compress fingerprint data using industry-standard algorithms
4. Match fingerprints against stored templates
5. Support various fingerprint-related operations in a secure and efficient manner
Scope
The scope of the Docscanner project encompasses:
1. Hardware Integration: Interfacing with TWAIN-compatible scanners to acquire
fingerprint images
2. Image Processing: Enhancing, rotating, and segmenting fingerprint images
3. Feature Extraction: Identifying and extracting minutiae points from fingerprints
4. Compression: Implementing WSQ (Wavelet Scalar Quantization) compression for
efficient storage
5. Pattern Classification: Categorizing fingerprints into standard pattern types
6. Barcode Reading: Supporting barcode recognition for document processing
7. Multilingual Support: Providing interfaces in multiple languages
Technical Architecture
Component Structure
The Docscanner project is structured as an ActiveX control with several key components:
1. Core Control Class: “CDocscannerCtrl” serves as the main interface between host
applications and the fingerprint processing functionality.
Technology Stack
The project leverages several key technologies:
1. C++ and MFC: The core application is built using C++ with Microsoft Foundation Classes
for the UI components.
2. ActiveX: The application is packaged as an ActiveX control for easy embedding in other
applications.
3. OpenCV: Extensive use of OpenCV for image processing tasks, with support for:
Workflow
The typical workflow of the Docscanner component follows these steps:
1. Initialization: The ActiveX control is initialized when embedded in a host application.
2. Configuration: Scanner and processing parameters are configured through the control’s
properties.
4. Pre-processing:
9. Matching (if applicable): Fingerprints are compared against stored templates for
identification or verification.
Integration Points
The ActiveX control provides several integration points for host applications:
1. Methods: Functions that can be called to perform specific operations.
3. Events: Notifications that are sent to the host application when specific conditions
occur.
Facts4TwainScanner Architecture
The Facts4TwainScanner class encapsulates all scanner-related functionality, providing a high-
level interface for:
1. Scanner Connection Management :
4. Implements the data transfer mechanisms The TWAIN protocol follows a state-based
model with the following states:
5. PRE_SESSION
6. SOURCE_MANAGER_LOADED
7. SOURCE_MANAGER_OPEN
8. SOURCE_OPEN
9. SOURCE_ENABLED
10. TRANSFER_READY
11. TRANSFERRING
The Facts4TwainScanner class abstracts these states, providing a simpler interface for the
application while ensuring proper state transitions according to the TWAIN specification.
Architecture Overview
The CDocscannerCtrl class implements the ActiveX control interface defined in Docscanner.idl ,
exposing methods and properties that can be accessed by host applications. The control is
registered with the system through the CDocscannerCtrlFactory::UpdateRegistry method,
which adds the necessary registry entries for COM integration.
The control’s unique identifiers are defined in Docscanner_i.c , including:
• Library ID (LIBID_DocscannerLib): B56E4061-DF7C-4FCD-A3CD-37D6643A4D1D
• Interface ID (DIID__DDocscanner): B28EBB45-86C9-4D96-B837-E9B4A0F319EE
• Events Interface ID (DIID__DDocscannerEvents): 9DFC54D3-1392-4FE4-99A3-
9E55921400D8
• Class ID (CLSID_Docscanner): 6AA1BD16-C335-4A60-A6EE-2EFC195EAE07
Core Functionality
The CDocscannerCtrl class provides comprehensive functionality for fingerprint acquisition,
processing, and feature extraction:
1. Scanner Configuration
The control allows host applications to configure scanner parameters through
the following methods:
• CDocscannerCtrl::SetWindow : Defines the scanning area in inches (X, Y, width,
height)
• CDocscannerCtrl::SetBrightness : Sets the brightness level for scanning
• CDocscannerCtrl::SetRes : Sets the horizontal and vertical resolution in dots per inch
2. Image Acquisition
3. Fingerprint Processing
4. Feature Extraction
The control provides methods for extracting features from fingerprint images:
The control includes methods for compressing and converting fingerprint images:
• CDocscannerCtrl::GetJpegBuffer : Compresses a fingerprint image using JPEG and
returns it as a base64-encoded string
6. Barcode Reading
The control includes a method for reading barcodes from scanned images:
Data Management
The CDocscannerCtrl class manages several types of data:
1. Scanner Configuration Data
The class maintains member variables for scanner configuration:
• m_StartX , m_Starty , m_Width , m_Height : Define the scanning area
2. Image Data
3. Processing Parameters
3. Compression Libraries
• Noise reduction
• Ridge enhancement
• Power transformation
2. Fingerprint Segmentation
• Coordinate-based extraction
3. Feature Extraction
• Minutiae detection
• SetWindow(double StartX, double StartY, double width, double height): Defines the
scanning area in inches. The parameters specify the top-left corner (StartX, StartY) and
the dimensions (width, height) of the area to be scanned. This method calls the
underlying TWAIN interface’s setWindow function.
• SetBrightness(long Brightness): Sets the brightness level for scanning. The parameter
ranges typically from 0 to 255, with higher values producing brighter images. This
method calls the underlying TWAIN interface’s setBrightNess function.
• SetRes(long Xres, long Yres): Sets the horizontal and vertical resolution in dots per inch.
Higher resolution values produce more detailed images but require more memory. This
method calls the underlying TWAIN interface’s setResolution function.
• OpenScanner(): Opens a connection to the scanner without showing the scanner’s UI.
Returns TRUE if successful, FALSE otherwise.
• OpenScannerWithUI(): Opens a connection to the scanner and shows the scanner’s UI,
allowing the user to configure scanner settings. Returns TRUE if successful, FALSE
otherwise.
• GetJpegBuffer(): Compresses the scanned image using JPEG compression and returns it
as a base64-encoded string. This method is useful for web applications that need to
display the scanned image.
• SetPrintMode(short print_type): Sets the type of print being processed (rolled, plain, or
chance).
Utility Methods
• GetImageDepth(): Returns the color depth (bits per pixel) of the scanned image.
This comprehensive set of methods enables the CDocscannerCtrl class to provide robust
fingerprint processing capabilities while maintaining flexibility for integration into various host
applications.