It is currently Mon Aug 03, 2015 1:11 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 72 posts ]  Go to page 1, 2, 3, 4, 5 ... 8  Next
Author Message
 Post subject: The Traveling Salesman problem.
PostPosted: Thu Feb 10, 2011 4:03 pm  (#1) 
Online
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 7858
Not going to rehash all that I've done already at the registry, but the link to that is here (http://registry.gimp.org/node/22301). I did use the Stipple program mentioned a few days ago, used Inkscape to scale down the points to a dot, converted it into a pbm file (in GIMP), and then fed the results into the python program (not a GIMP plugin though). I couldn't get the non-GIMP python programs to exactly work, but, with mods, got it to at least retain the TSP file (so I was able to digitize the bitmapped points anyway) and open the resulting TSP file in Concorde and do a quick plot and then copy/paste and merged in GIMP. If any python programmers out there can help me, I won't mind. Again, I got it to the point of getting the digitized file to create (TSP), but I then get this error.

Attachment:
python_error.png
python_error.png [ 41.56 KiB | Viewed 2635 times ]


Below's the result that I acquired; bitmapped based though and I did some GIMP stuff to enhance it. :


Attachments:
tsp.png
tsp.png [ 47.41 KiB | Viewed 2635 times ]

_________________
Lyle

Psalm 109:8

Image
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Profile  
 
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Thu Feb 10, 2011 7:18 pm  (#2) 
Online
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 7858
What the hey; another one. Smoothed it some with some G'MIC presets and then vector simplified (Potrace) for additional cleanup. :)


Attachments:
sc_skull.png
sc_skull.png [ 244.63 KiB | Viewed 2592 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Profile  
 
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Thu Feb 10, 2011 8:11 pm  (#3) 
Offline
GimpChat Member

Joined: Oct 06, 2010
Posts: 2658
I fixed mine in Ubuntu, tell me what line 258, in tspart.py, says.

Are you placing your pbm file as input-file?

_________________
You cannot do a kindness too soon because you never know how soon it will be too late.

~Ralph Waldo Emerson


Top
 Profile  
 
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Thu Feb 10, 2011 8:22 pm  (#4) 
Online
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 7858
Hey Mahvin; I don't have a debugger or code editor, but believe this is the area where it is failing. I pretty much am sure it has to do with the sofile variable. I know tspfile is correct since I was able to block the deletion of the tsp file (which means the code that digitizes the bitmap is running correctly) and I'm using that file to run it in Concorde. If you got it to port the SVG file (i.e., had to solve the problem before doing so), then I'm all ears. Sucks to do it manual, but still, better then not being able to do so at all. Again, programmer I'm not. lol

:)

# Run the solver
print 'Running TSP solver ... '
cmd = LINKERN + LINKERN_OPTS % ( linkern_runs, solfile, tspfile )
pipe = os.popen( cmd, 'w' )
status = pipe.close()

_________________
Lyle

Psalm 109:8

Image


Top
 Profile  
 
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Thu Feb 10, 2011 8:27 pm  (#5) 
Offline
GimpChat Member

Joined: Oct 06, 2010
Posts: 2658
Well, in Ubuntu, I had to re-direct tsp to my linkern binary which was in my concorde folder, it was looking for it in usr/local/bin. So, after a quick thought, I just moved the linkern binary to usr/local/bin and it ran without errors, I have a beautiful svg file that looks lovely in Inkscape, but can't see a decent way to get the paths to play nice in GIMP.

_________________
You cannot do a kindness too soon because you never know how soon it will be too late.

~Ralph Waldo Emerson


Top
 Profile  
 
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Thu Feb 10, 2011 8:36 pm  (#6) 
Online
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 7858
I had to move the linkern program to Cygwin (had to install that too of course) too. Changed the paths as well accordingly. Linkern is possibly the issue, but, I believe it is also responsible for the digitizing step, but I could be wrong. Again, I'm no coder. I guess I could just run this program in Ubuntu myself and be done with it. lol

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Profile  
 
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Thu Feb 10, 2011 8:39 pm  (#7) 
Offline
GimpChat Member

Joined: Oct 06, 2010
Posts: 2658
Would save you a ton of problems, because support in Windows is limited. Funny thing is it rendered an svg of my pbm at 3200 x 800px, and it looks fine in Inkscape, but everything I have tried to extract the paths has failed. They won't combine, won't allow you to select them as a group, etc. Just nerve wracking to get so far and see something else turn into a lemon. Still trying to make lemonade!

_________________
You cannot do a kindness too soon because you never know how soon it will be too late.

~Ralph Waldo Emerson


Top
 Profile  
 
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Thu Feb 10, 2011 8:48 pm  (#8) 
Offline
GimpChat Member

Joined: Oct 06, 2010
Posts: 2658
Here's the SVG as a bitmap.
Image

14523 stipples

_________________
You cannot do a kindness too soon because you never know how soon it will be too late.

~Ralph Waldo Emerson


Last edited by mahvin on Thu Feb 10, 2011 10:21 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Thu Feb 10, 2011 9:23 pm  (#9) 
Online
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 7858
OK Mahvin. I moved the linkern and concorde files to the right place (had to use command prompt to do since I couldn't use drag and drop). I now get this error in Ubuntu. Any ideas? Like your result by the way. :)


Attachments:
stillproblem.png
stillproblem.png [ 84.31 KiB | Viewed 2574 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Profile  
 
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Thu Feb 10, 2011 9:41 pm  (#10) 
Online
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 7858
As a side note, I tried moving it into /user/local/bin too (both files) but similar error as above (made sure the paths matched in the python file too of course). :)

edit:

Just realize that the erro did change. Now I get permission denied. I wonder if linkern needs to be run in Wine or not? Well, too tired to go the another set of iterations right now in Ubuntu. Might try later. :)


Attachments:
pd.png
pd.png [ 108.32 KiB | Viewed 2563 times ]

_________________
Lyle

Psalm 109:8

Image


Last edited by lylejk on Thu Feb 10, 2011 10:02 pm, edited 1 time in total.
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 72 posts ]  Go to page 1, 2, 3, 4, 5 ... 8  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


Jump to:  

   Similar Topics   Author   Replies   Views   Last post 
No new posts The salesman

in Gimp Art

Griatch

7

385

Fri Mar 15, 2013 8:24 pm

anarkhya View the latest post

No new posts Just traveling

in Gimp Art

PhotoComix

2

355

Mon Nov 11, 2013 2:53 am

Rod View the latest post



* Login  

* Subscribe to Gimp Chat's RSS Feed    * Subscribe to Gimp Chat's Tutorial Feed    * Subscribe to Gimp Chat's G'MIC Feed


Powered by phpBB3 © phpBB Group