Error using hsv2rgb (line 59) MAP must be a Mx3 array. Error in hsvdwt (line 35) rgbimg=hsv2rgb(hsvimg);

1 回表示 (過去 30 日間)
shivu shetty
shivu shetty 2018 年 3 月 31 日
編集済み: DGM 2022 年 4 月 24 日
ima = imread('w4.jpg');
HSV = rgb2hsv(ima);
H = HSV(:,:,1);
S = HSV(:,:,2);
V = HSV(:,:,3);
SE = strel('line',11,90);
H = imdilate(H,SE);
S = imdilate(S,SE);
V = imdilate(V,SE);
[hca1,hch1,hcv1,hcd1] = dwt2(H,'bior1.3');
[sca1,sch1,scv1,scd1] = dwt2(S,'bior1.3');
[vca1,vch1,vcv1,vcd1] = dwt2(V,'bior1.3');
LH = hch1+hcv1+hcd1;
LS = sch1+scv1+scd1;
LV = vch1+vcv1+vcd1;
%a=idwt2(LH,hch1,hcv1,hcd1,'bior1.3');
%figure,imshow(a);
%b=idwt2(LS,sch1,scv1,scd1,'bior1.3');
%figure,imshow(b);
%c=idwt2(LV,vch1,vcv1,vcd1,'bior1.3');
%figure,imshow(c);
%hsvimg=a+b+c;
a = LH+LS+LV;
h = hch1+sch1+vch1;
v = hcv1+scv1+vcv1;
d = hcd1+scd1+vcd1;
hsvimg = idwt2(a,h,v,d,'bior1.3');
figure,imshow(hsvimg); title('reconstructed image');
rgbimg = hsv2rgb(hsvimg);
figure,imshow(rgbimg); title('reconstructed rgb image');
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 3 月 31 日
I suspect that you are getting a 2D array at that point. Typically you need to reconstruct the channels separately and put them together to get a 3d array suitable for hsv2rgb

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by