ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 how to calculate definition of image?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

liu8670

China
9 Posts

Posted - Nov 29 2012 :  06:05:51  Show Profile  Reply
When I get many image
but I want to get one best image
how to calculate definition of image?

xequte

38615 Posts

Posted - Nov 29 2012 :  11:47:49  Show Profile  Reply
Hi

Do you mean the dimensions (size) of the image? or DPI?

You can load all information about a file using:

http://www.imageen.com/help/TImageEnIO.ParamsFromFile.html

Then read the details from:

http://www.imageen.com/help/TImageEnIO.Params.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

liu8670

China
9 Posts

Posted - Nov 29 2012 :  21:24:10  Show Profile  Reply
Hi,
When I get many image using different focus,
I want to get the best image in these image.
How can I get it?
Jihong Liu


Go to Top of Page

fab

1310 Posts

Posted - Dec 14 2012 :  01:25:29  Show Profile  Reply
Hi,
I'm not sure I understood the question. Anyway, to detect a blurred image I have a simple idea (may not work for all types of image...). Calculate the standard deviation of the image, and get the image with the highest value.

This is an example for RGB images:

function IEGetStandardDeviation(bitmap:TIEBitmap):double;
var
  avg, stddev: array [0..2] of double;
  c, row, col:integer;
  px: pbyte;
begin
  IEGetAverageValues(bitmap, avg);
  for row := 0 to bitmap.Height-1 do
  begin
    px := bitmap.Scanline[row];
    for col:=0 to bitmap.Width-1 do
      for c:=0 to 2 do
      begin
        stddev[c] := stddev[c] + sqr(px^ - avg[c]);
        inc(px);
      end;
  end;
  for c:=0 to 2 do
    stddev[c]:=sqrt( stddev[c]/(bitmap.Width*bitmap.Height-1) );
  result := (stddev[0] + stddev[1] + stddev[2]) / 3.0;
end;


...now you can write:

ImageEnView1.IO.LoadFromFile('image1.jpg');
d1 := IEGetStandardDeviation(ImageEnView1.IEBitmap);
ImageEnView1.IO.LoadFromFile('image2.jpg');
d2 := IEGetStandardDeviation(ImageEnView1.IEBitmap);
if (d1 > d2)
   ...image1 should be "less-blurred" than image2



Of course this is not possible for black/white images.
Go to Top of Page

liu8670

China
9 Posts

Posted - Dec 17 2012 :  05:24:44  Show Profile  Reply
Thanks very much!
Go to Top of Page

andyhill

Australia
133 Posts

Posted - Jan 03 2013 :  12:38:13  Show Profile  Reply
Fabrizio, Where can we get the IEGetAverageValues code mentioned above ?

Andy
Go to Top of Page

fab

1310 Posts

Posted - Jan 03 2013 :  12:42:50  Show Profile  Reply
IEGetAverageValues is declared and defined in imageenproc unit.
Go to Top of Page

andyhill

Australia
133 Posts

Posted - Jan 03 2013 :  12:47:39  Show Profile  Reply
thanks

Andy
Go to Top of Page

andyhill

Australia
133 Posts

Posted - Jan 03 2013 :  12:57:49  Show Profile  Reply
Is there a way to identify similar images in code (not byte for byte identical but original verses say edited version) within reason of course, I tried the code above but it is not suitable for this purpose.



Andy
Go to Top of Page

fab

1310 Posts

Posted - Jan 08 2013 :  02:13:51  Show Profile  Reply
Please most two sample images to compare, just to know the complexity of the comparison.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: