- imread - https://www.mathworks.com/help/matlab/ref/imread.html
- roipoly - https://www.mathworks.com/help/images/ref/roipoly.html
- im2double - https://www.mathworks.com/help/matlab/ref/im2double.html
- stretchlim - https://www.mathworks.com/help/images/ref/stretchlim.html
- imadjust - https://www.mathworks.com/help/images/ref/imadjust.html
- im2uint8 - https://www.mathworks.com/help/images/ref/im2uint8.html
how can i change the image contrast?
5 views (last 30 days)
Show older comments
I need to change the image contrast,increase and decrease the contrast. only where it belongs to the region of interest.
0 Comments
Answers (1)
Deep
on 13 Sep 2024 at 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:
I hope this helps!
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!