Due to a project, i want to compare some images produced by a L-system fractal generator. The method i decided to use is the DTW (Dynamic Time Warping). As some of you might know, DTW to work needs two time series for the comparison.
After searching on the net and on scientific research papers, i couldn't find any algorithm implementation that produces time-series for images like mine.
Just to take a taste on what images i want to compare see below:
Each column is a specific genotype of a plant with three iterations and as you can understand i want to compare these images with each other.
So the first step is to somehow extract time series data from each image and then use it within DTW algorithm.
I thought three different ways on how to implement such an algorithm and here is where i want your opinion.
IDEA #1
The first idea, as you can see above, is to count the distance of the branches of the same generation (generations starts count from the bottom). For example, data from that image will be:
1st gen : 1.51cm
2nd gen : 0.95cm , 1.03cm
3rd gen : 0.54cm , 0.66cm , 0.69cm , 0.73cm
then, calculate the average of each generation
1st gen : 1.51cm
2nd gen : 0.99cm
3rd gen : 0.655cm
and finally the time series plot looks like this:
This idea seems (in my opinion) to have a disadvantage because these fractals have only 6 generations and that means that finally only 6 numbers will describe the time series plot.
IDEA #2
The second idea is to measure the distance from each fork to the first fork of the image (clockwise for each generation).
Below is the explanation of the clockwise for each generation operation:
In that way i have many measurements for each tree that looks like :
1st : 1.67cm
2nd : 1.71cm
3rd : 2.60cm
4th : 2.71cm
5th : 2.86cm
6th : 2.94cm
7th : 3.07cm
and so on...
while the time series plot is :
IDEA #3
In that case measurements are the distance from the center of the image to any points of the outline (i think that as more outline points will be used the better result will have in time-series plot)
Measurements for that case :
1st : 2.62cm
2nd : 2.27cm
3rd : 1.98cm
4th : 1.43cm
5th : 1.39cm
6th : 2.07cm
7th : 2.73cm
and so on..
and the time-series plot that has been produced :
So, that's all of my thoughts/ideas. All these representations and calculations i made them by hand and using ImageJ and LibreOffice Calc. I think that i should find a way to automate that procedure (with R/matlab or something else) after deciding which method to use.
Any opinion on which method to choose, how to automate such ideas or any correction is welcome.
Thank you.
I used the 2nd idea actually.
Using ImageJ
, add multi points
function and a standard canvas size, i calculated the coordinates of each point that belongs to every fork.
For example:
Fork X Y
1st 0.43 0.5
2nd 0.56 0.43
and so on...
I saved those values into an excel file and calculate the euclidean distance of each fork from the first one.
Finally, i got those distances for each tree, and compare them with each other using DTW R package.