vectorizing a for loop
Ältere Kommentare anzeigen
Hell all - I know that this question has been asked many times before but I feel like my problem is slightly different and is bigger (computationally). So here it goes. Any help would be much appreciated. Thank you - Mutlu..
I have an image with segments. The image size is 7000 x 7000 and contains roughly 1 million segments. Multiple pixels make up segments of various sizes and the image contains the unique segment IDs for each segment. I also have a look up table that associates each segment ID to a specific code (it is a two column matrix Segment ID and code). Using this look up table, I would like to assign each segment its appropriate code from the table. I tried doing this in a for loop where I would go through each segment ID, find the pixels that belong to that segment and assign the code from the look up table. Unfortunately, this is painfully slow for this large image. Are there easier - vectorized - ways of doing this? Of course there may be built in tools in the image processing toolbox (which I have) that may be helpful as well but I am not familiar with that toolbox.
1 Kommentar
Andrew Newell
am 30 Mai 2011
It would be easier to answer this question if you showed us your code.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Image Arithmetic finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!