-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added implementation for KMeans algorithm in GIL #587
base: develop
Are you sure you want to change the base?
Added implementation for KMeans algorithm in GIL #587
Conversation
This is an implementation of Kmeans Clustering algorithm for Boost GIL. The input image filename(absolute/relative) must be passed as a command line argument.During execute ,input the required number of iterations and K value that indicates number of clusters. Output is stored in the file named output-kmeans.tif I have attached the example output of my implementation for the input image frog.jpg(attached),and number of clusters and iterations being 10 and 1 respectively. I would request the community to kindly provide feedback for my implementation I would also like to use the implementation of this algorithm for my gil competency test for GSOC 2021.
This algorithm is used everywhere so shouldn't this be introduced as a usable functionality of the library instead of an example? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't have to provide output file
I had thought that first my implementation will be checked whether its working correctly or not and so I did it in the form of an example. But if you suggest, I shall make it in the form of a usable functionality and then raise a pull request. I am also removing the output files following your suggestion. |
First example and then the actual implementation just increases the amount of work reviewers and you will have to do. Let's just review the final thing. |
Turned the example file into a usable functionality(.hpp) for KMeans Clustering as suggested by lPranam and added it to the image_processing folder of boost.
Codecov Report
@@ Coverage Diff @@
## develop #587 +/- ##
===========================================
+ Coverage 78.59% 78.72% +0.13%
===========================================
Files 117 118 +1
Lines 5003 5034 +31
===========================================
+ Hits 3932 3963 +31
Misses 1071 1071 |
@lpranam I have made the necessary changes as suggested . |
new functionality also needs tests... |
@lpranam Ok,I shall soon make the changes and update here |
@lpranam Is it ok if for the test file I keep a static dataset? I saw the test files of other algorithms where they have fixed the input and expected output data like the pixel value of images |
@Sayan-Chaudhuri yes, as far as it covers the cases it is okay. |
@lpranam I wish to upload the test file along with the KMeans implementation but I want to clarify certain things.
If you can kindly find time to clarify these doubts, I will be highly grateful. |
Upon your clarification, I shall push the files accordingly |
you should upload it if, it does not fit then obviously can be removed but need to have look. |
can also you PR must pass all the CI checks |
Added a new header file for Kmeans |
@lpranam I have also added the test file |
Hi @Sayan-Chaudhuri ,
I don't think this is related to any changes made by you in this PR, you should probably update this branch with latest develop branch of boost Gil. PS : I encountered a similar error here |
@meshtag how to do so what you have mentioned? |
There are a couple of ways to do this, you can look here to understand some common ones. |
Please, read the CONTRIBUTING.md on updating your PR. Not to mention the lazy button-based way recently offered by GitHub |
This is an implementation of Kmeans Clustering algorithm for Boost GIL. The input image filename(absolute/relative) must be passed as a command line argument.During execute ,input the required number of iterations and K value that indicates number of clusters.
Output is stored in the file named output-kmeans.tif
I have attached the example output of my implementation for the input image frog.jpg(attached),and number of clusters and iterations being 10 and 1 respectively.
I would request the community to kindly provide feedback for my implementation
I would also like to use the implementation of this algorithm for my gil competency test for GSOC 2021.
Description
References
Tasklist