Realtimestagram
|
Creates seperate Hue Saturation Value channels from rgb signal.
rgb2hsv converts a stream of Red, Green and Blue pixels into their corresponding Hue, Saturation and Value pixels. For more information see the algorithm section.
The Hue indicates the degrees on the color circle. Starting at 0 degrees with red, 120 degrees for green and 240 degrees for blue. Because 360 degrees does map not correctly on the 8 bits of a byte everything is normalised to the full range of a byte Hue is calculated following the function:
The saturation indicates the strength of the color. Saturation is calculated following the function:
The value indicates the intensity of the pixel. Value is calculated using the following function:
TODO calculate the global quantization noise power
RGB image | HSV image |
---|---|
![]()
Amersfoort | ![]()
Amersfoort |
![]()
Rainbow | ![]()
Rainbow |
![]()
Hue gradient | ![]()
Hue gradient |
![]()
Saturation gradient | ![]()
Saturation gradient |
![]()
Value gradient | ![]()
Value gradient |
Libraries | |
ieee |
Use Clauses | |
std_logic_1164 | |
numeric_std | |
math_real | |
Used for calculation of h_count and v_count port width. |
Constants | |
c_60_degrees | integer := integer ( round ( real ( 60 ) / real ( 360 ) * real ( 2 ** wordsize ) ) ) |
c_120_degrees | integer := integer ( round ( real ( 120 ) / real ( 360 ) * real ( 2 ** wordsize ) ) ) |
c_240_degrees | integer := integer ( round ( real ( 240 ) / real ( 360 ) * real ( 2 ** wordsize ) ) ) |
Types | |
mux_select_delay | ( 0 to 4 ) integer range 0 to 2 |
max_delay | ( 0 to 2 ) integer range 0 to 2 ** wordsize |
Generics | |
wordsize | integer := 8 |
input image wordsize in bits |
Ports | |
clk | in std_logic |
completely clocked process | |
rst | in std_logic |
asynchronous reset | |
enable | in std_logic |
enables block | |
pixel_red_i | in std_logic_vector ( ( wordsize - 1 ) downto 0 ) |
red input pixel | |
pixel_green_i | in std_logic_vector ( ( wordsize - 1 ) downto 0 ) |
green input pixel | |
pixel_blue_i | in std_logic_vector ( ( wordsize - 1 ) downto 0 ) |
blue input pixel | |
pixel_hue_o | out std_logic_vector ( ( wordsize - 1 ) downto 0 ) |
hue of pixel | |
pixel_sat_o | out std_logic_vector ( ( wordsize - 1 ) downto 0 ) |
saturation of pixel | |
pixel_val_o | out std_logic_vector ( ( wordsize - 1 ) downto 0 ) |
value of pixel |
|
Constant |
|
Constant |
|
Constant |
|
Port |
completely clocked process
|
Port |
enables block
|
Library |
|
Package |
Used for calculation of h_count and v_count port width.
|
Type |
|
Package |
|
Port |
blue input pixel
|
Port |
green input pixel
|
Port |
hue of pixel
|
Port |
red input pixel
|
Port |
saturation of pixel
|
Port |
value of pixel
|
Port |
asynchronous reset
|
Package |
|
Generic |
input image wordsize in bits