can any one explain this code it is for extracting green object from a image . i want know about the methodology used here ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
anji venkat
am 5 Apr. 2014
Kommentiert: Image Analyst
am 5 Apr. 2014
r1 = greenball2(:, :, 1); g1 = greenball2(:, :, 2); b1 = greenball2(:, :, 3); justGreen2 = g1 - r1/2 - b1/2;
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 5 Apr. 2014
It's measuring how much brighter the green component is than the average of the red and blue component . And it's done on the entire image so the calculation is basically pixel by pixel.
2 Kommentare
Image Analyst
am 5 Apr. 2014
The notation for 3D color image arrays in MATLAB is arrayName(rowIndex, columnIndex, colorChannelIndex). And colon : means "all". So, for example arrayName(32,:,3) means all columns in row 32 of color channel #3 (the blue channel). And arrayName(:,:,2) means all rows and all columns of color channel #2 (the green channel), so basically it's the green color channel of the entire image.
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!