MATLAB Answers

How to select rectangle ROI in the image and adjust the position of ROI manually. Then it can return the adjusted ROI position

조회 수: 3(최근 30일)
chihyu
chihyu 2021년 9월 11일
댓글: Matt J 2021년 9월 18일
I can generate roi using images.roi.Rectangle function, but it is easy to be time-consuming during the adjustment process.
Is there any way to write that allows me to manually adjust the roi size and position in the image, and return the pixel value of the roi adjusted position
close all
I = imread('rice.png'); % your input image
figure, imshow(I);
roi = images.roi.Rectangle(gca,'Position',[80,45,80,100]);

채택된 답변

Matt J
Matt J 2021년 9월 11일
편집: Matt J 2021년 9월 11일
h=drawrectangle();
wait(h);
You must double-click on the rectangle to confirm its position and return control to Matlab.
  댓글 수: 2
Matt J
Matt J 2021년 9월 18일
You're welcome, but please Accept-click the answer to indicate that it resolved your question.

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

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by