Skip to content

Danilaa1/cabin-detection

Repository files navigation

Deck Rectangle Scanner

Compact Next.js app that scans cruise deck-plan images, highlights cabin rectangles on top of the source image, extracts cabin numbers with OCR, and surfaces each detected cabin's fill colour.

What it does

flowchart LR
  A[Upload or load sample deck] --> B[Palette scan for repeated cabin fills]
  B --> C[Neutral cabin recovery for light cabins]
  C --> D[OCR pass for cabin labels]
  D --> E[OCR-seeded rectangle recovery]
  E --> F[Compact review UI with overlay + table]
Loading

Why this repo is useful

  • Finds repeated cabin rectangles without needing OpenCV or browser GPU tricks.
  • Recovers difficult white and light cabins with a second detector pass.
  • Uses whole-image OCR plus OCR-seeded recovery instead of expensive OCR-per-cabin loops.
  • Keeps the interface small, readable, and presentation-friendly.

Product view

  1. Load a bundled sample deck or upload your own deck-plan image.
  2. Run one scan.
  3. Inspect detected cabins directly on the image, then review the active cabin data in the side rail.

Repo layout

src/
  app/
    api/analyze-deck/route.js   # server endpoint
    page.js                     # app entry
  components/deck-scanner/      # small reusable UI pieces
  lib/
    analyzeDeckImage.js         # scan orchestrator
    deck-analyzer/              # reusable detection + OCR helpers
public/
  Royal-Deck.png
  Arivia-Deck.png

Run locally

npm install
npm run dev

Open http://localhost:3000.

Verification

npm run build
npm run audit:samples

Current scanner logic has been verified against the bundled sample deck images in public/.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages