Polygon/patch data to RGB image matrix
Show older comments
I am looking for a way to convert a list of polygons into an RGB image matrix.
I have a vector of polygon data structures, where each polygon has the following:
polygon.x: x-coordinate of vertices that make up the polygon
polygon.y: y-coordinates of verticies
polygon.r/g/b: R/G/B color components of polygon face color
polygon.alpha: alpha (transparency) component of polygon face color
All these polygons are stacked on top of each other to make a final picture.
I am looking for a way to convert this picture into a RGB image matrix (X-by-Y-by-3 where X and Y are the size of the image).
I know I could do this by plotting each polygon stack with the patch function, and then doing some combination of getframe and frame2im, but I will be needing to do this with tens of thousands of images (as in tens of thousands of seperate lists of polygons), so plotting each one would be inefficient.
Let me know if you need any more clarification.
Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!