Syntax
imshow4(I)
Input Parameter
I : | | RGB image or grayscale |
Examples
I=imread('peppers.png');
imshow4(I)
imshow4(imresize(I,[640 nan]))
imshow4(rgb2gray(I))
imshow4(rgb2ntsc(I))
imshow4(sum(I,3))
Copyright 2018-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This algorithm is designed to display RGB images in four color segments, helping to understand the color channels of an image. It is part of the SG-Library and was introduced in SolidGeometry 4.3.
Input Parameters
- I: The input image, which can be an RGB image or a grayscale image.
- varargin: Optional parameters that can be passed to the function.
Algorithm Steps
- Retrieve the maximum row and column size using the function
getfuncparams
with the first optional parameter.
- If
maxrc
is not empty, determine the resize dimensions irs
based on the image's aspect ratio. Resize the image I
using imresize
to fit these dimensions.
- Calculate the minimum and maximum color values in the image
I
and store them in cmin
and cmax
.
- Suppress specific warnings related to image size adjustments using
warning('off','images:initSize:adjustingMag')
.
- Check if the image
I
is grayscale (i.e., it has only one channel). If so, display the image in a single subplot with the title indicating intensity and color axis range.
- If the image is RGB (i.e., it has three channels), display the full image in one subplot and each color channel (Red, Green, Blue) in separate subplots. Each subplot is titled with the respective channel name and image size.
- Restore the previous warning state using
warning(wstat)
.
- Use
shg
to bring the figure window to the front.
Algorithm explaination created using ChatGPT on 2025-08-19 07:16. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21