Closed bmaltais closed 7 years ago
But how does it compare to the original mode 0?
Let me run a quick test. I will add the result to the imgur post and report here.
OK. Updated the imgur post. Final score of original mode 0 (pure random) is 0.036257. So the final scores overall are:
Pick best shape mode 0: 0.032241 Orig mode 0: 0.036257 Mode 1: 0.034719
The funny thing is that mode 1 look the best to me... but score for new mode one is best.
Update:
Lowering the alpha parameter down to 100 actually improve significantly the result by allowing more layering.
I guess the issue with the original mode 0 is that BestRandomShape isn't a good predictor of how well the shape will hill climb. I tested this hypothesis by tweaking this line:
https://github.com/fogleman/primitive/blob/master/primitive/model.go#L121
You can try something like 1, 100, 32 instead of 100, 100, 8 and get a better result.
Anyway, given 5x the processing time, I could probably get an even better score with some tweaking of these parameters. :) But I've been trying to balance quality with processing time so far...
Indeed, it does provide better result. But combined with the cycling through all shapes still provide the best results. I am thinking of removing the pass through circles and rectangles as those will be pretty much be approximated by elipses and rotated rectangles. This will cut down on time.
I am also testing an option where alpha value is being searched for the best match score. This is also improving the final score at the cost of speed.
Yeah, I've searched on alpha before too. I prefer the look of a constant alpha though. I was thinking passing in alpha=0 could indicate doing a search on it.
That would be a great option. Another potential one could be to add the ability for ellipses to be rotated. Right now they are only horizontally or vertically stretched. Similar to the rotated rectangle mode.
I implemented the alpha thing.
Nice. I will give it a try. You were right about the 1,100,32 change. It is almost as good as going through all the shapes. Probably not worth implementing.
Following the thread. Alpha as 0 is much welcome. Thx.
@bmaltais Cool, I'll close for now.
OK, so I pushed my original idea of going through all different mode at each iteration to pich the best form providing the lowest score. The result is that the final score doing it that way is significantly lower than just using mode 1. Mode 1 usually provide the best score of all methods.
http://imgur.com/a/11jDL
As you can see even with a lower score the triangle method provide the best looking image to my eye... but it is interesting to see that you can get lower score bay going through all possible shapes. Here is the code I used. Not optimal but you might want to try it:
This is the parameters I used:
primitive -i src.jpg -o test0v1.svg -n 1000 -v -m 0
vs
primitive -i src.jpg -o test1v1.svg -n 1000 -v -m 1
Obviously the downside is that it take 5 times longer to get the result...