This site requires JavaScript, please enable it in your browser!
Greenfoot back
Mkheo
Mkheo wrote ...

2014/3/26

Greenfoot Final Project

Mkheo Mkheo

2014/3/26

#
I am doing a photometry type of thing with greenfoot; to start with- I have to make greenfoot able to do a rectangular selection on an image and calculation of color RGB average inside that rectangle. Any ideas for either of functions?
davmac davmac

2014/3/26

#
make greenfoot able to do a rectangular selection on an image
Can you explain what you mean by this?
calculation of color RGB average inside that rectangle
Average = sample total divided by sample count. So, sum (separately) the R, G and B components of each pixel, and then divide by the number of pixels.
danpost danpost

2014/3/26

#
For every point within the rectangle you should use the GreenfootImage class method that returns the color at a specified location within the image and the rest can be done with methods of the Color class and Maths.
Mkheo Mkheo

2014/3/26

#
Thank you guys and yes I should have explained. Rectangular selection- to mark a rectangle like in paint and work only on that area. Under RGB average I mean three separate values of pixels of colors R G and B divided by total number of pixels in a selected area.
You need to login to post a reply.