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

9 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by