[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #56796] [octave forge] (image) imtransform cha
From: |
Hartmut |
Subject: |
[Octave-bug-tracker] [bug #56796] [octave forge] (image) imtransform changes the contrast of image when using bilinear interpolation |
Date: |
Tue, 14 Sep 2021 14:16:35 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0 |
Follow-up Comment #8, bug #56796 (project octave):
@Avinoam: Here are the source files for my short tests leading to my comment
#6:
1. the image file "raw_image.jpg". This file is made with the Gimp image
manipulation software by cutting out the upper left corner of the OP and
removing the colored "a" label.
2. The following Octave code:
clear, close all
im = imread('raw_image.jpg');
imshow(im)
in_p = [0, 0; 1, 0; 0, 1];
factor = 2.4 % you can use also different values here, this one is
random
out_p = factor.*in_p;
T = cp2tform(in_p, out_p, 'affine'); %% uses interp2 from core Octave for
interpolation
im2 = imtransform(im, T);
figure
subplot(2,2,1)
imshow(im)
subplot(2,2,2)
imshow(im2)
im3 = imtransform(im, T, 'bicubic');
subplot(2,2,4)
imshow(im3)
% -> results with image 2.12.0 release
mean_orig = mean(im(:)) % -> 224.8
mean_bilinear = mean(im2(:)) % -> 229.9 = too bright
mean_bicubic = mean(im3(:)) % -> 224.6
This could point to a bug on core Octave's interp2 function. Or it could just
mean nothing at all, because nobody claims that interpolation preserves mean
values (or am I wrong with this assumption?)
(file #51911)
_______________________________________________________
Additional Item Attachment:
File name: raw_image.jpg Size:36 KB
<https://file.savannah.gnu.org/file/raw_image.jpg?file_id=51911>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?56796>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/