- It's going to be used on other images
- You know what the other images are
- you have a formal description of what the rejection criteria are
Find the best between 2 images
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
For my project I have these 2 photos:
As you can see there are some differences between these 2 images.
What I want to do is to compare somehow these 2 images and to reject the second one because of the white pixels at the up right corner.
To be more clear, I want to compare these 2 images and to recognize that the second one has many white pixels and reject it.
댓글 수: 2
DGM
2021년 10월 18일
편집: DGM
2021년 10월 18일
Code that will identify one of these two images is likely going to be a complete waste of time unless:
If all you have are two images and you already know which is rejected, then your task is done.
Otherwise maybe you can do some sort of histogram analysis or saturated pixel count? Without knowing items 2 &3, it's hard to know what is even appropriate.
Re: saturated pixel count, you could look at the images and try to decide what the rejection criteria are supposed to be...
A = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/770036/image.jpeg');
B = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/770041/image.jpeg');
Asat = [nnz(A == 0) nnz(A == 255)] % [black white]
Bsat = [nnz(B == 0) nnz(B == 255)] % [black white]
Which might be adequate to identify and reject B, if you only care about white and if all your pictures have similar content and defects.
Consider the example
X = rgb2gray(imread('peppers.png'));
X = imadjust(X,stretchlim(X,0));
A = imadjust(X,[0 0.89]);
B = imadjust(X,[0.07 1]);
imshow(A)
clf
imshow(B)
Which image is "worse"? Both have been damaged to approximately the same degree.
% total saturated pixels
Asat = [nnz(A == 0) nnz(A == 255)] % [black white]
Bsat = [nnz(B == 0) nnz(B == 255)] % [black white]
% number of pixels contributed by defect
dw = sum(A==255,'all')-sum(X==255,'all') % white pixels clipped in A
db = sum(B==0,'all')-sum(X==0,'all') % black pixels clipped in B
If only overexposure matters, the answer might be clear. In order to get meaningful results, you need to define what's meaningful.
채택된 답변
yanqi liu
2021년 10월 18일
sir,may be use some score, such as
clc; clear all; close all;
im1 = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/770036/image.jpeg');
im2 = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/770041/image.jpeg');
score1 = [brisque(im1) niqe(im1)]
score2 = [brisque(im2) niqe(im2)]
댓글 수: 2
yanqi liu
2021년 10월 19일
sir, it is No-Reference Image Quality Assessment
so, the value higher and the quality lower
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!