Borrar filtros
Borrar filtros

how can i change the image contrast?

5 visualizaciones (últimos 30 días)
Diogo Simões
Diogo Simões el 7 de Abr. de 2022
Respondida: Deep el 13 de Sept. de 2024 a las 11:07
I need to change the image contrast,increase and decrease the contrast. only where it belongs to the region of interest.

Respuestas (1)

Deep
Deep el 13 de Sept. de 2024 a las 11:07
Hi Diogo,
As per my understanding, you are looking to adjust the contrast of an image within a specific region of interest (ROI) using MATLAB. Please refer to the attached MATLAB script to achieve the desired results as shown below:
The attached script loads the image into MATLAB. The ROI is selected with “roipoly”, and its validity is checked. For contrast adjustment, “stretchlim” calculates the limits for the ROI, and “imadjust” enhances its contrast, preserving the rest of the image. The enhanced ROI is then merged back into the original image for display.
For more detailed information on contrast enhancement techniques, you can refer to the following MathWorks help page: https://www.mathworks.com/help/images/contrast-enhancement-techniques.html.
Here are documentation links of relevant MATLAB functions used in the code:
  1. imread - https://www.mathworks.com/help/matlab/ref/imread.html
  2. roipoly - https://www.mathworks.com/help/images/ref/roipoly.html
  3. im2double - https://www.mathworks.com/help/matlab/ref/im2double.html
  4. stretchlim - https://www.mathworks.com/help/images/ref/stretchlim.html
  5. imadjust - https://www.mathworks.com/help/images/ref/imadjust.html
  6. im2uint8 - https://www.mathworks.com/help/images/ref/im2uint8.html
I hope this helps!

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by