Comparing Folder images
Tim from United States  [3 posts]
11 months
Hello, I am trying to compare all the images in one Folder against all the images in another folder. The images are all named the same and are in the same order. I have a useable image compare test, but it looks like the images are not in sync for the duration of the test, and in the later half of the folder two different images are being compared.

ex.  Image 23 to Image 23 (desired)
      Image 25 to Images 23.  (currently test)

My pipe looks like this:

Load image\Path1
Marker Save
Load image\Path2
Marker Save

Is there a way a can make sure the images stay in sync?
The Frame Delay on both load images are the same.

Thanks in advance.
Tim from United States  [3 posts] 11 months
It also looks like If I reduce teh frame delay that it does not write all fails back to the failure folder.
Steven Gentner from United States  [261 posts] 11 months

The best way to guarantee this is to use only one Load Image and then change the actual path to be used for the second load image. For example, if you are loading


you would use a small VBScript to rename it to the second path:

filename = GetStrVariable("IMAGE_PATH")

filename = Replace(filename, "\path1", "\path2")

SetVariable "IMAGE_PATH", filename

and then use [filename] in the second image load. That will ensure that the images are always in sync.


Steven Gentner from United States  [261 posts] 11 months
Oh, and the reason that they do get out of sync is that one image or some other file may exist in one folder but not the other. Thus its best to rename one to the other to avoid any mismatch of the folders.

Tim  [13 posts] 11 months

The folder sizes should be exactly the same, with no extra files, I use a certified product example, and take a grid style set of images of it. I then take a work in progress product and take the same amount of images and same coordinate names as the certified product. I then want to compare each X1Y1, X1Y2 etc. grid of the WIP product against the Certified product.  I have the Certified folder as load image one, with read images in Folder selected, I normalize the image and set it to a marker, then do the same for image two, the WIP product. I then use a VBscript to create a file path for the failure images. I then align the two markers,  crop the image according to the XY offset found from the align image module. I use the grayscale and mean filter3, followed by a threshold and erode1. I set the blobsize then use the geometric_statistics module to find if my blob size is over a specified size, if so, it writes the WIP product image back to the fail path from the VB script.

If I reduce the frame delay, it would appear that the images are processing faster than the pipeline can process X1Y1 and by the time it hits the IF statement the fail path has been updated to X1Y2 causing improper fails to write back to the fail folder unless I change the frame delays to around 5075ms for first image module and 5000ms for 2nd load image module. Would this correct itself using your method above? Or is there a more efficient way I can do this?

Another small issue I found, if I set the failure threshold to blob sizes larger than 60,000, it would fail images with blob areas 60,000 to 99,999 but if the blob size was larger than 100,000 if wouldn't register for the if statement. I found if I set the if statement to be greater than 60,000 and less than 200,00 if would write back all of the images, excluding the issues with the frame delay.

Thanks in advance,
Tim  [13 posts] 11 months
My Pipeline

Steven Gentner from United States  [1371 posts] 9 months

Seems like you have a couple issues going on here which we can't completely understand without sample images and the actual robofile (press save button, type in something.robo) to test with. Note that everything is timed based on the pipeline, so the system will not load in images faster than it can process them ... because otherwise it will not load them in. While I am sure it appears that way what most likely is happening is that you can't keep track of the processing when you speed things up and thus it seems confusing. Its not unusual for the pipeline to be running at +50fps using machine vision cameras so the system is built for speed.

What might be best at this point (assuming this project is still of interest) is to send us a quick email using our contact form so that we can exchange information outside of this public forum as I see you have blanked out some of the paths in the robofile image that you posted which implies sensitive information.

Tim  [13 posts] 9 months
Email sent.

Thanks in advance.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index