From bitmap to layout?

This area is dedicated to our foreign guests of this forum. Contributions can be written in any language.
[Diese Kategorie ist den ausländischen Gästen dieses Forums gewidmet. Beiträge können in beliebiger Sprache verfasst werden.]
Antworten
Christopher Spies
Beiträge: 246
Registriert: Mittwoch 26. Januar 2005, 16:11

Re: From bitmap to layout?

Beitrag von Christopher Spies »

<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr> <td><span class="genmed">Zitat:</span></td></tr><tr><td class="quote">Would it be possible that someone would write a converter that could make rails/busroute directly from bitmap</tr></td></table>
It would, if someone had time. Unfortunately, I don't [img]icon_biggrin.gif[/img] .

<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr> <td><span class="genmed">Zitat:</span></td></tr><tr><td class="quote">Lets say we have 64x64 bitmap that has route marked on black.</tr></td></table>
Wouldn't that be somehow counterintuitively?
How could an unexperienced user tell what color represents the bus route, and what color represents the tarmac road?

<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr> <td><span class="genmed">Zitat:</span></td></tr><tr><td class="quote">It would accelerate the laying process a LOT.</tr></td></table>
I'm not so sure about that -- after all, instead of building the layout inside BAHN, you'd have to paint the bitmap [img]icon_rolleyes.gif[/img] !

If BAHN routes could be built by drag-n-drop, this would probably provide a more elegant way to speed up the laying process.

- Christopher
DW
Beiträge: 58
Registriert: Mittwoch 4. Mai 2005, 16:10
Wohnort: Tirphil, Wales
Kontaktdaten:

Re: From bitmap to layout?

Beitrag von DW »

<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr> <td><span class="genmed">Zitat:</span></td></tr><tr><td class="quote">
<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr> <td><span class="genmed">Zitat:</span></td></tr><tr><td class="quote">It would accelerate the laying process a LOT.</tr></td></table>
I'm not so sure about that -- after all, instead of building the layout inside BAHN, you'd have to paint the bitmap</tr></td></table>It would help tremendously with a project I am working on, where I already have a scale map of the routes I want to use. Transferring this to BAHN means a lot of measuring of a map and a lot of calcualtions, then plotting the measured points, then marking the road, rail, or whatever.

With a converter I could just scan it in, use an image processor to resize it to the right scale, and bingo!

Even if no junctions were transferred it would help a lot.
Zuletzt geändert von DW am Montag 26. Dezember 2005, 16:05, insgesamt 1-mal geändert.
Gast

Re: From bitmap to layout?

Beitrag von Gast »

I solved this problem e.g. by this way...
I wanted to build the railway network of a country ~800 km East-Weast.
While the maximum coordinates were cca. 16000, the best scale was 20 elements/km.
I scanned the map the width was 1600 by setting the dot/inch appropriately - itt needed serious calculation only once.
I opened the image by MS PhotoEditor - this shows the coordinates of the image points while moving the corsur.
These data were multiplied by 10 and I could find the place of the railway nodes in Bahn easily.
I marked the nodes with a figure then I builded connections.
The only problem was with some railway lines where there are many courves, but it's also should be done to mark the characteristic points the courves getting a well-scaled layout.
tobiasb
Beiträge: 21
Registriert: Samstag 3. Januar 2004, 02:26
Wohnort: Hamburger Umland
Kontaktdaten:

Re: From bitmap to layout?

Beitrag von tobiasb »

<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr> <td><span class="genmed">Zitat:</span></td></tr><tr><td class="quote">But when someone else could convert an image to an ASCII drawing or to coordinates I'm also very happy and will use this solution. Bild
Bert.Tijhuis</tr></td></table>

You are looking for a vectorisation (vectorization) program.

I once wrote a little program named vec which converts a bitmap file into a text file describing points and polygones found in this file.

Bild

To give an example: The image above is converted to <pre>P 10 10,10
P 10 50,10
P 10 90,10
P 10 10,50
P 10 50,50
P 10 90,50
P 10 10,90
P 10 50,90
P 10 90,90
L 9 90,20-4-10,20
L 14 90,21-4-10,21
L 9 50,61-6-67,61-9-68,60-8-68,50-7-50,32-4-22,32</pre>
There are several restrictions: you are restricted to the eight angles or directions supported in BAHN, the lines in the original image must be exactly one pixel wide and ...

The program is written in plain C. I put the source code, a executable, a short description and the example already shown together in a zip file which is available at http://www.talypso.de/tobiasb/temp/vec.zip. So you (and any other interested person) can have a look of your own at
it and decide whether it may be useful or not.

As I wrote this program it was planned to become part of a toolchain that creates a BNA file from a real world map with tracks manually drawn in this bitmap file. Due to the effort needed for the manual track drawing, the angle limitation and the poor editing options for pixel graphics, I never completed this approach.

Currently I have no time at all to work with BAHN. If this changes sometimes in the future it is my current intention to use official topografic maps and the associated software as source for a real world track layout. This idea was already mentioned by Speedeel in this forum. See
http://www.das-bahn-forum.de/forum//viewtopic.php?t=926.

Finally I'dlike to wish everyone here a happy new year.

Regards,
Tobias
DW
Beiträge: 58
Registriert: Mittwoch 4. Mai 2005, 16:10
Wohnort: Tirphil, Wales
Kontaktdaten:

Re: From bitmap to layout?

Beitrag von DW »

<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr> <td><span class="genmed">Zitat:</span></td></tr><tr><td class="quote">...
But when someone else could convert an image to an ASCII drawing or to coordinates I'm also very happy and will use this solution. [img]icon_biggrin.gif[/img]

Please provide me with some suggestion so it isn't

best regards,</tr></td></table>
If the lines are black on white then simply taking the black pixels one at a time and converting one BAHN element at a time would help. If you start in the top left corner at 0,0 and go along the first row, then in the next row (remembering that BAHN's y-coordinate increases as you go down the page) then you will produce, at the very least, a BAHN layout with a map outlined on it, even if every changed location is an A5. This would save a lot of time.
Zuletzt geändert von DW am Mittwoch 18. Januar 2006, 11:11, insgesamt 1-mal geändert.
Jan Bochmann
Beiträge: 2203
Registriert: Sonntag 16. März 2003, 15:25
Kontaktdaten:

Re: From bitmap to layout?

Beitrag von Jan Bochmann »

Hello,

<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr> <td><span class="genmed">Zitat:</span></td></tr><tr><td class="quote">Hello,
Would it be possible that someone would write a converter that could make rails/busroute directly from bitmap. Lets say we have 64x64 bitmap that has route marked on black. It would accelerate the laying process a LOT.</tr></td></table>

Yes... Try 3.84 Beta3 for that ;-)

Regards
Jan B.
Blöky
Beiträge: 46
Registriert: Donnerstag 17. November 2005, 22:21

Re: From bitmap to layout?

Beitrag von Blöky »

Bert!

I've downloaded your program from your homepage (also Perl) and it worked very well!
The one problem was that all sections were made as double tracks - but this is very much better then reverse [img]icon_wink.gif[/img]
So I succesfully created a huge network of Eastern-Central Europe. It was above 10 Mb, it was very slow to manage, but I cutted obvious parts reducing the layout to 6 M, now it runs well.

Thank you very much [img]icon_exclaim.gif[/img] [img]icon_biggrin.gif[/img]
-by-
sepruecom
Beiträge: 711
Registriert: Mittwoch 19. März 2003, 09:28

Re: From bitmap to layout?

Beitrag von sepruecom »

You can also change the scale of the BAHN-map. When you start, you change that 64 for e.g. 80, and you have less problems to make your BAHN-Layouts ;-)

Greatings, sepruecom
Blöky
Beiträge: 46
Registriert: Donnerstag 17. November 2005, 22:21

Re: From bitmap to layout?

Beitrag von Blöky »

Of course, if my target area were smaller I would choose a greater scale.
In this case the target area was just fitted in West-East direction but at North, Sout and in the corners there were obvious parts.
-by-
DW
Beiträge: 58
Registriert: Mittwoch 4. Mai 2005, 16:10
Wohnort: Tirphil, Wales
Kontaktdaten:

Re: From bitmap to layout?

Beitrag von DW »

WHen using a background bit map I am forced to use a 24-bit .bmp which is rather large. I could use a monocolour and be much smaller, but 3.84 Beta3 will not accept it. Is it me, or is this a limitation? The map is created from a black and white track layout and needs to be 23k by 32.5k in BAHN.
Benutzeravatar
micha88
Beiträge: 1987
Registriert: Freitag 18. Februar 2005, 12:50
Wohnort: Marbach am Neckar
Kontaktdaten:

Re: From bitmap to layout?

Beitrag von micha88 »

BAHN seems to have Problems with some Formats... the best is to use a 24/32-bit-Bitmap, because internally BAHN converts every Bitmap into the 32-bit-Format, other formats don't mean any optimization
Bild
Antworten