Mallikarjun Posted September 27, 2011 Share Posted September 27, 2011 Hi. I am new to Autoit i have a problem in comparing the two screenshos one original and another is taken sceenshot of emulator ...i have attached the screen shots to compare and find the differance in image........ Please help me to make it automate the image comparison........... thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 27, 2011 Moderators Share Posted September 27, 2011 Mallikarjun, Wrong part of the forum, no attachments to be seen, and asking for someone to write code for you. Pretty poor post! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Mallikarjun Posted September 27, 2011 Author Share Posted September 27, 2011 Thanks for reply, actuly i am using the code $image1 = FileRead("C:\image\scree2.bmp") $image2 = FileRead("C:\image\scree3.bmp") If $image1==$image2 Then MsgBox(0,"test","files match ") Else MsgBox(0,"test","files do not match") EndIf but i want to ignore the some portion in the image while comparing... is it possible? Link to comment Share on other sites More sharing options...
Bert Posted September 27, 2011 Share Posted September 27, 2011 Why do you need to compare the image from the emulator? I take it you are running windows in a virtual machine? Why just not run the code there to check what you need? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
monoscout999 Posted September 28, 2011 Share Posted September 28, 2011 (edited) Comparing the image file like a text is not correct, if the pic have a comment on the headder or something this will be different. if you want to compare the pixels of each you should use LockBits or something similar. Edited September 28, 2011 by monoscout999 Link to comment Share on other sites More sharing options...
JohnOne Posted September 28, 2011 Share Posted September 28, 2011 (edited) If you want to just read certain parts of a file then take a look at FileSetPos()function example. EDIT: linkage not working. Edited September 28, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Mallikarjun Posted September 29, 2011 Author Share Posted September 29, 2011 thanks for replying ... but i am looking for fing the perticular area in the image like buttons and buttons tex is displating or not .... is fixel find with color is helpull for me?C:\image\tt.bmp Link to comment Share on other sites More sharing options...
Mallikarjun Posted October 3, 2011 Author Share Posted October 3, 2011 Now i using $image1 = FileRead("C:\image\scree2.bmp") $image2 = FileRead("C:\image\scree3.bmp") If $image1==$image2 method to compare the images ... is it posible to compare the dowm portion and top portion of the image ..... 2)And i have one more quetion i have used ....Func FileListToArray($Dir , $Dir2) Dim $FilePath,$FilesList,$Files,$i Dim $FilePath2,$FilesList2,$Files2,$j $FilesList=_FileListToArray($Dir) $FilesList2=_FileListToArray($Dir2) If (Not IsArray($FilesList)) and (@Error=1) Then MsgBox (0,"","No Files\Folders Found.") Return EndIf $Files=_FileListToArray($Dir,"*",1) $Files2=_FileListToArray($Dir2,"*",1) If IsArray($Files ) Then For $i=1 To $Files[0] for $j=1 To $Files2[0] $FilePath=$Dir&"\"&$Files[$i] $FilePath2=$Dir&"\"&$Files2[$j] If $FilePath==$FilePath2 Then EndIf Next Next EndIf EndFunc to get the image files from the directory ... But its no working properly,, Please check it what is the wrong?....Help is appreciated. Link to comment Share on other sites More sharing options...
numdig Posted October 4, 2011 Share Posted October 4, 2011 (edited) If you want to check binary content, you'll be better off using something like that:Func CompareFilesBinaryContent($file1, $file2) $resTxt = "" $handle = FileOpen(FileGetShortNameV2($file1), 16) $content1 = FileRead($handle) FileClose($handle) $handle = FileOpen(FileGetShortNameV2($file2), 16) $content2 = FileRead($handle) FileClose($handle) $str_diff = StringCompareExV1($content1, $content2) If $str_diff Then $resTxt = "Files have different binary content." $resTxt &= @CRLF & "File1='" & $file1 & "'" $resTxt &= @CRLF & "File2='" & $file2 & "'" EndIf Return $resTxt EndFunc ;==>CompareFilesBinaryContent As for isolating part of image that are similar from the ones that are different, this is difficult problem. A lot of people are working on it ( inclusing in people in Universities - pattern recognition, image similarities, etc. ), but I haven't stumbled on an easy to use/implement solution yet. Academia is on it. Developers are on it ( eg. http://www.codeproject.com/KB/GDI-plus/comparingimages.aspx ). Let us know if you have more luck. On a more personal note, I started writing a C# application a couple years ago that would group pixels and and search for similarities but interrupted this project because I found an easier way to achieve what I needed: 1/ I compare bare binary content and then 2/ I swap the 2 images every second at the same place and I visually check for differences (works great even for very tiny differences). Take care. -- Edited Tuesday, 4 October 2011, 6:23 PM Note here is another similar work: if you can search for a pixel on the screen, then you can search for a given pixel in another image. The problems are somehow related. Edited October 4, 2011 by Chess Link to comment Share on other sites More sharing options...
Mallikarjun Posted October 15, 2011 Author Share Posted October 15, 2011 Thanks for all reply.. I have another problem is to run the multiple application scripts one by one ..The application list is in treeview list .....Is there any solution to run the scripts one by one ...reply is appreciated.. Link to comment Share on other sites More sharing options...
Zedna Posted October 15, 2011 Share Posted October 15, 2011 As about compare images lokk here As about your last question: It's too vaque, you must be more exact to get help here. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Mallikarjun Posted October 15, 2011 Author Share Posted October 15, 2011 Thanks for reply.. Ihave maked the scripts for application to execute...my problem is to find the application name in the list and execute the perticular application one by one ..Plz reffer the attached file... Link to comment Share on other sites More sharing options...
Zedna Posted October 15, 2011 Share Posted October 15, 2011 What's the ClassNameNN of that control? Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Morthawt Posted October 16, 2011 Share Posted October 16, 2011 If you need to check if an image is the same, why not render the image on a GUI and use PixelChecksum to calculate a checksum of a pre-defined area? If the images are the same size and the part on the image to check is in the same place, then doing this method will give you a clear yes or no to if its different. Even if the location is different you may be able to intuit the location to search using PixelSearch and PixelGetColor to define the coordinates of an area that could be quantified each time yet may be in a different location on the screen perhaps. Free and easy Autoit scripting video tutorials (plus more videos always coming!) General video tutorials, especially correct and safe TeamSpeak permissions tutorials. Link to comment Share on other sites More sharing options...
Mallikarjun Posted October 16, 2011 Author Share Posted October 16, 2011 Thanks for reply .... Please find the attached image for class and control information.. Link to comment Share on other sites More sharing options...
Mallikarjun Posted October 16, 2011 Author Share Posted October 16, 2011 I am finding the apllication in the list by copying the text and comparing that text to the given application name ;copying the application name $data= ClipGet() Local $file=FileOpen($Appname, 1) FileWrite($file,$data) _FileReadToArray($file, $fdata) $CountLines = _FileCountLines($file) For $x = 1 to $CountLines Step 1 $sourcePath = $fdata[$x] Next If StringRegExp ($sourcePath, "AnimationApp", 0) == 1 Then MsgBox(0, "yes", "i am") EndIf problem is to run the scripts one by one ...after finding the application.... Link to comment Share on other sites More sharing options...
Mallikarjun Posted October 30, 2011 Author Share Posted October 30, 2011 Thanks to all.. i am running all my application in one script..... Link to comment Share on other sites More sharing options...
Bert Posted October 30, 2011 Share Posted October 30, 2011 If I didn't know better I would say that is the Eclipse code editor The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Mallikarjun Posted January 27, 2012 Author Share Posted January 27, 2012 (edited) Hi All, I have some problem in this code to compare the 2 directory images plz see bellow script.... Func ImgComp2() Global $file1=_FileListToArray("C:Sdk_AutomationDatabaseWQVGA" & $mytext2 & "", "*.bmp", 1) Global $file2=_FileListToArray("C:Sdk_AutomationOutputImagesWQVGA"& $mytext2 & "","*.bmp",1) For $i=1 To UBound($file1)-1 $ram1=FileRead($file1[$i]) $ram2=FileRead($file2[$i]) ;MsgBox(0, "", $file1[$i]) ;MsgBox(0, "", $file2[$i]) If $ram1==$ram2 Then Imglog2("ok") ;MsgBox(0, "", "ok") Else Imglog2("NG") ;MsgBox(0, "", "NG") EndIf Next I am comparing 2 directory images one for updating the outputs but its not working properly plz check it once help should be apreciated... Thanks in advance Edited January 28, 2012 by Mallikarjun Link to comment Share on other sites More sharing options...
Mallikarjun Posted January 28, 2012 Author Share Posted January 28, 2012 (edited) Its comparing the images when i comparing the single images. $ram1=FileRead("C:arjun1.bmp") $ram2=FileRead("C:arjun2.bmp") If $ram1==$ram2 Then MsgBox(0, "", "good luck") Else MsgBox(0, "", "no") EndIf but the problem occurs to compare the multiple images. help should be appreciated thanks Edited January 28, 2012 by Mallikarjun Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now