This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Region growing

Hi,

I'm looking for information about region growing (image processing) algorithm on DSP. Presently I have implemented an algorithm but it is very very slow. My implementation is probably not optimal and did not use maximum of DSP resources. Is it possible to find this type of code ready to use? I have saw functions in Imglib (perimeter and boundary) but it is not exactly what I'm looking for.

 

Thank you

  • For the most part the only generic image processing functions we hare are in Imglib as you have already seen, most anything else would have to be written in house or perhaps obtained through a third party (I have not come across a region growing algorithm). If you are looking to optimize your own implementation I would start with efficient memory mapping, putting as much code and data as you can in internal memory, and if it does not all fit than putting in the most heavily used code/data, as well as using the -o3 compiler build option in your project. From there you could get into implementing pragmas and intrinsics to make better use of the DSP architecture.

  • Thank you. It is exactly the first way I would like to use to  optimize my code.

  • Do you have idea how much time it can take to do a  region growing operation ( with good code optimization ) on C62xx or C64xxx for a gray scale  image of 256x256?

  • Geoffroy Rivet-Sabourin said:
    Do you have idea how much time it can take to do a  region growing operation ( with good code optimization ) on C62xx or C64xxx for a gray scale  image of 256x256?

    I am not sure there is a good way to estimate this, as based on my understanding of how region growing works (from this wikipedia article), the amount of time it would take to grow a region would vary greatly on the size of the region that you would ultimately have covered by the operation, as I envision this being a loop doing comparisons between a threshold value and the values adjacent to your seed points which would exit upon finding the adjacent pixels meeting the threshold. So the time would be different depending on what settings (threshold values) you have as well as the content of the image you would be processing.

  • Yes I know that. I'm only looking for big estimation to decide if it is good idea to implement this type of algortihm with C6000 or if the CPU consumption of this algorithm is to large for a DSP

  • The algorithm seems quite simple, I would expect most any of the digital media DSPs to be able to handle a 256x256 greyscale image at 30 frames per second (or more) even if the entire image ended up being the region, there doesn't seem to be much math (multiplies), just a lot of comparisons in loops. Of course this is specific to many circumstances, implementation, source image, settings, processor, frequency, etc. so it is hard to say what would really happen, but I am fairly certain it is possible to do at a fairly fast rate as these same processors can handle much more complex algorithms at higher resolutions in real time, such as a h.264 encoder.

    In the end it is something you would just have to try, you could start with just a simulator in CCS but for hardware I would probably recommend the DM6437 EVM to start, in particular if you are planning on having a real time video source input and output when using the region growing algorithm.

  • Ok It is what I want to know from a person with more expercience than me with DSP. I have lot of experice in image processing but I don't have lot of experience with DSP and I don't know exactly what performance I can expect from this type of device. I have began developping with an old 6211 developpement board. It is certainly not the fastest system but for begining it is cheaper than other systems like DM6437 EVM Probably in few weeks I will upgrade my system for a C64xx.

    Thank you

  • The C6211 is significantly slower, I would still expect it to work through the image at a decent rate as well since you are using such a small greyscale image, but the performance would not be very good relative to a more modern processor. The C6211 DSK board only ran at 150MHz whereas a typical video processor today like the DM6437 runs at 600MHz or more, and has much faster DDR2 RAM and larger internal memories. On a positive note, the DM6437 as well as other C64x+ based processors are backwards compatible with binary code from earlier C6x processors, so a binary built for the C6211 will still run on a DM6437, meaning you could start development on the C6211 and migrate to the DM6437 with relative ease (of course there are memory mapping differences and a much newer version of DSP/BIOS, etc.).

    What sort of application are you looking to use region growing with, will this be processing a video stream (need video i/o?)? At what sort of rate do you need to be able to process 256x256 greyscale data (30fps?)?