Image contrast adjustment can be done by a module contrast adjustment, parameters have input range and output range, the calculation process is determined by the following formula
Explain that when input<=low_in the output value is low_out+low_out, when low_in<input
Based on this principle, we have made our own Simulink module, as follows
I use the picture is 640*1024, so after sampling first reshape into 1-dimensional after unbuffer make the data in the form of sample output instead of frame, then is the data processing part, with the if else structure set LOW_IN is 20,high_ In is 235 if the input is less than 20 on the output 0, if the input is greater than 235 on the output 255, if the input between 20-235 in accordance with the formula shown above to build a model, and then buffer,655360 the data is 1 frames, the output reshape into 640* 1024 can be output, it should be noted that in order to unbuffer from the beginning of the data, Simulink must be run mode set to single-task run mode.
Two chart comparison before and after processing
Simulink Simulation Summary of image contrast adjustment