Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Kornia Kornia Grayscale Conversion

From Leeroopedia


Knowledge Sources
Domains Vision, Color_Space
Last Updated 2026-02-09 15:00 GMT

Overview

Technique of converting multi-channel color images to single-channel grayscale representations for feature extraction and matching.

Description

Grayscale conversion reduces a 3-channel RGB image to a single luminance channel by computing a weighted sum of the color channels. The standard ITU-R BT.601 weights (R: 0.299, G: 0.587, B: 0.114) reflect human perceptual sensitivity to different wavelengths. Grayscale images are required by many feature detectors (LoFTR, SIFT, HardNet) that operate on intensity gradients rather than color information. The conversion preserves spatial structure while reducing computational cost by 3x.

Usage

Use as a preprocessing step before feature detection, edge detection, or any operation that works on image intensity rather than color. Required by LoFTR and most classical feature detectors.

Theoretical Basis

gray = 0.299*R + 0.587*G + 0.114*B

In tensor form: gray = rgb_weights @ image, where rgb_weights = [0.299, 0.587, 0.114]. Custom weights can be provided for specialized applications.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment