Closed MorganGrundy closed 4 years ago
I have been experimenting with multiple possible methods but so far not much success.
First tried using ORB feature detector. Problems:
To try and remedy the previous problems I decided to try and extract shape from the images and compare them. I used a Canny edge detector and then extracted contours from the edge images using cv::findContours(). The cell contours were sorted by decreasing length and then a greedy algorithm was used to match each with the most similar library contour (using cv::matchShapes() for similarity metrics). Problems:
Sticking to the idea of comparing contours, but avoiding cv::matchShapes(). Possible comparison methods:
Still the results were not very good. In hindsight the greedy algorithm for contour matching was probably a poor choice. I want to revisit this and instead allow multiple matches per contour.
More research, tried to find some information on Robert Silvers' method. Found code in the patent description although had a hard time reading it as all the newline characters seem to be missing. From his code and patent description it seems his method is somewhat similar to mine. Honestly I was expecting more as I had seen his Photomosaics referred to as preserving colour, shape, texture, and other qualities. While my Photomosaics do preserve shape to some extent, I find that it is quickly lost with larger cell sizes.
I will continue researching and experimenting to find some method for this. Though I now expect the impact of the method to be less noticeable than I was originally hoping for.
This method is far from perfect but so far has provided the best results. Considering that I do not think that feature/shape matching will be very viable, atleast in current conditions. To be viable I believe some of the following would be needed:
All of which come with their own problems. So I will close this issue for now, possibly revisiting it in the future.
Is your feature request related to a problem? Please describe. With larger cells while the colour is mostly preserved the shape is lost. As cell size increases the original image quickly becomes lost in the Photomosaic.
Describe the solution you'd like Currently cells best fit are chosen purely from colour difference, they should in addition consider the features of the images. Some form of feature detection + matching can be used to determine how similar the cells are.