<< Chapter < Page Chapter >> Page >
This test determines whether a fish is a salmon or a trout based on the relative intensities of the red component versus the blue and green components

This test relys on the fact that salmon get extremely red when they are swimming upstream to spawn. Sockeye salmon, which wewere specifically trying to detect are among the brightest of the salmon. The other fish we were trying to classify,steelhead trout, remain silver even during spawning season. This means that it is easy to distinguish between the brightred overall color of the salmon pictures and the relatively even color of the trout.

When Matlab takes in a picture, it stores it as three different matricies, one for each color, red, green, and blue. This testsimply looks at the energy in each matrix and compares them. The important thing to test for is whether the red matrix energy issignificatnly larger than the blue matrix or the green matrix.

Intensity testing image

Fish intensity testing broken into red, green, and blue.

Code for intensity test

% Check to see how much intensity there is in each of the color spectrums for i = 1:3fishnorm(:,:,i) = fishimage(:,:,i)./norm((fishimage(:,:,i)));intensitymatrix(:,:,i) = reshape(fishimage(:,:,i), 1, prod(size(fishimage(:,:,1)))); intensity(:,:,i) = mean(intensitymatrix(:,:,i));endrgintens = intensity(:,:,1)-intensity(:,:,2); rbintens = intensity(:,:,1)-intensity(:,:,3);
Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Ece 301 projects fall 2003. OpenStax CNX. Jan 22, 2004 Download for free at http://cnx.org/content/col10223/1.5
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ece 301 projects fall 2003' conversation and receive update notifications?

Ask