image-quality-tools's Introduction
Please add all the images in the "image" folder which is in the root/home directory and follow the convention given below. To run these tests: Go to the folder where sim_msssim.m, psnr.m and sim_ssim.m files are (1) To run MSSIM test go do "[MSSSIM_VALUE] = sim_msssim" in Matlab. The value returned by the sim_msssim function is set to MSSSIM_VALUE (2) To run SSIM test do "[SSIM_VALUE] = sim_ssim" in Matlab. The value returned by the sim_ssim function is set to sSIM_VALUE (3) To run PSNR test do "[PSNR_VALUE] = psnr" in Matlab. The value returned by the psnr function is set to PSNR_VALUE (4) To metrix_mux library (details of the library provided below) go to the metrix_mux folder do something like "[values] = sim_metrix_mux('SSIM')". When simulating this you have to provide testName to run that test otherwise PSNR is the default test when run like "[values] = sim_metrix_mux" For our usecase it would be following 1. [values] = sim_metrix_mux('SSIM'); 2. [values] = sim_metrix_mux('PSNR'); 3. [values] = sim_metrix_mux('MSSIM'); ---------------------- Image Name Convention ----------------------- Important information regarding the image naming convention: A file called "imageName.data" would contain an index of the all the images on you wish to run the quality tests on so for each image its name would be of this form "image1 - Orig.jpg" "image1 - FbCopy.jpg" "image1 - 2Copy.jpg" "image1 - 3Copy.jpg" "image1 - 4Copy.jpg" "image2 - Orig.jpg" "image2 - 1Copy.jpg" The number or substring prefixed with substring "Copy" in image name should be added to threshold.data Notice: see how the number before the Copy substring in the name changes but there would be only one original image <b>PSNR:</b> A PSNR value of Inf means that the images are exactly equal http://books.google.ca/books?id=ujnQogzx_2EC&pg=PA281&lpg=PA281&dq=acceptable+range+of+psnr+value&source=bl&ots=FoqtwG8xjP&sig=6_JkQEd2-BeGF4qHfy3RO0uBq4s&hl=en&sa=X&ei=H13oUu-2DaGCyQGfpoG4Dg&ved=0CCsQ6AEwAA#v=onepage&q&f=false This book says that we cannot judge the quality of image using psnr value. <b>SSIM:</b> For running the ssim image quality test you have to do something like ssim(imread('Test1 - Orig.jpg'), imread('Test1 - 1Copy.jpg')) Structural similarity between the two images will range from between -1 to 1. where 1 being exactly identical images and as it decreases from 1 the difference between the two compared image increase <b>MSSIM:</b> For running the msssim image quality test you have to do the following I = imread('Test1 - Orig.jpg'); I1 = rgb2gray(I); J = imread('Test1 - 1Copy.jpg'); J1 = rb2gray(I); msssim(I1, J1); This function returns a value between -1 to 1 where 1 being exactly identical images and as it decreases from 1 the difference between the two compared image increase script code taken from http://sse.tongji.edu.cn/linzhang/IQA/Evalution_MS_SSIM/eva-MS-SSIM.htm <b>metrix_mux library:</b> To run this library in matlab you have to do the following steps 1. configure_metrix_mux 2. I = imread('Test1 - Orig.jpg'); 3. J = imread('Test1- 1Copy.jpg'); 4. metrix_mux(I, J, 'PSNR'); The algorithms by this external library are algorithm indicator string mean-squared-error 'MSE' peak signal-to-noise-ratio 'PSNR' structural similarity index 'SSIM' multi-scale SSIM index 'MSSIM' visual signal-to-noise ratio 'VSNR' visual information fidelity 'VIF' pixel-based VIF 'VIFP' universal quality index 'UQI' information fidelity criterion 'IFC' noise quality measure 'NQM' weighted signal-to-noise ratio 'WSNR' signal-to-noise ratio 'SNR' these indicator strings can be changed in the above metrix_mux statements Library taken from http://foulard.ece.cornell.edu/gaubatz/metrix_mux/
image-quality-tools's People
Forkers
theblissprogrammer codexpage michealray luis-nunes daitao windcr qq404187111 walkoncross agchen1975 shubhampachori12110095 trinhquocnguyen ailib lilixj windsence deeptoai dumpling426 danielbabalola nisarahmedrana sidriaz onion-liu reda-abdellah georgep93 anniezhong havenfeng umaimaz123 rigoyao shazib-summar sitp2018 tom-ryder liujin123time morganlee1 wgandler gqqarno marufhossainanikimage-quality-tools's Issues
Error(s) in testing metric algorithms
Hi, I was looking for some opensource material for computing image quality metrics such as VSIM
, VIF
etc. and came across your repo. As instructed in the readme, I ran the configure_metric_mux
. The search path is appended successfully, however when test_metric_mux
is called from within the configure_metic_mux
file there are a few errors in testing the algorithms. As shown below the errors occur in MSSIM
, VSNR
, VIF
, and lastly IFC
:
>> configure_metrix_mux
Setting MeTriX MuX path...[Done!]
Compiling list of compilations routines...1 found...[Done!]
Executing compilation routines...
1 - compile_metrix_vsnr
Building VSNR MEX interface for DWT...(Linux/Mac)... [Not Supported!]
Defaulting to Matlab-based DWT...[Success!]
[Done!]
Algorithm mse computed successfully!
Algorithm psnr computed successfully!
Algorithm ssim computed successfully!
Error [test_metrix_mux]: algorithm mssim did not compute correctly!
Error [test_metrix_mux]: algorithm vsnr did not compute correctly!
Error [test_metrix_mux]: algorithm vif did not compute correctly!
Algorithm vifp computed successfully!
Algorithm uqi computed successfully!
Error [test_metrix_mux]: algorithm ifc did not compute correctly!
Algorithm nqm computed successfully!
Algorithm wsnr computed successfully!
Algorithm snr computed successfully!
Total error count: 4
>>
I debugged the code and found the issue to be less number of parameters than expected. The call to mssim_index
in metrix_mssim.m
provides only two parameters namely reference_image
, query_image
:
image-quality-tools/metrix_mux/metrix/metrix_mssim.m
Lines 40 to 42 in 163fff1
Upon looking into the code or mssim_index
one notices that there are five input arguments required:
However, only two arguments were provided. Further down below there are a few try catch statements:
image-quality-tools/metrix_mux/metrix/mssim/mssim_index.m
Lines 72 to 77 in 163fff1
and
image-quality-tools/metrix_mux/metrix/mssim/mssim_index.m
Lines 79 to 88 in 163fff1
I believe these lines imply default parameter values in case the parameters are not defined. That being said when I run the code even after the execution of the aforementioned lines, the workspace has no variable by the name
K
or lpf
.
There is/are undoubtedly error(s) in the code. For the time being, I'm going to replace the lines:
image-quality-tools/metrix_mux/metrix/mssim/mssim_index.m
Lines 72 to 77 in 163fff1
and
image-quality-tools/metrix_mux/metrix/mssim/mssim_index.m
Lines 79 to 88 in 163fff1
with
if ~exist('K','var')
K = [0.01 0.03]
end
and
if ~exist('lpf','var')
lod = [0.037828455507260; -0.023849465019560; -0.110624404418440; ...
0.377402855612830; 0.852698679008890; 0.377402855612830; ...
-0.110624404418440; -0.023849465019560; 0.037828455507260];
lpf = lod*lod';
lpf = lpf/sum(lpf(:));
end
So, what I am creating this issue for is to know whether these modifications are theoretically correct, as I do not want to make modifications to the code that I might end up regretting later.
Thanks a lot.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.