The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
[SOLVED] Image Mining: Color Histogram
Legacy User
Member Posts: 0 Newbie
Hello,
I would like to ask what is the best strategy for extracting color histograms and specifically HSV.
In the following workflow I am trying to extract Hue, Saturation and Value like tis:
- Multiple Color Image Opener
-Global Feature Extraction from Single Image
-Color to Grayscale->Grayscale to Color->Histogram (performed 3 times, one for H, one for S and one for V)
I get the exception: Duplicate attribute name Histogram0.
Is this the correct way to extract histograms, or is there something wrong with the workflow?
I would like to ask what is the best strategy for extracting color histograms and specifically HSV.
In the following workflow I am trying to extract Hue, Saturation and Value like tis:
- Multiple Color Image Opener
-Global Feature Extraction from Single Image
-Color to Grayscale->Grayscale to Color->Histogram (performed 3 times, one for H, one for S and one for V)
I get the exception: Duplicate attribute name Histogram0.
Is this the correct way to extract histograms, or is there something wrong with the workflow?
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.3.008" expanded="true" name="Process">
<parameter key="logfile" value="C:\Users\Elena\Dropbox\Master\Thesis\RapidMiner\logfile\log.txt"/>
<parameter key="resultfile" value="C:\Users\Elena\Dropbox\Master\Thesis\RapidMiner\resultfile\resultfile.txt"/>
<process expanded="true">
<operator activated="true" class="imageprocessing:multiple_color_image_opener" compatibility="1.4.001" expanded="true" height="60" name="MCIO(H)" width="90" x="45" y="30">
<list key="images">
<parameter key="city" value="C:\Users\Elena\Dropbox\Master\Thesis\mcio"/>
</list>
<parameter key="auto_adjust_contrast" value="true"/>
<process expanded="true">
<operator activated="true" class="imageprocessing:global_feature_extraction" compatibility="1.4.001" expanded="true" height="60" name="Global Feature Extractor from a Single Image" width="90" x="246" y="75">
<parameter key="include_position_filename" value="false"/>
<process expanded="true">
<operator activated="true" class="imageprocessing:color_model_operator" compatibility="1.4.001" expanded="true" height="60" name="ClrToGS(Hue)" width="90" x="45" y="30">
<parameter key="Color component" value="Hue"/>
</operator>
<operator activated="true" class="imageprocessing:grayscale_to_color" compatibility="1.4.001" expanded="true" height="60" name="Grayscale to color" width="90" x="246" y="75"/>
<operator activated="true" class="imageprocessing:color_model_operator" compatibility="1.4.001" expanded="true" height="60" name="ClrToGS (Saturation)" width="90" x="45" y="120">
<parameter key="Color component" value="Saturation"/>
</operator>
<operator activated="true" class="imageprocessing:color_model_operator" compatibility="1.4.001" expanded="true" height="60" name="ClrToGS (Value)" width="90" x="45" y="210">
<parameter key="Color component" value="Value"/>
</operator>
<operator activated="true" class="imageprocessing:grayscale_to_color" compatibility="1.4.001" expanded="true" height="60" name="Grayscale to color (2)" width="90" x="246" y="255"/>
<operator activated="true" class="imageprocessing:grayscale_to_color" compatibility="1.4.001" expanded="true" height="60" name="Grayscale to color (3)" width="90" x="246" y="165"/>
<operator activated="true" class="imageprocessing:histogram" compatibility="1.4.001" expanded="true" height="60" name="histogram(H)" width="90" x="447" y="75"/>
<operator activated="true" class="imageprocessing:histogram" compatibility="1.4.001" expanded="true" height="60" name="histogram (S)" width="90" x="447" y="165"/>
<operator activated="true" class="imageprocessing:histogram" compatibility="1.4.001" expanded="true" height="60" name="histogram (V)" width="90" x="447" y="255"/>
<connect from_port="color image plus 1" to_op="ClrToGS(Hue)" to_port="color image plus"/>
<connect from_port="color image plus 2" to_op="ClrToGS (Saturation)" to_port="color image plus"/>
<connect from_port="color image plus 3" to_op="ClrToGS (Value)" to_port="color image plus"/>
<connect from_op="ClrToGS(Hue)" from_port="grayscale image plus" to_op="Grayscale to color" to_port="grayscale image plus"/>
<connect from_op="Grayscale to color" from_port="color image" to_op="histogram(H)" to_port="color image plus"/>
<connect from_op="ClrToGS (Saturation)" from_port="grayscale image plus" to_op="Grayscale to color (3)" to_port="grayscale image plus"/>
<connect from_op="ClrToGS (Value)" from_port="grayscale image plus" to_op="Grayscale to color (2)" to_port="grayscale image plus"/>
<connect from_op="Grayscale to color (2)" from_port="color image" to_op="histogram (V)" to_port="color image plus"/>
<connect from_op="Grayscale to color (3)" from_port="color image" to_op="histogram (S)" to_port="color image plus"/>
<connect from_op="histogram(H)" from_port="features" to_port="feature 1"/>
<connect from_op="histogram (S)" from_port="features" to_port="feature 2"/>
<connect from_op="histogram (V)" from_port="features" to_port="feature 3"/>
<portSpacing port="source_color image plus 1" spacing="0"/>
<portSpacing port="source_color image plus 2" spacing="0"/>
<portSpacing port="source_color image plus 3" spacing="0"/>
<portSpacing port="source_color image plus 4" spacing="0"/>
<portSpacing port="sink_feature 1" spacing="0"/>
<portSpacing port="sink_feature 2" spacing="0"/>
<portSpacing port="sink_feature 3" spacing="0"/>
<portSpacing port="sink_feature 4" spacing="0"/>
</process>
</operator>
<connect from_port="color image plus" to_op="Global Feature Extractor from a Single Image" to_port="color image plus"/>
<connect from_op="Global Feature Extractor from a Single Image" from_port="example set" to_port="Example set"/>
<portSpacing port="source_color image plus" spacing="0"/>
<portSpacing port="sink_Example set" spacing="0"/>
</process>
</operator>
<connect from_op="MCIO(H)" from_port="example set" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
0
Answers
you can combine HSV channels to one image and then create histogram: Best,
Vaclav
thank you for the reply and I am sorry for my delay to reply. It is just that I am trying to understand what information do I get. With your workflow but also when I try to extract H,S or V separately the result that I get is 0.001 at histogram62 and 0.999 at histogram63(0..000 and 1.000 when I do only H,S or V).
-Does then number of bins even plays a role here?
-Why is the result displayed at histogram62 and histogram63 and not in another one?
-And finally what does this information tells me about the particular image? If e.g. I extract histograms only for Value and I get 1.000 at histogram63, does this mean that my image is very bright? But for which Hue?
I know that these are understanding questions, but although I understand HSV model I don't understand the information that RapidMiner give me here.
I hope this was not too much.
Best,
elag
If you explain what you want to do, maybe I can help you more.
Best,
Vaclav
thanks for the reply.
What I want to do is extract HSV color histograms. My test photo has more than 2 colors and even when I try to extract only one of the HSV channel Iend up having values only on histogram 62, 63. This is either wrong or I don't understand what should the HSV result be.
Best,
Elena
can you post example image? I will try it.
Best,
Vaclav
i sent you a pm with the image.
Thank you very much,
Elena
The workflow provided above from Vaclav was correct. There was a bug in my version of the image extension.
Could you please share your model because i am unable to run the process model, as i am getting errors.
hello @nsand102 - this is a 5-year-old thread. I have a hunch that no one is going to respond. I would start a new thread AND include your process XML AND some sample data.
Thanks!
Scott