Home Image-Pro General Discussions

color representation in the single classification procedure

Good afternoon

I have two question:
first question; there is the possibility (using a specific code in the macro) to choose the color for each class defined in the single classification procedure?

second question; when I obtained the classification result and I have the different objects colored with the specific color of the class in which they belong to, there is the possibility (always with a specific code in the macro) to obtain a new RGB image from the image analyzed in which each object now is colored with the color of the class?

Until now I Have done the screen capture using the area selection and then I opened the saved image but if you can found the way to convert directly the processed image, I will be very greatful.

Best regards
Lorenzo Fongaro

Best Answers

  • Answer ✓
    Hi Lorenzo,

    You can change colors from UI changing the active class color. When you activate macro recording a macro will be created that will show you the commands:
    ...
            With Measure.MeasurementsCommands.Options(ChangeClassColors)
                .FilledOutlines = True
                .Classes = New System.Collections.Generic.List(Of MMClassDescr)
                    .Classes.Add(New MMClassDescr("Class 1",System.Drawing.Color.FromArgb(CType(255, Byte),CType(255, Byte),CType(0, Byte)),ePointShape.LargeTarget90))
                    .Classes.Add(New MMClassDescr("Class 2",System.Drawing.Color.FromArgb(CType(0, Byte),CType(112, Byte),CType(192, Byte)),ePointShape.LargeTarget45))
                    .Classes.Add(New MMClassDescr("Class 3",System.Drawing.Color.FromArgb(CType(227, Byte),CType(108, Byte),CType(9, Byte)),ePointShape.TriangleUp))
                .ActiveClass = 3
                .Run(doc1)
            End With
    
    ...

    I've attached a complete test project, run ChangeClassColors macro to see how it works.

    The image with overlays can be created using the Snap button on the Share ribbon tab.
    The attached project also contains macro SnapClassColorsToImage that does it.

    Regards,

    Yuri
  • Answer ✓
    Yes, you can do the same in IP Premier (and any other variation of Premier products).

    Yuri

Answers

  • Dear Yuri

    thank you very much for your prompt reply, but I had a mistake and I am very sorry for that; in fact I realized that I ask the question in the wrong discussion section because I have a licence for Image-Pro Plus 7 3D and not for Image-Pro Premier (for the moment, I am waiting for that). So, do you think that it could be possible to do the same thing also with image pro plus?

Sign In or Register to comment.