Reputation: 309
In the script below I outline an object but in the final plot I have noticed that the left bottom of the plot is not 0,0. How can I fix it in the plot and also the X/Ycoord data?
clc
clear
close all
Iorig = imread('E:/drop.jpg');
I = rgb2gray(Iorig);
axis on
imshow(I)
T = adaptthresh(I, 0.65);
BW = imbinarize(I,T);
BW2 = imcomplement(BW);
BW2 = imfill(BW2, 'holes');
axis on
hold on;
[B,L] = bwboundaries(BW2,'noholes');
boundary = B{1};
Xcoord = boundary(:,2);
Ycoord = boundary(:,1);
plot(Xcoord, Ycoord, 'g', 'LineWidth', 2)
Upvotes: 2
Views: 193