I'm trying to align text boxes with the red dots but I have no idea where to start. Any advice/examples would be appreciated.
I used skimage and peakutils to get the locations of the ladder bands and lanes and now I would like to annotate them
%matplotlib inline
import skimage
import numpy as np
import matplotlib.pyplot as plt
from skimage import data
from skimage import io
from skimage.color import rgb2gray
from skimage.filters import threshold_otsu
from skimage.util import invert, crop
import peakutils
from peakutils.plot import plot as pplot
import pandas as pd
from scipy.misc import toimage
from skimage import feature
def ladder_peaks(image):
image = io.imread(image)
image_grey = rgb2gray(image)
image_grey = invert(image_grey)
image_otsu = threshold_otsu(image_grey)
image_otsu = image_grey > image_otsu
xi,yi = image_otsu.shape
width_per_lane=int(xi/10)
imagecopy_otsu = np.copy(image_otsu)
imagecopy_otsu = imagecopy_otsu[:,0:(width_per_lane*2)]
ladder_mean = imagecopy_otsu.mean(1)
count = 0
x = []
for i in ladder_mean:
x.append(count)
count+=1
x = np.asarray(x)
indexes = peakutils.indexes(ladder_mean, thres=0.4, min_dist=80)
indexes = indexes.tolist()
origin = image
for i in indexes:
image[i:(i+30),0:30,:] = [255,0,0]
io.imshow(image)