How do you mark and extract an area from an imagesc-figure?

조회 수: 14 (최근 30일)
Frederik Schmidt
Frederik Schmidt 2020년 10월 22일
편집: Adam Danz 2021년 2월 10일
Hi guys,
I'm looking for a tool that works in a similar way to Matlab's brush tool.
I graph a spectrogram of a signal, i.e. a 2D array, using imagesc. In this spectrogram I would like to manually mark a certain area and extract the data within this area. For this purpose I tried to use Matlab's brush tool. But obviously it doesn't work for imagesc-figures. Can you help me and suggest solutions? Is there another tool from Matlab that works for imagesc-figures?
Thanks for your help.

채택된 답변

Adam Danz
Adam Danz 2020년 10월 22일
편집: Adam Danz 2021년 2월 10일
"I would like to manually mark a certain area and extract the data within this area."
There's a few things you could do. Check out
Requiring Image Processing Toolbox:
See ROI creation overview for details.
You can use these tool to select a region and return the coordinates of your selection. Then you can use those coordinates to isolate a section of your data.
  댓글 수: 1
Frederik Schmidt
Frederik Schmidt 2020년 10월 27일
Thanks for your help.
The function drawrectangle is the one I've needed.

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

추가 답변 (1개)

Image Analyst
Image Analyst 2020년 10월 23일
See my attached masking demo.
  댓글 수: 1
Frederik Schmidt
Frederik Schmidt 2020년 10월 27일
Thanks for your help, too.
The trick with the binaryImage is a good one.

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

Community Treasure Hunt

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

Start Hunting!

Translated by