How to resolve this error "Error using histeq Expected input number 1, I, to be two-dimensional. Error in histeq (line 69), validateattributes(a,{'uint8','uint16','double','int16','single'}, ... Error in (line 3)" ?
조회 수: 1 (최근 30일)
이전 댓글 표시
clc;
clear all;
g=histeq(imread('img.tiff'));
r=histeq(imread('img1.tiff'));
nir=histeq(imread('img2.tiff'));
figure;
imshow(g);
댓글 수: 3
Mira mosad
2022년 3월 25일
Check your image if the image is 3D convert it to 2D . Bu using this function Image = im2gray(Image);
답변 (1개)
KALYAN ACHARJYA
2018년 3월 14일
편집: KALYAN ACHARJYA
2018년 3월 14일
First Convert 'img.tiff' into a gray level then only apply the histeq.
g=histeq(rgb2gray(imread('img.tiff')));
댓글 수: 1
DGM
2023년 11월 27일
Note that as of R2017a, histeq() supports N-D inputs, so this specific error shouldn't be seen when feeding histeq() an RGB image anymore.
That said, it's still worth asking whether it's appropriate or intended to be operating on the channels of an RGB image independently -- or whether it's appropriate to assume any particular 3-channel image is RGB.
The answer depends on the images and the intent. Given the variable naming, I have to wonder if these were in fact not normal RGB images. Just a thought.
참고 항목
카테고리
Help Center 및 File Exchange에서 Modify Image Colors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!