reasoning behind seed removal in SP nodes: the cases where seed changes output are so rare that will just confuse the users and occupy unnecessary space in the workflow.
___________________________________________
Additional developments:
Tried to automate tolerance by analyzing the min error distribution of random samples.
After some "adjustments" to avoid large tolerances, was able to get values within a nice range. However, for some textures, the value deed not seem adequate, despite falling within an acceptable range. Thus, I will not include this implementation for now, but it might be a good idea to save it as a gist for future reference.
* abstract repeated code in get_4way_min_cut_patch.
* with the exception of v0, masks are now 2 dimensional arrays.
* re-use already allocated memory when possible.
________________________________
notes:
* patch_blending_vignette cache is cleared post node execution
* new GenParams cleans up args in function, and allows easier adjustments to args if the need arises.
* v0 uses jena2020, ignoring blend_into_patch option.
!! v0 output seemed bizarre on some tests, might have introduced a bug when refactoring...
________________________________
to think about:
* when generating cut mask, output it as single channel instead. blend_into_patch added redundant operation.
* overlap can be small with respect to the block_size, perhaps it is better to handle individual corners in get_4way_min_cut_patch?
* maybe add seed or generator to GenParams.
* patch_search.py renamed to synthesis_subroutines.py.
* fixed number of channels when using cv.floodFill with latents in new min cut implementation.
* make_seamless.py and make_seamless2.py use same "min_cut_patch" implementation.
* quilting.py allows to use v0 implementation, but otherwise, also shares the same as seamless nodes.
* check optional lib using importlib
____________________________________________
Note:
Technically, opencv could be made optional too, but it would require extra work.
Seamless nodes would either have to be excluded or reworked.
Seems like too much work for some niche applications, not motivated to work on that for now. It would have been easier if I had thought about it apriori, but alas...
For now next planned steps are: to integrate the blend functionality; clean up the code; update the documentation; and update/add workflows.
* blend option not yet added to nodes, might cleanup the code a bit first.
* patch_search.py needs to change name, or maybe be separated into different scripts; TBD.
* get_4way_min_cut_patch: make left block optional; rename resBlock to res_block; experimenting with blur (deactivated for now, must be added to node once finished).
* get_min_cut_patch_mask_horizontal: specified mask's dtype.
__________________________
Additional Notes:
* if no additional bugs are found, the function should be moved to another file so that it can be re-used by all implementations. Even if blur option ends up not being added, it allows for potential future changes to be applied to all operations.
* blur implementation using distance transform seems okay, but sometimes it seems that the patch's edges become noticeable. this shouldn't happen due to additional square vignette mask, either it is something independent of the blur or there is some bug/oversight.