Skip to contents

Convert RGB image to grayscale with optimized memory management and parallel processing

Usage

rgb2gray(img, r = 0.21, g = 0.72, b = 0.07)

Arguments

img

SpatRaster RGB image

r

Weight for red channel

g

Weight for green channel

b

Weight for blue channel

Examples

data(seg_Oulanka2023_Session01_T067)
img = seg_Oulanka2023_Session01_T067
gray.raster = rgb2gray(img)