- Create a binary mask of the same size as the original image.
- Randomly choose size and location of patches (rectangular are the easiest, would just need to select the indexes in a matrix)
- Assign some value (say 75 for over exposed) and add the binary mask to the original image.
- This can be done in a loop and the randomness would help in creating different distortions for each image if need be.
Programmatically generating over/under exposed pictures
조회 수: 2 (최근 30일)
이전 댓글 표시
Is there a simple way to introduce realistic over-exposure / under-exposure distortion in images? That is, synthetically over/under expose images such that the resulting distorted pictures are very close to what a camera would generate.
I could think of shifting the mean of the entire image in all three color channels. For example: if we consider a test image (I),
OE = I+75;
UE = I-50;
OE will be globally much brighter with certain regions white-washed. But this is a global operator. I am wondering if there is a way to locally introduce these distortions in the images, such that the distortion appears realistic. Is there something in MATLAB / Python that achieves this?
댓글 수: 0
답변 (1개)
Kushagr Gupta
2016년 12월 19일
There are various ways in which local exposure distortions can be introduced to an image.
One of the ways would be:
In terms of code, taking an example, it would look like:
I=(imread('coins.png'))
Imask = zeros(size(I));
Imask = uint8(zeros(size(I)));
Imask(20:40,60:90)=75;
imshow(I+Imask)
This is just an illustrative example and should serve as a starting point.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!