Filter löschen
Filter löschen

Image processing: transition between two halves of an image

7 Ansichten (letzte 30 Tage)
Fed
Fed am 12 Aug. 2020
Kommentiert: hosein Javan am 12 Aug. 2020
Good evening,
do you know if it's possible to make the transition between two halves of an image less sharp in order to obtain a more soft and realistic effect?
I mean something like the image on the left and not the image on the right, which is too artificial and that I have obtained with the code attached below.
Imm = imread('moon.jpg');
figure
imshow(Imm)
darken = linspace(0,0,800);
darken = repmat(darken,[1085 1 3]);
Imm_darken = Imm;
Imm_darken(:,1:800,:) = uint8(darken.*single(Imm_darken(:,1:800,:)));
figure
imshow(Imm_darken)
I've tried different tecniques but none of them gives the effect I'm looking for.
Thank you in advance.

Akzeptierte Antwort

hosein Javan
hosein Javan am 12 Aug. 2020
Bearbeitet: hosein Javan am 12 Aug. 2020
you must define the dim factor in a way that is
1.between 0 and 1,
2. it has smooth transition.
for example here in order to make it more realistic, I used a power2 spacing instead of even spacing.
A = imread('luna.bmp'); % read image 'luna.bmp'
figure(1);imshow(A) % show the original image
dim = linspace(0,1,90);
dim = dim.^2; % create a dimming factor ranging from 0 to 1 with power2 spacing.
dim = repmat(dim,[180 1 3]); % repeat this factor for all rows
Adim = A;
Adim(:,180:-1:91,:) = uint8(dim.*single(Adim(:,180:-1:91,:))); % dim the right side of the picture
figure(2);imshow(Adim)
  4 Kommentare
Fed
Fed am 12 Aug. 2020
Thanks again,
I'll try both your solutions.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Modify Image Colors finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by