Help: What are the differences between lwt2 in previous versions and the current version?
조회 수: 4 (최근 30일)
이전 댓글 표시
I saw someone using it in MATLAB 2018a with the syntax [CA,CH,CV,CD]=LWT2(img,'haar');. On the official website, I found that after version 2021 it should be written as [CA,CH,CV,CD]=LWT2(img,Wavelet='haar');.
When I ran [CA,CH,CV,CD]=LWT2(img,Wavelet='haar'); in MATLAB 2024a, the CA I got was a double-type 1x1 matrix, which is a single double value.
However, when I ran [CA,CH,CV,CD]=LWT2(img,'haar'); in MATLAB 2018a, the CA was a double-type matrix of size M/2 by N/2, where M and N are the dimensions of img.
why the two CA results are different?
need your help
Thanks
img![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1787655/image.bmp)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1787655/image.bmp)
code in 2024a:
img=imread('lake.pgm');
img=im2double(img);
[CA, CH, CV, CD] = lwt2(img,Wavelet='haar');
disp(CA);
code in 2018a
img=imread('lake.pgm');
img=im2double(img);
[CA, CH, CV, CD] = lwt2(img,'haar');
disp(CA);
댓글 수: 0
채택된 답변
Hitesh
2024년 10월 9일
편집: Hitesh
2024년 10월 9일
Starting with MATLAB R2021b, the syntax for the “lwt2”function has been updated. Previously, the "lifewave"object was used, but it has now been replaced by the "liftingScheme"object. To obtain CA as a double-type matrix of size M/2 by N/2, where M and N are the dimensions of “img”, the “liftingScheme”object needs to be passed to the "lwt2"function along with its level.
Kindly refer to the code below:
img=imread('image.bmp');
img=im2double(img);
lScheme = liftingScheme("Wavelet","haar");
[CA, CH, CV, CD] = lwt2(img,LiftingScheme=lScheme,Level=1);
disp(CA);
For more information on "liftingScheme" object and “lwt2” function, refer to below documentation. https://www.mathworks.com/help/wavelet/ref/liftingscheme.html#:~:text=lscheme%20%3D%20liftingScheme(%27Wavelet%27%2Cwname) https://www.mathworks.cn/help/wavelet/ref/lwt2.html#:~:text=lwt2%20input%20syntax%20has%20changed
Hope this clarifies the issue!
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!