Hi, I have tried a first solution. Since I see only the hash value of the correct solution and not the solution itself, I am not sure how to finalize my code.. So, some questions:
(1) where exactly is the zero angle? The text says on the real line (which should be to the right?) the picture suggests to the bottom (isn't red equal to zero angle in HSV?)
(2) what exactly is beta? The text says "norm" --> I assumed Euclidean norm. is this correct?
(3) does the test suite account for numerical noises due to different implementations, or is it just a hash of the reference solution?
Thanks. :-)
Thanks for the feedback, Alex.
(1) The zero angle in the HSV space is given by the color red. So it is positioned on the vertical axis at the figure's center, and the angle increases counter-clockwise.
(2) You are right to assume that beta is the euclidean norm, I've checked your solutions for V, and they are correct (as well as S, of course). The problem seems to be with your angle (H). I am not sure you can determine the right angle by using just asin. I believe you need to use atan, or both asin and acos to find the right angle quadrant.
(3) You are right. I've forgotten to take into account the noise, sorry about that. When I was designing this problem, I was thinking about using uint8 to remove noise, but in the end, I didn't. So I will fix the test suite to consider only 4 decimal places or use uint8 and update the problem description when I'm finished.
Hi, I have been trying the solution for a while. Will the solution be incorrect if I used 'hsv2rgb' function of matlab?
Hi, Ratul, yes, you can use hsv2rgb function, but there seems to be a problem with the test suite. Please, wait a while, I will fix everything and update the problem description today.
All problems are fixed now, sorry Ratul and Alex for any issues that you had. RGB values should be rounded to 4-decimal places. And remove NaNs from your results if present. Let me know if you still experience issues, or if you want a tip (I've fixed some of your codes, and they passed the test suite).
Example image is not correct, since hue equal 0 corresponds to primary red color. Please correct.
(https://en.wikipedia.org/wiki/Complex_plane states that real axis is pointing to the left, not to the bottom)
Also it would be great if you add additional checks in test cases, from which we can understand how our solution differs from yours.
For example: check correct value for some points of resulting image (like corners or real/imaginari axis points).
Svyatoslav Golousov, the real axis pointing left is only a convention. However, I will change the problem description later to explain it as I did on the next one. And I will think of a way to measure the similarity between images. I agree it's essential to provide better feedback; thanks for the suggestion.
This solution will pass the test suite if you remove the offset of -pi/2, convert values to RGB, and round them to 4 decimal places.
Perfect! Thanks for the update, now it works. :-)
No problem. :)
Finally solved it. Thanks Rafael.
Excellent, Ratul, congrats. And No problem.
1244 Solvers
Project Euler: Problem 2, Sum of even Fibonacci
782 Solvers
508 Solvers
Implement simple rotation cypher
925 Solvers
163 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!