Plot an Ellipse to show the orientation of an image
3 次查看(过去 30 天)
显示 更早的评论
Hi, I am trying to plot an ellipse to show the orientation of an image.
So far I have written the code
clear all; clc; close all;
im = iread('Dog.jpg','grey','double') %Reads the image and converts it to greyscale
ithresh(im); %used to determine the threshold value to represent the dog
im = (im<0.5); %Performs the segmentation
im1 = (im<0.5);
idisp(im) %Displays the image
%Plots an ellipse that shows the orientation of the dog
f = iblobs(im);
hold on
f.plot_ellipse()
It should plot an ellipse to show the orientation but it's not working as I wanted to.
0 个评论
回答(1 个)
Jonathan Troville
2020-5-12
编辑:Jonathan Troville
2020-5-12
When referencing Peter Corke's code for iblobs it appears that it generates a vector of Region Features, where plot_ellipse is an object of that class. Therefore, the ellipse needs to be defined before plotting it.
Set major and semi major axes as options in "iblobs" as well as the orientation of the ellipse. Please refer again to Peter Corke's iblobs page in which he defines the aforementioned options. I hope this points you in the right direction.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modify Image Colors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!