Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void eraseBlob(int row, int col){
- if(row >=0 && row < size && col >= 0 && col < size){//size is number of rows and cols in a square 2d array
- if(image[row][col] == 0){
- image[row][col] = 255;
- eraseblob(row - 1, col);
- eraseblob(row + 1, col);
- eraseBlob(row, col + 1);
- eraseBlob(row, col - 1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement