imfreehand/impoly using different color other than blue
조회 수: 7 (최근 30일)
이전 댓글 표시
while i'm using imfreehand or impoly I want to change the color of the line from the beginning (I know how to change it after that I have finished the creation of the line/polygon).
댓글 수: 0
답변 (1개)
Naga
2025년 2월 11일 10:20
Starting from MATLAB R2018b, the 'imfreehand' function is not recommended, and MATLAB introduced a new set of ROI (Region of Interest) objects that offer more functionality and flexibility, including the ability to set the color of the ROI from the beginning.
To create a freehand ROI with a specific color, you can use the 'drawfreehand function', which is part of the new ROI framework. Here’s an example of how you can create a freehand ROI with a red color:
% Display the image
imshow('image.png');
% Create a freehand ROI with a specified color
h = drawfreehand('Color', 'r'); % 'r' is for red, you can use other colors like 'g', 'b', etc.
Switching to these new ROI objects will allow you to take advantage of additional capabilities, such as face color transparency and event handling.
For more detailed information, you can refer to the official MATLAB documentation on the 'drawfreehand' function: https://www.mathworks.com/help/images/ref/drawfreehand.html
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!