Specification for new plugin to show false color coords of matches in same image - bootchk/resynthesizer GitHub Wiki

This is a specification for a new plugin I wish someone would write.

In the branch "falseColorMatch" I added a feature to the engine and to the control panel plugin. Feature is "Generate false color coordinate to matches".

It returns false colors for coords in the source image. The origin is upper left. The vectors are all pointing from the origin to the best match. In other words, pointing down and to the right. See another wiki page for details.

When the target and source (corpus) are the same image, it would be better if the vectors were from the target region (selection) coords to the best match coords. That is, vectors pointing from the target pixel to the source pixel (in the same coordinate system or frame.) That is, often in all different directions. Then the false colors would tell the user the direction of the best match, in relation to the target. This only makes sense when the target and source are the same image. (Or if you align different source and target images in some larger frame?)

Summary of process: invoke the resynthesizer to get the coord vectors, calculate new vectors (vector to match minus vector to target), translate (?) the difference vectors so they are all positive (so the origin is say at the center of the target region), and rescale them so they fit in 8 bits. Return them in a new image. Also invoke the resynthesizer and return the usual result. Both result images in new image instances (the size of the target selection), say side by side. Without actually altering the original image.

I hope written in Python (because my Scheme is rusty.)

The new plugin would not need to have any controls. It would just do the most common thing (random filling order.) The value for the "useBorder" param to resynthesizer engine would be 11 (meaning random, but generate false color coords.)

The new plugin would need to also copy the target image into a temporary source image, and invert its selection (just as the "Heal selection" plugin does.)

If the result is mostly reddish, it means the best match came from the sides (lesser or greater x). Similarly if the result is mostly greenish, it means the best match came from the top and bottom. I think that with the existing result (vectors from the origin of the source), it is harder to make that interpretation.

Maybe there is some other "false coloring" that would be better. E.g. use the Blue pixel for length of the vector?