How andrewthe13th/inventory_kamera works
Project Type and Purpose
• This is a desktop Windows application built with C# (using Visual Studio) that performs OCR-based scanning of the Genshin Impact inventory. Its purpose is to capture screenshots of in-game inventory, parse various game items (characters, weapons, artifacts, etc.), and export the results in a JSON-based format (.GOOD) for use with other Genshin Impact tools.
• The README emphasizes its role as a “Genshin Data Scanner” that uses trained OCR models (see the tessdata folder) and integrates with external resources for updating lookup tables.
Main Components
a. User Interface (UI):
• WinForms UI components found in the “ui” folder.
• Main forms (MainForm, MainUI, ExecutablesForm) that handle user interactions, trigger scanning, and display results.
b. Data Processing / Scraping Module:
• This relates directly to the “scraping” directory. It contains specialized classes (e.g. ArtifactScraper, CharacterScraper, GenshinProcesor) that process screenshots and extract data using OCR.
• That these components interact with the OCR engine (indicated by the tessdata folder containing Tesseract training files).
c. Game Data and Business Logic:
• Encapsulated in the “data” and “game” directories. The “data” folder includes classes for managing database interactions (DatabaseManager, Inventory) as well as utility classes (OCRImageCollection, Rect).
• The “game” directory models in-game entities (Artifact, Character, Navigation, Weapon).
d. OCR Engine and Tessdata:
• Although not a separate code module, the “tessdata” folder contains the trained data used by the OCR routines in the scraping components. Indicate a dependency here, showing that the scraping module uses these resources to extract text.
Relationships and Interactions
• The UI layer acts as the entry point, providing controls for initiating scans. It then calls into the scraping module.
• The scraping module processes screenshots using the OCR engine (with tessdata as its resource) and extracts structured game data.
• Extracted information is passed to the data layer and business logic modules (“data”, “game”) that organize the results and prepare JSON exports.
• An “Export” component/function (triggered from the UI) takes the processed data and writes it to a file in the GOOD format.
Architectural Patterns and Design Principles
• The system is modular, with a clear separation between UI (presentation), data processing (scraping/OCR), and business logic (models and data management). This resembles an MVC-like separation even if loosely implemented.
• Components such as the scraping module and lookup table updater (as described in the README) hint at both loosely coupled modules and external integration with resources like the Anime Game Data Repo.
Key Points
• This approach will provide an accurate visual representation of how the Inventory Kamera application functions as a scanner that captures, processes, and exports Genshin Impact inventory data.