Error using imadjust>checkRange (line 306) Function imadjust expected its second input argument, [LOW_IN; HIGH_IN] photo editing

Respuestas (1)

imadjust() does not work with RGB images, so it can't take scaling parameters for each color channel. If you want to brighten your RGB image for display, use rescale().

9 comentarios

Error using vertcat
Dimensions of arrays being concatenated are not consistent.
I have same error
app.TempEffect =rescale(app.Modified ,[app.LowR app.LowG app.LowB; app.HighB app.HighG app.HighR ],[]);
imadjust does work for rgb in R2020b, but possibly the user is using an earlier release.
that is the wrong calling sequence for rescale
app.TempEffect = rescale(app.Modified ,reshape([app.LowR app.LowG app.LowB], [1,1,3]), reshape([app.HighB app.HighG app.HighR],[1,1,3]));
are you using R2020a or R2020b?
lb = [app.LowR app.LowG app.LowB];
assert(numel(lb) == 3, "lb unexpectedly has %d elements", numel(lb)) ;
ub = [app.HighR app.HighG app.HighB];
assert(numel(ub) == 3, "ub unexpectedly has %d elements", numel(ub)) ;
app.TempEffect = rescale(app.Modified ,reshape([lb, [1,1,3]), reshape(ub,[1,1,3]));
I speculate that one of the slider Value is empty.
assert(isscalar(app.LowR), "LowR is size %s", mat2str(size (app.LowR)))
and similar for the other bounds
imadjust() does support RGB and full 2x3 limit specification for both lower and upper bounds, and it has for years prior to 2020. The following code was tested in R2009b:
A = imread('peppers.png');
B = imadjust(A,[0.1 0.2 0.3; 0.9 0.9 0.9],[0.1 0.2 0.3; 0.8 0.9 1],1);
imshow(B)
... but it won't work if the input image is single-channel and you give it overspecified limit parameters. Check your input images for class and depth and handle them accordingly.
A = imread('cameraman.tif');
B = imadjust(A,[0.1 0.2 0.3; 0.9 0.9 0.9],[0.1 0.2 0.3; 0.8 0.9 1],1);
Error using imadjust>checkRange
Function imadjust expected its second input argument, [LOW_IN; HIGH_IN]
to be a two-element vector.

Error in imadjust>parseInputs (line 266)
checkRange(lowhigh_in, imageType, 2,'[LOW_IN; HIGH_IN]');

Error in imadjust (line 105)
parseInputs(varargin{:});
It also doesn't support RGB inputs for the short (implicit lower bound) syntax. That requires the explicit use of stretchlim().

Iniciar sesión para comentar.

Preguntada:

el 13 de Nov. de 2020

Comentada:

DGM
el 13 de Nov. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by