🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: sci.image.processing
1 messages
1 total messages Started by Eric Davies Sat, 25 Jul 1992 21:51
sampling pixels in 2d quadrilateral?
#184
Author: Eric Davies
Date: Sat, 25 Jul 1992 21:51
32 lines
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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads