Help needed with preparing data for analysis

Hi there!

I am working on a project where I am (super briefly summarized) trying to analyse behavior of ice crystals over time. The collected data consists of snapshots of a sample under a microscope.

I started with turning these frames into actually workable csv data. To do this, I tracked all the individual ice crystals throughout the captured frames. I did this by using openCV to find the contours and basically comparing the attributes of these contours within the frames to figure out which crystals match throughout all the frames. I have managed to do this successfully, and I now have a separate csv file for every crystal (contour) where the data of all frames is appended. The data in every csv now contains a row for each point on a crystal-contour. Matching contour data for the follow-up frames is appended. The columns have information such as the coordinates of the point, local curvature, total area of the contour the point belongs to, etc.

For my analysis I want to look at the change of this local curvature over time for a specific point on the contour. This is where I run into problems. Because of the evolution of the crystal shapes over time, data of consecutive time frames doesn’t instantly match with each other. Crystals can shrink/grow causing there to be fewer/more data points. Another issue is that openCV chooses the begin and endpoint of the list of contour coordinates based on the shape. If the shape changes within two consecutive frames, the list of coordinates might also not be aligned anymore (begin/end-point of the contour is at a different position on the same contour).

To summarize, I want to track attributes of a certain contour point over time, but I can’t figure out which data point belongs to the same position on the next frame.

Previous approaches included stretching/compressing the amount of datapoints for all frames according to the length of the contour in the first frame. For the shift issue I tried checking for the lowest possible change in curvature over time, this didn’t really prove very successful. Another option I am considering is for this first coordinate in the current frame, find the closest coordinate in the next frame and align the datapoints again that way. However, I think this will be too computationally inefficient for a large dataset (many crystals captured of many many frames).

I would really appreciate any insights that you can come up with to help me approach this issue.

I hope the explanation is somewhat clear, but if you need anything else from me please let me know.

Thanks a lot!

© Copyright 2013-2020 Analytics Vidhya