Plot an Ellipse to show the orientation of an image

5 Ansichten (letzte 30 Tage)
Justin Delmo
Justin Delmo am 12 Mai 2020
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.

Antworten (1)

Jonathan Troville
Jonathan Troville am 12 Mai 2020
Bearbeitet: Jonathan Troville am 12 Mai 2020
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