I have an image of a black paper cut in a right angled traingle shape and placed on a sheet of white paper. Size of the image is 100x100 pixels. The triangle looks and has the dimensions as shown below. /| / | / | B b = length of side A / | h = length of side B /__| A
The region inside the trianlge is black (gray value of pixels might not be exactly 0's for all the pixels. It varies from pixels to pixel.) and region outside the triangle has pixels with gray value =255. By physics, i know that the center of gravity of this traingle should lie inside the triangle at a distance of b/3 to the left of side B and at h/3 above side A.
How can I get to this CG point, which will be a function of gray scale value and pixel location, by taking image as input?
My search on internet lead me to this:The link provides me with some hint to my problem except for the fact that brighter pixels will exert more pull on the final COG location than darker pixels. I want the exactly opposite of this i.e( I need more pull from dark pixels). I dont want to thershold the image.
Any idea how I can do this?