npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@armghan3071/omrchecker

v1.0.2

Published

High-performance client-side OMR engine using OpenCV.js

Readme

OMR Checker Library

A powerful, client-side Optical Mark Recognition (OMR) engine for JavaScript. Process bubble sheets, exams, and surveys entirely in the browser using OpenCV and Web Workers.

Features

  • 🚀 Client-Side Processing: No server required. All image processing happens locally.
  • Non-Blocking: Uses a dedicated Web Worker to keep your UI responsive.
  • 🎯 High Accuracy: Algorithms for rotation correction and perspective warping.
  • 📄 Batch Support: Process hundreds of images in a single loop.
  • 🛠 Layout Debugging: Built-in tools to visualize grid alignment.

Installation

npm install @armghan3071/omrchecker

Vanilla JS Example

import { OMRChecker } from '@armghan3071/omrchecker';

const engine = new OMRChecker();

document.getElementById('scanBtn').addEventListener('click', async () => {
  const fileInput = document.getElementById('fileInput');
  const files = Array.from(fileInput.files);
  
  // Load Template & Marker
  const template = { ... }; // Your JSON object
  const marker = await fetch('marker.jpg').then(res => res.blob());

  const results = await engine.process(files, template, marker);
  console.log(results);
});

API Reference

new OMRChecker(config = {})

  • config (Object): Optional configuration object.
    • cv: If you are using Open CV in your existing project
    • includeOutputImages:: True if you want to include markedImage during grading section

async process(files, template, marker, setLayout)

  • files (File[]): Array of browser File objects (images).
  • template (Object): The JSON template object defining bubble positions.
  • marker (Blob|File): The image file used for alignment markers (must match the visual marker on the paper).
  • setLayout (Boolean):
    • false (default): Returns CSV grading results.
    • true: Returns images with grid overlays (useful for debugging layouts).

terminate()

  • Instantly kills the background worker and frees memory. Call this when the component is destroyed.

Configuration

The template.json defines where the engine should look for bubbles.

{
  "pageDimensions": [
    1189,
    1682
  ],
  "bubbleDimensions": [
    30,
    30
  ],
  "preProcessors": [
    {
      "name": "CropPage",
      "options": {
        "morphKernel": [
          10,
          10
        ]
      }
    },
    {
  "name": "CropOnMarkers",
  "options": {
    "relativePath": "omr_marker.jpg",
    "sheetToMarkerWidthRatio": 17,     
    "min_matching_threshold": 0.3,
    "marker_rescale_range": [20, 100]      
  }
}
  ],
  "fieldBlocks": {
    "MCQBlock1": {
      "fieldType": "QTYPE_MCQ4",
      "origin": [
        134,
        684
      ],
      "fieldLabels": [
        "q1..11"
      ],
      "bubblesGap": 79,
      "labelsGap": 62
    }
  }
}

Credits & References

This project is a JavaScript adaptation and port of the original OMRChecker by Udayraj123. It brings the robust grading logic of the Python-based engine directly to the web for high-performance, client-side processing.

The development and technical architecture of this library were made possible through:

  • Primary Logic Source: Inspired by the Python OMR system developed by Udayraj123, leveraging his research into rotation, perspective correction, and grid-based bubble detection.
  • Core Image Engine: Powered by OpenCV.js, the official JavaScript port of the Open Source Computer Vision Library.
  • AI Collaboration: This project was architected, debugged, and documented with the strategic assistance of Gemini 3 Pro. The AI code assistant played a critical role in optimizing Web Worker communication, resolving complex Vite/Webpack bundling issues, and implementing minification-safe class structures.

License

MIT