how to see if 2 matrices are identical?
I have two equal size image matrices. I need some way to compare them and generate a boolean result whether or not they are equal. I can run them through a [jit.op @op ==] and I get a pure white matrix if they are identical, but I can't find a way to get a boolean from this. Is there a way to quickly test if all three planes (not caring about 4th containing alpha) are "solid white"? Gotta be a way.. thanks for help.
don't know if it's an efficient solution but one way is to sum all cell values. if it's all white your result should be = dim x * dim y for each plane (assuming it's float matrices).
What about using jit.change like this?
try running the resulting matrix through a jit.3m object, and connect a > object to the "mean" output.
all of these solutions seem worth trying. thanks!
i'm trying to locate a 30x30 image within a 1024x768 screenshot. i just tried looping through each coordinate of the full image and pulling 30x30 sub-matrices, before any comparison, and it's taking longer than hoped.
think i will try comparing only 2 of the rgb planes, maybe even 1...
think i'll loop through and test only 1 plane each time. if it matches i'll test the others, see if that helps on speed.
are you doing this with live camera input? take into account that (unprocessed) live input will never be exactly equal to a pre-recorded image because of noise, changing light conditions, etc. you'll have to check whether it's within a range around the target image instead.
naw, i'd be playin quite a joke on myself trying to do this with video. it's just the desktop of the screen, so it's consistent color values.