I am trying to implement Connected Component Labeling algorithm using java swing library.
First, my code reads any B/W image from computer. Then, it iterates through image pixels (x,y)
and returns specified pixel color.
The new image will be drawn on a JPanel
. using Graphics
library.
The code to draw a pixel is: g.fillRect(x, y, width, height);
The problem is that I am willing to get background color of the JPanel
that I am drawing on it in order to fully implement this algorithm.