亚洲av日韩综合一区久热|精品欧美综合区久久久久久|亚洲懂色av|av?在线天堂|99精品久久久人妻一二区不卡|国产调教视频在线观看|亚洲操av|国产精品网站91

SineImage Test Charts logo

Other News

Author:SineImage    Date:2016-11-11   Hits: 1051

While the final arbiter of image quality is the human viewer, efforts have been made to create objective measures of quality. This can be useful for many applications. Many objective measures of quality require the existence of a distortion-free copy of an image, called the reference image, that can be used for comparison with the image whose quality is to be measured. The dimensions of the reference image matrix and the dimensions of the degraded image matrix must be identical.

The Image Processing Toolbox provides several function that can be used to measure quality:

  • psnr — The peak signal-to-noise ratio measure of quality works by first calculating the mean squared error (MSE) and then dividing the maximum range of the data type by the MSE. This measure is simple to calculate but sometimes doesn't align well with perceived quality by humans.

  • ssim — The Structural Similarity (SSIM) Index measure of quality works by measuring the structural similarity that compares local patterns of pixel intensities that have been normalized for luminance and contrast. This quality metric is based on the principle that the human visual system is good for extracting information based on structure.

  • Obtain Local Structural Similarity Index

  • Compare Image Quality at Various Compression Levels

Obtain Local Structural Similarity Index

This example shows how to measure the quality of regions of an image when compared with a reference image. The ssim function calculates the structural similarity index for each pixel in an image, based on its relationship to other pixels in an 11-by-11 neighborhood. The function returns this information in an image that is the same size as the image whose quality is being measured. This local, pixel-by-pixel, quality index can be viewed as an image, with proper scaling.

Read an image to use as the reference image.

ref = imread('pout.tif');

Create an image whose quality is to be measured, by making a copy of the reference image and adding noise. To illustrate local similarity, isolate the noise to half of the image. Display the reference image and the noisy image side-by-side.

A = ref;

A(:,ceil(end/2):end) = imnoise(ref(:,ceil(end/2):end),'salt & pepper', 0.1);

figure, imshowpair(A,ref,'montage')

Calculate the local Structural Similarity Index for the modified image (A), when compared to the reference image (ref). Visualize the local structural similarity index. Note how left side of the image, which is identical to the reference image displays as white because all the local structural similarity values are 1.

[global_sim local_sim] = ssim(A,ref);

figure, imshow(local_sim,[])

Compare Image Quality at Various Compression Levels

This example shows how to test image quality using ssim. The example creates images at various compression levels and then plots the quality metrics. To run this example, you must have write permission in your current folder.

Read image.

I = imread('cameraman.tif');

Write the image to a file using various quality values. The JPEG format supports the ‘Quality' parameter. Use ssim to check the quality of each written image.

ssimValues = zeros(1,10);
qualityFactor = 10:10:100;
for i = 1:10
    
    imwrite(I,'compressedImage.jpg','jpg','quality',qualityFactor(i));
    
    ssimValues(i) = ssim(imread('compressedImage.jpg'),I);
end

Plot the results. Note how the image quality score improves as you increase the quality value specified with imwrite.

plot(qualityFactor,ssimValues,'b-o');

xlabel('Compression Quality Factor');
ylabel('SSIM Value');

Skype

Chat OnlineColor Difference Helper

Phone

+86 755-26508999
24 hours online

Top
濮阳县| 抚宁县| 察雅县| 麻阳| 新巴尔虎右旗| 乌拉特中旗| 阿坝县| 万全县| 吉林省| 称多县| 铅山县| 长顺县| 朝阳县| 江西省| 天峨县| 卓尼县| 宿松县| 莱阳市| 临武县| 罗甸县| 西安市| 运城市| 高阳县| 杭州市| 和龙市| 大悟县| 信宜市| 苏尼特右旗| 松原市| 宝鸡市| 长宁区| 凤山市| 西乌| 郓城县| 榆树市| 临湘市| 镇沅| 安宁市| 长乐市| 铜川市| 陈巴尔虎旗|