06-21-2014 06:35 PM - edited 06-21-2014 06:58 PM
Hello guys
I am facing problem with how to apply logic with my program.
I simulated an image where I have ten ellipse in one image. I have to change intensity value of any one ellipse from o to 180 at each one step increment.
Can you guys please help in solving this problem. I am sharing my code with you
I will really appriciate your help
06-22-2014 06:45 AM
Posting from mobile. Can you post a screen shot?. And also post the image if possible
06-22-2014 10:47 AM
Thank you for your reply. I got the solution
06-22-2014 12:55 PM
Can you share what you did?
06-22-2014 01:44 PM - edited 06-22-2014 01:51 PM
Your program is many of orders of magnitude too convoluted and takes way too long to complete. Something simple like that should complete in milliseconds.
All you need to do is iterate over each pixel exactly once and add the values of all ellipses that are within range. Seems trivial. (there is no need to stack four FOR loops!). Also, the outer FOR loop does not seem to do anything useful. Why is it there?
You also have serious race conditions, for example there is no way to guarantee that the B^2 or A^2 local variables are being read after the control has been updated. Since there is no data dependency, the order is not predictable.