Comparing object class results?

learning_brain

New Member
Messages
206
Reaction score
1
Points
0
I don't know if I'm barking up the wrong tree here but I am new to OOP so need a bit of guidance...


I'm writing an image analysis page, which attempts to identify the image type.

Initially, I set "Zones".... i.e.

...main central section where a portrait would be.
...top half where the sky would be
...bottom half where trees might be

etc. etc.

I have then written a class to go through each zone, defined by it's pixel co-ordinates.

The class extracts the RGB values and assigns a colour type to each pixel (skin, sky, greens etc,) Then, each pixel colour type is assigned to an array. The class then calculate %'s of each colour type within that array. - great - it works a treat... on its own.

My problem is....

I need to compare the %'s returned from each class for each zone (or class instance).

For instance, for a portrait photo, it is very likely that the central zone will contain high proportions of skin.

Another example.. A scenery shot will have high proportions of sky colours in the upper half and high percentages of greenery in the lower half.

...so....

in order to work out if it's a scenery photo, I need to compare the % sky results from the upper half class instance to the % greenery results from the bottom half class instance.

I can output the values from within a function in the class (echo $this->percentagewhatever), but in order to do this, I need to extract the value from the class so I can compare with another instance.

Does this make sense?

______EDIT________________

Never mind - I've cracked it now... a stupid syntax error.
 
Last edited:
Top