Error using hsv2rgb (line 59) MAP must be a Mx3 array. Error in hsvdwt (line 35) rgbimg=hsv2rgb(hsvimg);
조회 수: 1 (최근 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
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 Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!