How do i read the RGB values of an image in Verilog from a hex file generated in Matlab for processing?
The image is of resolution 1200x900. It means it contains 1080000 pixels. Each pixel is represented by 24-bit RGB data in the hex file generated by MATLAB. 8 bits to represent intensities of R, G and B components in each pixel. So each line represents R/G/B component. Three lines represent a pixel, so total of 3240000 lines represent the complete image.
If you want to process this image in Verilog, for example manipulate brightness/change hue of pixels etc, you simply have to change R/G/B values of each pixel. For eg: if you increase the RGB value uniformly, the pixel becomes brighter, decrease to make the pixel darker. Increase R/G to make the pixel warmer, increase G/B make the pixel cooler. etc
What you need to do is write a Verilog code to read line by line from the file in hex format, update the R/G/B values as per how you need to process that pixel (there must be image processing algorithms based on what kind of processing you need to do to the pixels), and write the new hex value of R/G/B to a new file. You have the &quot;processed image&quot; in new hex file finally. Give that to MATLAB.