How to resolve this error "Error using histeq Expected input number 1, I, to be two-dimensional. Error in histeq (line 69), validateat​tributes(a​,{'uint8',​'uint16','​double','i​nt16','sin​gle'}, ... Error in (line 3)" ?

6 ビュー (過去 30 日間)
ARUN V
ARUN V 2018 年 3 月 14 日
コメント済み: DGM 2023 年 11 月 27 日
clc;
clear all;
g=histeq(imread('img.tiff'));
r=histeq(imread('img1.tiff'));
nir=histeq(imread('img2.tiff'));
figure;
imshow(g);
  3 件のコメント
Mira mosad
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
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
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.

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by