Question: ( Particle Identification ) The first challenge is to identify the beads amidst the noisy data. Each image is 6 4 0 - by -
Particle Identification The first challenge is to identify the beads amidst the noisy data. Each image is by pixels, and each pixel is represented by a Color object which needs to be converted to a luminance value ranging from black to white Whiter pixels correspond to beads foreground and blacker pixels to water background We break the problem into three pieces: Read the image. Use the Picture data type to read in the image. Classify the pixels as foreground or background. We use a simple, but effective, technique known as thresholding to separate the pixels into foreground and background components: all pixels with monochrome luminance values strictly below some threshold tau are considered background, and all others are considered foreground. The two pictures in figure above illustrate the original frame left and the same frame after thresholding right using This value of results in an effective cutoff for the supplied data. Find the blobs. A polystyrene bead is typically represented by a disclike shape of at least some minimum number pixels typically of connected foreground pixels. A blob or connected component is a maximal set of connected foreground pixels, regardless of its shape or size. We will refer to any blob containing at least pixels number of pixels as a bead. The centerofmass of a blob or bead is the average of the x and ycoordinates of its constituent pixels. Define a data type called BlobFinder in blobfinder.py that supports the following API. Use depthfirst search to efficiently identify the blobs. Use this data type: Instance variable: Blobs identified by this blob finder, blobs list of Blob objects BlobFinder Initialize blobs to an empty list. Create a D list of booleans called marked, having the same dimensions as pic. Enumerate the pixels of pic, and for each pixel i j: create a Blob object called blob; call findBlob with the appropriate arguments; and add blob to blobs if it has a nonzero mass. bffindBlob Base case: return if pixel i j is out of bounds, or if it is marked, or if its luminance use the function luminance.luminance for this is less than tau. Mark the pixel i j Add the pixel i j to the blob blob. Recursively call findBlob on the N E W and S pixels. bfgetBeadspixels Return a list of blobs from blobs that have a mass pixels
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
