필터 지우기
필터 지우기

How can I save my scalogram image?

조회 수: 12 (최근 30일)
Reid Demass
Reid Demass 2022년 3월 16일
댓글: Rik 2022년 3월 21일
I am creating a scalogram with:
img=cwt(signal);
I want to save the scalogram produced. I am looking just to save the image itself; no axes, title, key, etc.
I am trying:
exportgraphics(img,"cwt.png")
and receive errror:
Error using exportgraphics
First parameter must specify the axes or chart object.
Is img not the object I want since that is where I saved the cwt(signal)?

채택된 답변

Rik
Rik 2022년 3월 16일
Since it clears the current figure (and then creates the object, the easiest way is to this:
img=cwt(signal);
exportgraphics(gca,"cwt.png");
  댓글 수: 2
Reid Demass
Reid Demass 2022년 3월 16일
Thank you, I was able to save the image. As a follow-up, is there a way to have only the scalogram saved? For example, I was able to save the image attached test2. However, I am only looking to retain what is in test3, which I manually cropped.
I have looked through example https://www.mathworks.com/help/deeplearning/ug/classify-time-series-using-wavelet-analysis-and-deep-learning.html?s_eid=PSM_25538&cid=%3Fs_eid%3DPSM_25538%26%01Classify+ECG+Signals+Using+Wavelet+Analysis+and+Deep+Learning in which scalograms are saved using a helper function, but it is not clear to me in the function code how they are removing the unwanted components of the image.
Rik
Rik 2022년 3월 21일
load mtlb
cwt(mtlb,Fs)
h=get(gca,'Children');
h_im=findobj(h,'Type','Image');
figure,imshow(h_im.CData)
So, as you can see, you will have to rescale based on the XData and YData properties to view it properly. Then you will have to apply a colormap to convert it to a color image. (but this way you have the actual data instead of a screenshot)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by