Question

I would like to visualize the partitioning of a number of MSER regions by plotting them in different colors, but the MSERRegions.plot() method from the Computer Vision toolbox doesn't accept a 'Color' argument. Nor does using hold all cause subsequent plots to cycle through colors. (All of the region ellipses are drawn in bright green, always.)

Here is an example plot to clarify what I'm trying to do:

enter image description here

I have partitioned the regions below into three separate groups, and I want to plot each group in a different color. Is there a simple way to do this?

Was it helpful?

Solution

A simple but "hackish" way to do this is to get the Children objects of an Axes and then you set the colors on those objects.

childrenObjs = get(gca,'Children');
set(childrenObj, 'Color', desiredColor);

First you'll need to ensure that the children objects do in fact have a color property, if they are drawn with line then they will. You can figure out the type of children object by calling handle(child).

Finally If you want to set a specific color for each group simply set the color after you plot the first group. Get the second group see which handles are new and set the color on only the new handles. Do this again for the third group.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top