Polygon/patch data to RGB image matrix
Ältere Kommentare anzeigen
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.
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!