Calculate the sum of the pixel values for the blue color, with a picture as an input.
NOTE: The picture will be provided as a matrix of size Height*Width*Colors
To test your algorithm, you can import the picture to MATLAB with the command 'inputImage=imread('http://static0.therichestimages.com/wp-content/uploads/2014/02/san-sebastian.jpg')'; and introduce 'inputImage' in your algorithm. The output should be '54784197'
Solution Stats
Problem Comments
7 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers69
Suggested Problems
-
Swap the first and last columns
22641 Solvers
-
How to find the position of an element in a vector without using the find function
2815 Solvers
-
Reverse the elements of an array
1115 Solvers
-
convert matrix to single column
435 Solvers
-
719 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
That's a beautiful image.
The answer for the first image is wrong. It should be 54784197.
If one looks at the answer set, he/she will see people having been bypassing the first test by fixing the answer. The test cases should be fixed to calculate the sum dynamically with some function forbidden to the user.
@goc3 please check if the test is incorrect as @Rafael mentions.
@Dyuman Joshi: the test suite and description have been updated with the value provided by Rafael S.T. Vieira. At some point in time the image was changed, as the early solutions did not require any hard coding.
Thank you @goc3, appreciate your effort in helping the community!
The problem has been updated to test a built-in image as the linked images are no longer available.