I need the coordinates of the blue road in google directions. But there are gaps because there are texts in between. I can't get the only blue part. I tried to do as below.
map = imread('map3.png');
Istrech = imadjust(R,stretchlim(R));
filteredImage = imbothat(Istrech, true(50));
mask = imfill(filteredImage, 'holes');
mask2 = mask > threshold;
mask3= bwareaopen(mask2, 9);
mask4 = bwareafilt(mask3, 1);
BW2 = bwpropfilt(mask4,'perimeter',20);
I also need to embed this path as a MAtlab function in simulink like shown in below. How can I do that?