- 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!