5 Jul 2007 14:08
Re: Problem in using Image Comparison
Timothy Wall <twall <at> users.sf.net>
2007-07-05 12:08:17 GMT
2007-07-05 12:08:17 GMT
If you come up with some changes that work, I'll apply the changes to
the core library.
I can make some time available to work on it if you're willing to pay
for the consulting. Otherwise, I'm a bit busy right now.
T.
On Jul 5, 2007, at 4:57 AM, Aamir Yaseen wrote:
> Wall,
> will you be able to make this change in code for us or we need to
> do it on our side?
>
> PS:
> In case we have to do this change, Will you be able to point us the
> code segment where we should be making changes?
>
>
> --
> Aamir Yaseen
>
>
> On 7/3/07, Timothy Wall <twall <at> users.sf.net> wrote: I'd recommend
> saving as PNG or other lossless format rather than
> jpeg, since you may get different results (especially cross-platform,
> but potentially on the same platform, depending on the JPEG settings
> and VM version).
>
> The library should probably be updated to use PNG (falling back to
> JPG if png support is unavailable).
>
>
> On Jul 2, 2007, at 10:16 AM, sami jan wrote:
>
> > Hi
> >
> > The example I have tested it on is the CelsiusConverter example. The
> > steps are as follows:
> >
> > 0. Start CelsiusConverter test - target class name:
> > example.CelsiusConverter, classpath contains "." & "lib
> \example.jar" -
> > Select Capture -> All actions
> > 1. Type 100 in the edit box
> > 2. Click "Convert..."
> > 3. Hover the mouse over the edit box (do not click)
> > 4. Press Shift-F3
> > 5. Click the "X" on the CelsiusConverter GUI to end the test
> >
> > This generates a file: "CelsiusConverter.xml-JTextField
> Instance.jpg"
> > - an Image comparison always yields <false> - this always happens at
> > pixel 7 - the comparator code is <at> ImageComparator::compare(Object
> > obj1, Object obj2)
> >
> > ImageComparator::compare(...) is called from
> > ComponentTester::assertImage(...) which tries and compares passes an
> > image buffer and a file to be compared - I temporarily saved the
> image
> > buffer to a file - this is how ComponentTester::assertImage(...)
> looks
> > in my code:
> >
> > ------------------------------------------------------
> > java.awt.image.BufferedImage img = capture(comp, ignoreBorder);
> > try{
> > File file = new File("newimage.jpg");
> > //ImageIO.write(img, "jpg", file);
> >
> > ImageComparator.writeJPEG(file, img);
> >
> > }catch (IOException e)
> > {}
> >
> > ImageComparator ic = new ImageComparator();
> > int result = ic.compare(img, fileImage);
> > return result == 0;
> >
> ----------------------------------------------------------------------
> > --
> > Comparing this temporary file with the one generated during
> recording
> > shows that they are exactly similar - I did this using beyondCompare
> > and a standAlone PixelGrabber java program
> >
> > The problem occurs (I guess) somewhere during conversions b/w image/
> > object/file
> >
> > Just an FYI - the buffer image at pixel[7] = "-1" and the the file
> > image at pixel[7] = "-65794" - (problem with datatypes?)
> >
> > On 7/2/07, Aamir Yaseen <aamir.yaseen <at> gmail.com> wrote:
> >> Adding Sami in the loop, sami is also working on the Abbot.
> >>
> >>
> >> Aamir Yaseen
> >>
> >>
> >> On 7/2/07, Aamir Yaseen < aamir.yaseen <at> gmail.com> wrote:
> >>> I have tried many times to compare images of different
> >>> components, but
> >> unable to get the test result to be Positive.
> >>> Does it really works directly? or we must,modify source ?
> >>>
> >>> Is this possible for anyone to send me any script/piece of script
> >>> with the
> >> image which gives result as positive in case of Image comparison?
> >>>
> >>>
> >>>
> >>> --
> >>> Regards,
> >>> Aamir Yaseen
> >>>
> >>>
> >>>
> >>>
> >>> On 7/2/07, Timothy Wall < twall <at> users.sf.net> wrote:
> >>>> The default ImageComparator simply does a pixel by pixel
> comparison
> >>>> of the screen capture and an ImageIcon created from the given
> file.
> >>>> You can always instrument ImageComparator.compare to discover
> which
> >>>> pixel is different and why.
> >>>>
> >>>> This could probably be improved to provide for some variation in
> >>>> pixel values; antialiased text or subpixel rendering might yield
> >>>> different results depending on component location.
> >>>>
> >>>> On Jul 2, 2007, at 7:34 AM, Aamir Yaseen wrote:
> >>>>
> >>>>> Hi ,
> >>>>> I am having problem in Image Comparison using Abbot.
> >>>>> Following is the way, how i am trying to perform Image
> comparison.
> >>>>>
> >>>>> <assert args ="JTextField Instance,CelsiusConverter.xml-
> JTextField
> >>>>> Instance.jpg,true" class="abbot.tester.ComponentTester "
> >>>>> method="assertImage" />
> >>>>> This command is always failed. whereas both components looks
> like
> >>>>> same.
> >>>>> Also I also did the Image Comparison using image and buffer
> >>>>> created
> >>>>> using abbot source code. Manuel comparison of pixels gives equal
> >>>>> result but through Abbot I am unable to do so.
> >>>>>
> >>>>>
> >>>>> Any help will be highly appreciated.
> >>>>>
> >>>>>
> >>>>> PS:
> >>>>> Attach is the Script and Image for Ref.
> >>>>>
> >>>>> --
> >>>>> Kind Regards,
> >>>>> Aamir Yaseen
> >>>>>
> >>>>> <CelsiusConverter.xml>
> >>>>> <CelsiusConverter.xml-JTextField Instance.jpg>
> >>>>>
> >>
> ---------------------------------------------------------------------
> >> -
> >>>>> ---
> >>>>> This SF.net email is sponsored by DB2 Express
> >>>>> Download DB2 Express C - the FREE version of DB2 express and
> take
> >>>>> control of your XML. No limits. Just data. Click to get it now.
> >>>>> http://sourceforge.net/powerbar/db2/
> >>>>> _______________________________________________
> >>>>> abbot-users mailing list
> >>>>> abbot-users <at> lists.sourceforge.net
> >>>>>
> >> https://lists.sourceforge.net/lists/listinfo/abbot-users
> >>>>
> >>>> Timothy Wall
> >>>> http://abbot.sf.net
> >>>>
> >>>>
> >>>>
> >>>
> >>
> >>
> ---------------------------------------------------------------------
> >> ----
> >> This SF.net email is sponsored by DB2 Express
> >> Download DB2 Express C - the FREE version of DB2 express and take
> >> control of your XML. No limits. Just data. Click to get it now.
> >> http://sourceforge.net/powerbar/db2/
> >> _______________________________________________
> >> abbot-users mailing list
> >> abbot-users <at> lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/abbot-users
> >>
> >>
> >
> >
> ----------------------------------------------------------------------
> > ---
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > abbot-users mailing list
> > abbot-users <at> lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/abbot-users
>
> Timothy Wall
> http://abbot.sf.net
>
>
>
>
>
> ----------------------------------------------------------------------
> ---
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> abbot-users mailing list
> abbot-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/abbot-users
Timothy Wall
http://abbot.sf.net
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
RSS Feed