CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > OpenSource CNC Design Center > Coding


Coding Post your Coding for opensource projects here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 08-03-2006, 12:09 AM
 
Join Date: Aug 2005
Location: australia
Posts: 275
Salty72 is on a distinguished road
COnverting 2D images to 3D cutting files

Well, I have set out to search for the holly grail as it would seem... My aim is to turn our wedding photo's to a 3D Surface file for machining.

I thought of starting simple (Bmp/jpeg of objects) and moving to Complex (tif /gif portrates)

so the aim:

Convert BMP's to grey scale

Modify the number of colours to give the correct pospective

Asign a value or weight to the shade of grey

create a polygon mesh to render

ability to add curves to corrctly define shape ? (maybe an option)

add a surface to mesh

increase resolution

save as DXF or other CNC format.

when it came to portrates I had thought of applying a standard Mesh to indicate the main features of a face and give the colours / shades points of reference with respect to the rest of the facial features


anythoughts ideas or code would be great as I have little experience but willing to learn
Tweet this Post!Share on Facebook
Reply With Quote

  #2  
Old 08-03-2006, 12:26 AM
tobyaxis's Avatar
Moderator
 
Join Date: Jan 2006
Location: USA
Posts: 4,395
tobyaxis is on a distinguished road
Thumbs up BobArt ProX

BobArt ProX will do this for you. Unless you want or have the money to spend more. I'm sure Lakeside will be around soon to show you some of the awsome stuff he does with it. I have ProX but rarely use it for anything but Playing. It's a good value for the dollar and you can most likely get it for around $500-$650.

Catia, Mastercam, Surfcam, and DelCam if you have the $$$$$$$$$$$$$$$$$$
__________________
Toby D.
"Imagination and Memory are but one thing, but for divers considerations have divers names"
Schwarzwald

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

www.refractotech.com
Tweet this Post!Share on Facebook
Reply With Quote

  #3  
Old 08-03-2006, 02:31 AM
*Registered*
 
Join Date: Mar 2006
Location: Boston
Posts: 1,628
lakeside is on a distinguished road

Salty my old friend if you want send me a jpeg I'll run it though bobart if you like
Tweet this Post!Share on Facebook
Reply With Quote

  #4  
Old 08-03-2006, 07:47 AM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 19,570
ger21 is on a distinguished road
Buy me a Beer?

http://www.imagetogcode.com/
http://www.vectric.com/WebSite/Vectr.../pvc_index.htm
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 08-03-2006, 09:57 AM
 
Join Date: Aug 2005
Location: australia
Posts: 275
Salty72 is on a distinguished road

here is the file I was playing with

the steps I have taken so far .....

send the Jpeg thru Image-dig this creates a txt file of 1,1,2 (ie X,y,z,) the next line of the text file is obviously 1,2,(and the new height) this height is directly related to the weighting placed against the shade of grey it reads in the pixel,

I then using Excel (see attached also ) modified the X , Y , Z values slightly so if the z height was less than 10% it = Zero, if the z height was greater than 90% it =90% and so as to limit the spikes I said if the material is 19mm thick and the depth of cut is 12mm then (12/19)/255 [255 being the number of shades of grey available]

I then said if X1,Y1 to X1,Ynext # was the same value only count it the first and last time they are the same [this way I dont need to list all the Y points along the X row that have the same continious height]

I then used a bit of magic and to the values I added the Leters to relect the X Y and Z feilds This I imported to wayne Hills G-code to DXF converter...

Problem now being I have a very Saw-tooth line x1y1 to x1y99 and at it'd completion I have a carage return to the start of the next line x2y1 an so on (see the attached DXF)

My next quest was to try the same image in profiler6 - this give a net type image moving left to right then Right to Left and once at the Top it then moves to the Bottom and than from the Bottom to the Top again [ problem being with an image 10x244 you get 333,245 lines of Gcode it takes over 3 hours to covert to a DXF and a long time to mover around the screen in MC9

I decided that as we are learning MasterCam 9.1 at TECH I would try and import the txt file from Image-dig as an ASCII file and select input type as points this should now give me a point cloud and I was hoping to create a surface from here BUT NO-ONE HAS BEEN ABLE TO HELP ME AT TECH....
Attached Images
File Type: jpg armor1.jpg‎ (7.3 KB, 113 views)
Attached Files
File Type: zip ARMOUR.zip‎ (590.7 KB, 80 views)
File Type: txt raw_armour.txt‎ (13.8 KB, 53 views)
File Type: txt Modified Armour G code.txt‎ (267.7 KB, 58 views)
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 08-03-2006, 06:47 PM
 
Join Date: Aug 2005
Location: UK
Posts: 593
Tony Mac is on a distinguished road

Hi Salty,

Many have chased this 'holly-grail' and the bottom line is all have failed, well no one can reliably turn all 2D images into machinable 3D data.

You will find software suppliers with examples of photographs that appear to convert to 3D, but these are few and far between. So always be very careful and check the software with your own photographs before paying the $'s

The problem is that a 2D image simply doesn't contain sufficient information to automatically create a 3D model. Your brain is incredibly clever at identifying whats raised and recessed, especially on peoples faces (which is what most people are trying to machine).

Software is pretty dumb and simply converts shades of grey to a 3D height. So a photo's of people with black hair will always result in flat heads. Also, people who smile with nice white teeth end up looking like bugs bunny. It is possible to use image editing software such as Photoshop to modify the images, but again don't be fooled by this because it requires considerable skill and time.

If you model and machine photo's at very low depth then the problems of shadow, highlight, teeth, eye's, glasses and hair colour are less evident but become very apparent when machined higher / with more volume.

We developed PhotoVCarve to offer a totally different approach that although not 3D will always give an good result.

An approach that does kind of produce a 3D effect is to machine a Lithophane of the photograph. This is machined into a translucent material such as Corain or Plexigla and gives a very interesting effect. PhotoVCarve will also machine stunning Lithophanes.

There's more info about lithophanes on our web site.

If you do manage to find a reliable method of converting photographs into 3D you'll get rich very quick!

I hope this helps,

Tony Mac
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 08-03-2006, 06:58 PM
 
Join Date: Aug 2005
Location: australia
Posts: 275
Salty72 is on a distinguished road

thanks for that I am currently on your web page trying you look at the tutorial but can't seem to stay connected to view the getting started (cute Puppies) video, can it be downloaded ?

Salty
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 08-03-2006, 07:27 PM
 
Join Date: Jun 2005
Location: USA
Posts: 180
rweatherly is on a distinguished road

You mentioned Excel. I did the similar thing a while back. With Excel, you can run a Visual Basic program in the background to do things you really can't do with the spreadsheet part. If you can write a basic progam, it makes things easier.

Anyway, I got around the "carrage return" problem by saving the Z heights in an array, and then reading a line from left to right, and then the next from right to left, etc. so the tool would not have to re-trace.

The next fundamental problem (in addition to the ones Tony Mac addressed) is the tool size and under-laping or overlapping lines. There is a way around this, too, if you are interested in programming.

Richard
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 08-03-2006, 08:18 PM
 
Join Date: Aug 2005
Location: australia
Posts: 275
Salty72 is on a distinguished road

Richard, I am keen to learn,
I was doing a lot of the data moving/manipulation by have as by VB skills are only in thier infant stage, I had thought of running a COON's Patch on all the Z heights for a given X-axis, this whould help elminate some of the colour spiking due to shading issues..

also I have thought of using less colours (wide brush type technique)

I have a friend who does some green screen and movie effects, he also does a bit of CGI, When I mentioned to him my aim he got really excited... but to date I have not heard from him>>>

I wonder if you couldn't scan an object knowing the rules of relection and shading place a curved line on a portion of the SCOURCE FILE this would not give the radius of the object and the shading would help define the shape (have a a look at the attached PIC)

<EDIT>
Sorry the lines are not that clear I selected RED as a colour but it has been displayed as BROWN .... Not happy, Jan!
Attached Images
File Type: jpg armor3.JPG‎ (6.5 KB, 47 views)

Last edited by Salty72; 08-03-2006 at 08:33 PM.
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 08-03-2006, 09:16 PM
 
Join Date: Jun 2005
Location: USA
Posts: 180
rweatherly is on a distinguished road

I really don't use the "Visual" part of it. It is 99% Basic. The only thing different is the code to get the inputs from the spreadsheet, and write the results to the spreadsheet. You can also read and write to files just like in any Basic language. I really only use the spreadsheet for the input and output that you would normally have to type in any.

Somewhere I posted a simple program that drills holes in an X,Y pattern. I will try to find it and post the link.
Here it is: http://www.cnczone.com/forums/showpo...91&postcount=6

Last edited by rweatherly; 08-03-2006 at 09:36 PM.
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 08-04-2006, 01:52 AM
 
Join Date: Mar 2005
Location: Romania
Posts: 339
zoltan is on a distinguished road

Hi,

I have downloaded your excel file and tried, but when I hit the Gcode generator it gave me an error. It seems that generating gcode part is missing. I would like to try this program bmp2xyz, could you, please upload the missing part also? (from second sheet of your excel file - there is the path).

Thank you.

Zoltan
Tweet this Post!Share on Facebook
Reply With Quote

  #12   Ban this user!
Old 08-04-2006, 02:22 AM
 
Join Date: Aug 2005
Location: australia
Posts: 275
Salty72 is on a distinguished road

I 'm guessing the path is where you want the file to go once generated

as to the GCode you can have a look at the code by putting the workbook into design mode and then right click on button and select show code
Tweet this Post!Share on Facebook
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -5. The time now is 11:17 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353