-
Notifications
You must be signed in to change notification settings - Fork 61
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
confused about addBinaryData step in image classification #70
Comments
Hello @Aubrey-Y,
For more classes, you should use any of the That method receives the input image and a label image. The pixel values of the label image are the indexes of the classes they belong to. That way, you can use more than two classes. That being said, you should set the number of classes to the right number. In your code, you are setting it to 1 :) I hope this helps! |
I'm assuming that |
It is just another method to do it. Binary classification is usually very popular, so it has its own methods. |
oh and can you explain this a bit more? pixel values are (r,g,b) right? assuming the indexes of my class are 0, 1, 2 what pixel values would they correspond to? |
The input image can be grayscale or RGB, but the label image should be a grayscale image, so every value corresponds to an index. |
Here is the test code we are working with just as a start. The end use case for weka segmentation is as part of a backend service that can handle image classification requests from a frontend application, so trainablesegmentation would just handle the processing from a backend Spring Boot service. (just mentioning this so if there are any foundational issues with what we're trying to do, we get that out of the way early)
Obviously the final version of the code won't look like this but we're just trying to understand the ImageJ api at the moment so
main
is our vehicle for doing so.Terminal Output
So I can confirm that this code "works", we just don't quite understand it.
We have looked into your website for some help https://imagej.net/plugins/tws/scripting#Example:_define_your_own_features
but I don't understand the nature of
addBinaryData
. It seems like we want to createtif
files somehow that are just black and white, where "white pixels belong to one class and black pixels belong to the other class". But it is my understanding of ImageJ that images can have more than 2 classes right?So in the case where there are more than 2 classes, but white and black can only work for the first two, how do we accomplish this step of the script?
Also, is there any example of how to produce such a tif file(s)? I'm also confused why it's even necessary if we've already provided example bounds with class assignment, how does the tif file, assuming it's just visually representing those examples in black and white, add any value?
Thanks so much
The text was updated successfully, but these errors were encountered: