Home Image-Pro General Discussions

Tube Growth Tracking

Hi all,

I've been playing around with ImagePro for a couple of weeks now, and cannot find an 'easy' way to do this. I have a system in which tubes grow, which I image using a microscope. I can image both videos (which can then be decimated into frames) or still images with constant time intervals. What I really want to do is find a way to at least partially automate my analysis of these image sequences to give me tube speed of growth data, along with the total size of the tubes formed. Currently, the only way I can work out to do this is by manually measuring the distance the tube grows, image by image.

Some notes:
  • Object tracking doesn't seem to be able to handle the changing shape/dimensions of the tube, due to variations in the growth rate and direction (I have subtracted a frame sequence from a frame sequence offset by 1 frame, to give a difference between sequential frames, thus giving the growth area, which I have tried to track.)
  • Even in a single frame, sometimes the program struggles to identify the tube - I think maybe some filters would help with this, but have struggled to find any that really help (I am totally new to image processing)
  • The current priority is to find a way to analyse each image sequence quicker - something like object tracking would be ideal if I could get it to work.
  • The images are typically brown tubes on a white background or black tubes on a white/grey background.
  • Often multiple tubes grow at the same time, and this can be in different direction or lead to tubes growing parallel
Here is a fairly typical image of some growing tubes (quality of image can vary, especially the presence of the reflected light) highlighting some of the issues I have mentioned.




Any help/suggestions with this would be greatly appreciated.

Laurie

Best Answer

  • Answer ✓
    Hi Laurie,

    When you use "Count all frames" the measurements are collected in Data Collector (Measure tab), so you will see them opening data collector data table. There you can also check the graph (area over time). I've attached the measurement list for Data Collector that will collect Image name, Frame Index, Area(sum) in the Measurement Stats table. (load it from Data Collector group, Load Measurements list button). Also, in the Count drop-down switch off "Sync measurements" option, otherwise the list will be overwritten.
    So after executing "Count All Frames" you will have Area(sum) values for every frame.

    Regards,

    Yuri


Answers

  • Hi Laurie,

    As I see from your sample image, the main problem would be the proper segmentation and separation of the tubes. You may need to adjust some capture parameters, such as illumination, focus depth to make the segmentation and separation easier. You may also try different filters to help segmentation. I've attached the image with segmented tubes after converting it to Gray and applying Band-Pass filter (parameters are on the screenshot)

    Another question is what exactly you need to measure. If you need to measure just total tube grows, then you may not need separation, just measure total area of the tubes, divide by the number of tubes and you will get the average area of one tube per frame. Then you can calculate the length, assuming that tubes have the same width (Length = Area/Width). 

    You can measure area over time using "Count All Frames" menu item (in the Count button drop-down) or using Object Tracking tools.

    If you are interested only in length increments (assuming that the tubes do not move), then you can use the "Motion detect" tool (in the Sub-sample button drop-down, Combine group, Process tab). It will highlight only changing features between frames, which can be then segmented.

    Regards,

    Yuri
  • YuriG said:
    Hi Laurie,

    As I see from your sample image, the main problem would be the proper segmentation and separation of the tubes.

    You're correct - when the tubes get near one another, the program struggles to still detect '2' tubes.

    You may need to adjust some capture parameters, such as illumination, focus depth to make the segmentation and separation easier. You may also try different filters to help segmentation. I've attached the image with segmented tubes after converting it to Gray and applying Band-Pass filter (parameters are on the screenshot)

    Thanks for this information. As a general comment, do you think that I am better processing these images in B+W? I can capture the images in B+W or colour, and have examples of both, but thought the orange colour of the tubes may help the program differentiate these from the white background.

    Another question is what exactly you need to measure.

    Ideally, I want to measure the tube growth speed (I have the time interval, hence I need to measure the tube 'growth', in terms of length and/or volume gained in between each image.), along with parameters such as total tube growth for a given system. This can be done manually, by measuring the growth for each 15  second step, but this obviously takes a little while!

    If you need to measure just total tube grows, then you may not need separation, just measure total area of the tubes, divide by the number of tubes and you will get the average area of one tube per frame. Then you can calculate the length, assuming that tubes have the same width (Length = Area/Width). 

    Unfortunately I want to compare the data for different tubes, as well as total tube growth for a system, otherwise this would be a much easier way of doing it at you say!

    You can measure area over time using "Count All Frames" menu item (in the Count button drop-down) or using Object Tracking tools.

    If you are interested only in length increments (assuming that the tubes do not move (correct)), then you can use the "Motion detect" tool (in the Sub-sample button drop-down, Combine group, Process tab). It will highlight only changing features between frames, which can be then segmented.

    This process achieves a similar result to what I tried before with subtracting an image sequence that is 1 frame offset. Unfortunately, the difference is so minimal that you can barely see the 'new' bit of tube - see image below. This is the same if I apply the band pass filter as you suggest and then do motion detect.

    I still think this is maybe the approach that is most likely to be successful though?There may be a filter which differentiates the tubes well enough to enable this to work? As I'm not an expert (and don't expect you to do too much!), is there any other particular filters/parameters that may be most effective at this that I can try?

    Example of motion detect:



    Regards,

    Yuri

    Thanks - that post have covered quite a lot. I'll keep playing with filters and the motion detect for now, but any further help/advice would be great.

    Laurie

  • edited January 2015
    Hi Laurie,

    Regarding segmentation: I did segmentation on gray image. Though you can use all color channels with Smart segmentation. Below is the screenshot of your image segmented by smart segmentation, the recipe is also attached (I used circular ROI in the center to avoid reflection spots).



    It might be necessary to adjust the recipe for other images, but if you will have stable acquisition conditions, it may work on other images without adjustments.

    You mentioned "Length and/or Volume" measurements. "Volume" is the easiest automatic measure, you just measure Area without separating tubes on every frame (using Count on all frames) and collect "Area(sum)" from every frame in the Data Collector. That will give you  Volume over time, from which you can calculate "grows" as area percentage increase per day(hour). If you will use "%/day" units, then you don't have to calibrate or even separate objects.

    Regards,

    Yuri
  • Hi Yuri, thanks for another reply.

    I have been trying to solve this problem since my last post, with numerous small successes and setbacks! The ways I have tried/found vaguely useful include:

    • Object tracking - can object track a 'difference' video, but the 'clouds' you can see in the image around the tube head are often tracked, rather than the tube itself. The variation in the object shape also challenges the tracking, as the tube doesn't grow in a consistent direction and may vary its diameter
    • I have found the autotrace polyline/polygon function can sometimes measure the tube size in a single frame effectively, but cannot work out a way to do this other than manually frame by frame, with manual checking that it's correct each time - saving no time on just measuring the growth frame by frame!
    • Motion detect can sometimes help highlight where the tube growth is, but again not the automation

    I have played around with what you say below:

    YuriG said:
    Hi Laurie,

    You mentioned "Length and/or Volume" measurements. "Volume" is the easiest automatic measure, you just measure Area without separating tubes on every frame (using Count on all frames) and collect "Area(sum)" from every frame in the Data Collector. That will give you  Volume over time, from which you can calculate "grows" as area percentage increase per day(hour). If you will use "%/day" units, then you don't have to calibrate or even separate objects.

    Regards,

    Yuri

    This works to an extent - on each frame I can measure an area (using segmentation as discussed), however, as soon as I move onto the next frame the 'area' value measured on the previous frame is saved over by the new 'area' value. If I do 'count All Frames', I just get the 'area' value for the final frame in the 'measurement table' and statistics such as the 'mean area' in the statistics table. Is there a way I can get the 'Count All Frames' function to treat the tube in each frame as a different object, and hence save the measurement of the tube size from every frame, thus giving me the growth data I need? (see below)

    This will also not be ideal for when I have multiple tubes, such as in the original image, as I really want  tube area growth data for each tube, no each image sequence. I guess this can be overcome using ROIs though, if I find a way of measuring the changing area in the first place.




    Thanks again for your help, and I hope I am managing to explain myself well enough!

    Laurie

  • Thanks Yuri.

    I have now worked out the proper use of the 'count all frames' function as you describe, and by combining this with segmentation and a set ROI encompassing each tube, I can now get the tube area data for each frame and export this to excel. The ROI let's me stop the counter including the clouds in the area, and it should also help me separate the area measurements for tubes that come into contact like in the original image I posted.

    Thank you for your help - much appreciated! I'll now see if it works for all my data!
Sign In or Register to comment.