I want to threshold an image but it doesn’t seem to work in Java Eclipse. Here’s a snippet of the code:
ImagePlus channelsRGB = ChannelSplitter.split(duplicate); ImagePlus Gchannel = channelsRGB; IJ.setAutoThreshold(Gchannel, "Triangle dark");
The error displayed is as follows:
A thresholded image or 8-bit binary image is required. Threshold levels can be set using the Image->Adjust->Threshold tool.
How do I fix this?