How to find pixel points inside a quadrangle using Java?

I am doing some image processing, and I have the coordinates of 4 points of a quad. (something like a trapezoid) How can I get the coordinates of all the pixels inside it? By the way, I use Java. Thank!

+3
source share
3 answers

You will need a polygonal polygonal line.

Here is a short PDF lecture on the topic:

http://www.cs.binghamton.edu/~reckert/460/lect11_2009-areafill-transformations.pdf

Here is an example webpage with some sample C code and a good illustration of the main idea:

http://alienryderflex.com/polygon_fill/

. , , . -Y- ; ; .

, (, , ) 3d- . , , . ; , .

+1

http://wiki.processing.org/w/Find_which_side_of_a_line_a_point_is_on , , .

A, B, C, D - , AB, BC, CD DA, .

: , a, . , .

0

Is this a collision detection issue? Do you want to know if a given point is inside the form? Or do you really want the coordinates of all the points inside your figure?

0
source

Source: https://habr.com/ru/post/1790753/


All Articles