This function reads an image from a file path and resizes it to a specified number of rows.
It supports several image formats, including JPG, JPEG, PNG, TIFF, and TIF. The function
also converts the image into a suitable format for further processing.
Usage
readImage(path, resizeRows)
Value
A cimg object containing the resized image.
Arguments
path
The file path of the image to be read.
resizeRows
The desired number of rows (height) to resize the image.
The aspect ratio of the image will be maintained during resizing.
Details
The function detects the image format based on the file extension. It currently supports
the following formats: JPG, JPEG, PNG, TIFF, and TIF. If the image has more than 3
dimensions (such as an RGBA image with an alpha channel), the alpha channel is discarded.
The image is resized only if its height exceeds the specified `resizeRows`.