comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: image data extraction
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: image data extraction [message #2186 is a reply to message #2181] Fri, 03 June 1994 06:39 Go to previous messageGo to previous message
landers is currently offline  landers
Messages: 45
Registered: May 1993
Member
Finding image data along a line...

This just picks points from the image. It doesn't do any image
interpolation or anything like that. Just finds the closest x,y to the
line.

Just some code fragments I sucked out of one of my codes:

; Line endpoints are (x1,y1), (x2,y2) (these are indices into the image)
; image size is (Mx,My)

; There are two methods here. The first works better for more
; horizontal cuts, the second for more vertical. You could put a test
; on the slope of the line, and choose your method accordingly.

;;;;;;;;;;;;;;;;;;
; Horizontal cuts:
; first figure out how many points you want to grab between the ends.

Nx = Abs( x2 - x1 ) > 1
Ny = Abs( y2 - y1 )

; find the x and y indices into the image along the cut
; get one point for every x pixel in the cut line, and figure the
; corresponding y points

thex = Long( Lindgen( Nx + 1 ) + x1 )
they = Long( Lindgen( Nx + 1 ) * Float(Ny)/Nx + y1 )

image_line = image( they * Mx + thex )

;;;;;;;;;;;;;;;;
; Vertical cuts:

Nx = Abs( x2 - x1 )
Ny = Abs( y2 - y1 ) > 1

; get one point for every y pixel in the cut line

thex = Long( Lindgen( Ny + 1 ) * Float(Nx)/Ny + x1 )
they = Long( Lindgen( Ny + 1 ) + y1 )

image_line = image( they * Mx + thex )


;Dave
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Garbage collection and Memory
Next Topic: write_gif problems???

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Nov 30 15:43:35 PST 2025

Total time taken to generate the page: 1.84159 seconds