Article View: sci.image.processing
Article #184sampling pixels in 2d quadrilateral?
From: Eric Davies
Date: Sat, 25 Jul 1992 21:51
Date: Sat, 25 Jul 1992 21:51
32 lines
1505 bytes
1505 bytes
Hi,
I'm looking for some source code fragment or pseudo-code to
compute the average intensity of the area inside a quadrilateral
on bitmapped image. To make matters worse, I'd like the code to
handle partially included pixels properly and the coordinates of the
vertices of the quadrilateral may not be integer.
For instance, if I represent each pixel by an 8x4 area of digits, and
my quadrilateral happens to be the box outlined by the periods, then
111111112222222233333333
111111112222222233333333
11111.................33
11111.112222222233333.33
44444.445555555566666.66
44444.445555555566666.66
44444.445555555566666.66
44444.................66
777777778888888899999999
777777778888888899999999
777777778888888899999999
777777778888888899999999
I'd like to get back the value of the expression:
4/32*intensity('1') + 16/32*intensity('2') +
12/32*intensity('3') + 12/32*intensity('4') +
32/32*intensity('5') + 24/32*intensity('6')
Any suggestions, tips, pointers appreciated.
Eric.
Technical Details
Message-ID:
<BrysqE.13t@watcgl.waterloo.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!watserv1!watmath!watcgl!ejdaviesShow Full Headers
Complete Article Headers
Newsgroups: sci.image.processing,comp.graphics Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!watserv1!watmath!watcgl!ejdavies From: ejdavies@watcgl.uwaterloo.ca (Eric Davies) Subject: sampling pixels in 2d quadrilateral? Message-ID: <BrysqE.13t@watcgl.waterloo.edu> Sender: ejdavies@watcgl.waterloo.edu (Eric Davies) Organization: University of Waterloo Date: Sat, 25 Jul 1992 21:51:50 GMT Lines: 32