Plot an Ellipse to show the orientation of an image

조회 수: 3 (최근 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.

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by