From: Ashish Uthama on 12 Mar 2010 09:36 On Fri, 12 Mar 2010 08:36:22 -0500, Avengeline <avengeline.biz(a)gmail.com> wrote: > i just want to find the edge width for every edges.. then divided by the > number of edges to obtain a blur metric.. so, what do you say? It would help if you clarify for us what you mean by an 'edge'. You first post indicated that you were looking for edges by scanning the image along a row. This would be useful to detect edges which are vertical. What do you plan to do when an edge is not vertical? A non-vertical edge might explain what you see in your graph. conv_i=rgb2ycbcr(imread('i.jpg')); Y=conv_i(:,:,1); BW = edge(Y,'sobel',[], 'vertical'); imshow(BW) If you run this, how would you manually define the 'number of edges'? (or are you looking for the number of disconnected vertical lines in the sobel filtered image which is longer than a given minimum lenght :) )? I am not familiar with 'blur metrics', if might help other CSSMers to elaborate.
From: ImageAnalyst on 12 Mar 2010 10:59
On Mar 12, 8:36 am, "Avengeline " <avengeline....(a)gmail.com> wrote: > i just want to find the edge width for every edges.. then divided by the number of edges to obtain a blur metric.. so, what do you say? ----------------------------------------------------------------------------------- How about something like this: clc; clear all; close all; workspace; % Get the original image and display it. filename = 'C:\Documents and Settings\tk2013\My Documents\Temporary stuff\img150.bmp'; rgbImage = imread(filename); subplot(2,2,1); imshow(rgbImage); title('Original color Image'); set(gcf, 'Position', get(0,'Screensize')); % Maximize figure. % Get the luminance channel and display it. conv_i = rgb2ycbcr(rgbImage); Y = conv_i(:,:,1); subplot(2,2,2); imshow(Y, []); title('Y image'); % Create a Sobel filtered image. sobelFilter = fspecial('sobel'); edgeImage = imfilter(Y, sobelFilter, 'replicate'); % BW = edge(Y,'sobel',[], 'vertical'); % Display Sobel image. subplot(2,2,3); imshow(edgeImage, []); title('Edges of the Y Image'); % Calculate a metric that is related to % how many edges are in the image and their strength. sumOfValues = sum(edgeImage(:)); message = sprintf('The edge parameter for this image is %d', sumOfValues); msgbox(message); Or you could look at the energy in certain ranges of the FFT to characterize blur. Usually blur is characterized by the Modulation Transfer Function (MTF). You should look that up since it's pretty much the standard. But it assumes that you know what the true, blur- free image looks like. |