Intersect Ray Information-Creating Points

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  02 February 2013
Intersect Ray Information-Creating Points

Hey all,

My first attempt at doing this was using a colour image and a depth map. My script worked but the resulting pointcloud that i generated was not accurate so i'm wondering if a new approach might work better using intersect ray. Anyway, what i want to do, essentially, is take a photo of a real world location ( all the camera parameters and location would be known) and then bring it into the 3d scene with my meshed pointcloud. Then the steps would be as follows:

-shoot rays from the camera through an image/photo (known location/camera settings)
-then each ray would go through each pixel in the image and return a distance and angle when it hits the geometry in the scene.
-then with the 3d coordinate i would write out the position x,y,z and then the pixel RGB value for colour (eg. 10 12 10 255 120 255)

Any help would be greatly appreciated...if more info is needed let me know. I can post the script that i adapted that sort of worked. Really stuck here!
 
  02 February 2013
Here is the code that i used for my first attempt.


    col_bmp =  openbitmap "C:\\DDE Stuff\Kingsville-Colour-400.jpg"		
    zdepth_bmp = openbitmap "C:\\DDE Stuff\Kingsville-Zdepth-400.jpg"
    progressstart "Rendering Voxels..."
    for y = 1 to col_bmp.height do
    (
     progressupdate (100.0 * y / col_bmp.height)
     pixel_line = getpixels col_bmp [0,y-1] col_bmp.width
     z_line = getpixels zdepth_bmp [0,y-1] col_bmp.width
    		
     for x = 1 to col_bmp.width do
     (
    	 camview_width = 94.366
    	 camview_length = 46.404
    	 img_pixel_width = 1920 as integer
    	 img_pixel_length = 1080 as integer
    	 z_min_dist = 0 as integer
    	 z_max_dist = 140 as integer
    	 col_min = 0
    	 col_max = 255
    	 pixel_line[x]
    	 z_line[x]
    	 
    	 --z_offset = (((z_max_dist - z_min_dist)/(col_max-col_min))*(z_line[x].red as integer))
    	 z_offset =(1.0 * z_line[x].red as integer)  --actual value of max dist divided by rgb limit  1.96078431372549
    	 -- x*-0.3700627450980392
    	 --y*0.1819764705882353
    	 format "% % % % % %\n" ( x*-1.0) (y*1.0) z_offset (pixel_line[x].red as integer) (pixel_line[x].green as integer) (pixel_line[x].blue as integer)
    	 
    )--end y loop
    progressend()
    


Here are the images i was using:





...and my sample output file....
http://vehiclemetrics.com/dwayne/junk/sampleoutput.xyz

...and what my ouptu looked like as a pointcloud...



Again...any help is greatly appreciated!
 
  02 February 2013
Beginning to realize this is more complex then i had originally thought.
 
  02 February 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:56 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.