Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am trying to cut an image that I have uploaded into a java written program into quarters, specifically a pyramid. Every pyramid level will have a corresponding image, for example given an input image of abc.pgm, you will generate output images abc1.pgm for pyramid level 1, and abc2.pgm for pyramid level2. Each level should be in a quarter size from the previous level. But I really don't understand how to do this... any information would be greatly appreciated!
Posted
Updated 10-Sep-13 9:08am
v2
Comments
Sergey Alexandrovich Kryukov 10-Sep-13 12:52pm    
Member 10265022 10-Sep-13 12:56pm    
Thank you but I have read and answered those questions earlier today...which is why I just decided to ask and see if anyone else could help. but thank you.
Sergey Alexandrovich Kryukov 10-Sep-13 13:07pm    
What questions? What answers? Any links?
—SA
Member 10265022 10-Sep-13 13:24pm    
okay, so after going back over the question for the homework I found out that what my professor really meant was image pyramid! "pyramid representation by smoothing and
down-sampling with a scaling ratio of 2" ...or I think that is what she meant. Correct me if I am wrong.
Sergey Alexandrovich Kryukov 10-Sep-13 14:24pm    
Sure, I understand that. Not so simple problem, but a very usual one. So, you were not talking about CodeProject questions/answers, were you? Anyway, if you know how to draw just one pyramid (can you?), you should be able to do the iteration. Some problem would be the decision on where to stop it.
—SA

1 solution

Please see my last comment to the question, starting with "Sure, I understand that". The request is vague enough (what graphics framework/API are you using?), but what you need is this:
http://en.wikipedia.org/wiki/Recursion[^],
http://en.wikipedia.org/wiki/Recursion_%28computer_science%29[^].

Interestingly, such constructions often (but not always), lead to fractals, geometric objects with non-integer (or even non-existing, in case of so called non-uniform fractals) Hausdorff dimension. Such objects can even model many existing object found in real life, which manifest really exotic physical properties, especially in optics and solid-state physics.

Please see:
http://en.wikipedia.org/wiki/Fractal[^],
http://en.wikipedia.org/wiki/Hausdorff_dimension[^],
http://en.wikipedia.org/wiki/Fractal_dimension[^].

This is really a case when you get a chance (and should use it, if you are a good student) to go beyond your narrow ("profession"), even if it so broad as "software" and get some fundamental background, in particular, in mathematics and physics. Use this change!

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900