Hi,
I want to mosaic an area( such as an rectangle or ellipse), can anyone tell me how to implement it?
for rectangle(an RGB array set to gray), it doesnt work
Hi,
I want to mosaic an area( such as an rectangle or ellipse), can anyone tell me how to implement it?
for rectangle(an RGB array set to gray), it doesnt work
Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.
I use pure math to implement rectangle mosaic.
can give me some implementation advice for ellipse or circle?
hi,
Once you know the centre of the circle (coordinates)and its radius (coordinates) in your picture you can use the equation:
x^2 + y^2 = R^2 to determine whether a particular point (given by x, y) lies on a circle of radius (R).
You can use root of (x^2 + y^2) to know whether the point lies inside or outside the circle. if (root of (x^2 + y^2)) is greater than R then the point (x,y) lies outside the circle else inside.
https://study.com/skill/learn/determining-if-a-point-lies-inside-outside....
thanks