Plot an Ellipse to show the orientation of an image

6 ビュー (過去 30 日間)
Justin Delmo
Justin Delmo 2020 年 5 月 12 日
編集済み: Jonathan Troville 2020 年 5 月 12 日
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.

回答 (1 件)

Jonathan Troville
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.

Community Treasure Hunt

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

Start Hunting!

Translated by