- #1
s3a
- 818
- 8
Homework Statement
http://pastebin.com/aS3vTR2V
Homework Equations
N/A
The Attempt at a Solution
I'm confused about what I need to do for the BlobFinder constructor. Someone told me that I should “initialize the ArrayList blobs”, then “create a 2D array of booleans called marked, having the same dimensions as picture.” then “enumerate the pixels of picture, and for each pixel (i, j): 1. Create a Blob object called blob., 2. Call findBead() with the right arguments. and 3. Add blob to blobs if it has a non-zero mass.”,
but I'm confused as to why that is what I need to do. Don't I only need to do the following for the BlobFinder contructor?:
Java:
for(int i = 0; i < picture.height(); i++) {
for(int j = 0; j < picture.width(); j++) {
Blob blob = new Blob();
blob.add(i, j);
blobs.add(blob);
}
}
I don't even need someone to write Java code for me, but if someone could just explain to me in words and/or pseudocode what I need to do, it would help a lot.
Any help would be greatly appreciated!
Last edited by a moderator: