Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 2.00 average. Display Modes
Old 01-02-2010, 14:13   #526
Senior Cruiser
 
sailorF54's Avatar

Cruisers Forum Supporter

Join Date: Dec 2009
Location: Perros-Guirec, France
Boat: Jeanneau Sunshine 36
Posts: 829
Angry

Quote:
Originally Posted by GPS-Marco View Post
Here we are,

after first feedbacks, I released an improved version of CHARTCAL. Changes from V20 to V21 are only for 7 maps:

NZ23
NZ86_2
NZ5124_2
NZ5323_2
NZ14065
NZ14051
NZ14061

Please, download new ChartCal V21 ( MCE66 - Software ) and rebuild above charts (if you have older versions).

Let me know. Ciao, Marco.
Maxsea 12.6.3 still complains about NZ14065...
__________________

__________________
sailorF54 is offline   Reply With Quote
Old 01-02-2010, 16:54   #527
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Quote:
Originally Posted by sailorF54 View Post
Maxsea 12.6.3 still complains about NZ14065...
What about the other 6 new maps?

Ciao, Marco.
__________________

__________________
GPS-Marco is offline   Reply With Quote
Old 02-02-2010, 01:29   #528
Senior Cruiser
 
sailorF54's Avatar

Cruisers Forum Supporter

Join Date: Dec 2009
Location: Perros-Guirec, France
Boat: Jeanneau Sunshine 36
Posts: 829
Quote:
Originally Posted by GPS-Marco View Post
What about the other 6 new maps?

Ciao, Marco.
Sorry, I thought it was clear they're now ok
__________________
sailorF54 is offline   Reply With Quote
Old 04-02-2010, 04:08   #529
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
mc2bsbh with georeferentiation

As promised and as described in post #485 , here you can now find a new mc2bsbh. It is not for "production" but just for alpha testing.

This new mc2bsbh-poly has the new capability to calculate the georeferencing polynomials. Just add a -p switch and this new piece of code will add to the kap header the polinomials.

It works in this way (see also above post):

- Fist for all ref points it converts ref lat/lon in ref E/N using the exact projection formulas (Mercator and Transverse-Mercator supported)
- Second it tries to approximate the ref X/Y to E/N by polynomial approx. It tests 23 polynomials to find the best one (minimum error, well conditioning). It works with at least 2 ref points.
- Third it uses this couple of transformations (lat/lon->E/N->X/Y) to recalculate 36 new ref points with a disposal that is always well-conditioned so it can calculate the final third order polys that goes directly form lat/lon to X/Y and viceversa

The results are good (very good: error less than 1 pixel) for large scale charts while are poor for small scale charts (say from 1:3000000 and smaller). The poorness is not due to the algorithm but to the fact that even a third order poly is unable to correctly representate the projection formulas when a chart is spanning tens of degrees of latitude. NZ14065 is the most problematic (it gooes fron New Zealand to Antartica) and has a mean error of 40 pixels.

For this reason I proposed to change the georef approach in OCPN. In practice OCPN could use the first half of the algorithm presented here and use for its internal calculations the double step approach

Lat/Lon to E/N by projection + E/N to X/Y by polynomial (and viceversa)

In this way the poly will never be used to approximate the projection but only to approximate the chart scan distortions. With this approach even NZ14065 has an error less than 1 pixel.

to compile (I used borland bcc32) add all the following souces: mc2bsbh-poly.cpp PolyEval.c mercator\mercator.c tranmerc\tranmerc.c linear\CDGECO.C linear\CDGEDI.C linear\CDGEFA.C linear\CDGESL.C

There is also a McTest.cpp that just tests the georef included in CHARTCAL.DIR without producing the kap header.

I'm available for explanaition of the details. Please just ask for.

Ciao, Marco.

P.S: This is a really ugly piece of code, written just to prove the concept. Even the few comments are often old and wrong! Enjoy
Attached Files
File Type: doc mc2bsbh09-poly01.zip.doc (291.1 KB, 71 views)
__________________
GPS-Marco is offline   Reply With Quote
Old 06-02-2010, 08:27   #530
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
CHARTCAL-V22

An improved version of CHARTCAL for you. Changes from V21 to V22 are for 13 maps.

NZ14065, NZ14630, NZ14902, NZ14605, NZ6612, NZ86_5, NZ827, NZ865_6, NZ865_5, NZ93, NZ945_6, NZ8215_1, NZ3111_6

Canges are mainly driven by the usage of McTest (see above post): ref points fixed when the average error was grater than 1 pixel without reason. Now all charts have a georef error w.r.t a perfect projection of less than 1 pixel (where possible): please, download new ChartCal V22 ( MCE66 - Software ) and rebuild above charts or download already built charts (if you have older versions).

Apart for NZ14065, that I don't think will still work in maxsea 12, if I will not receive other negative feedbacks I will consider this version as final. Of course I'll update this data base from time to time when new/upgraded charts will be released by LINZ or if new important info about KAP header will be understood.

Let me know. Ciao, Marco.
__________________
GPS-Marco is offline   Reply With Quote
Old 06-02-2010, 09:34   #531
Senior Cruiser
 
sailorF54's Avatar

Cruisers Forum Supporter

Join Date: Dec 2009
Location: Perros-Guirec, France
Boat: Jeanneau Sunshine 36
Posts: 829
[NZ14065, NZ14630, NZ14902, NZ14605, NZ6612, NZ86_5, NZ827, NZ865_6, NZ865_5, NZ93, NZ945_6, NZ8215_1, NZ3111_6
Apart for NZ14065, that I don't think will still work in maxsea 12
Let me know. Ciao, Marco.[/QUOTE]

Hello Marco
The whole lot opens fine in Maxsea 12, including the new ones, except NZ14065
__________________
sailorF54 is offline   Reply With Quote
Old 06-02-2010, 09:42   #532
Senior Cruiser
 
sailorF54's Avatar

Cruisers Forum Supporter

Join Date: Dec 2009
Location: Perros-Guirec, France
Boat: Jeanneau Sunshine 36
Posts: 829
Quote:
Originally Posted by GPS-Marco View Post
As promised and as described in post #485 , here you can now find a new mc2bsbh. It is not for "production" but just for alpha testing.
....

I'm available for explanaition of the details. Please just ask for.

Ciao, Marco.
...
Hi Marco

How does that scheme translates in practical terms for referencing say some Google Earth pic ?
How many Lat / Long georef point?
Minimal number, best number ?
Where: all along the chart border, a few nearer to the center ?
TIA
__________________
sailorF54 is offline   Reply With Quote
Old 06-02-2010, 10:59   #533
Registered User

Join Date: Mar 2008
Location: where my little boat is ;-) now Philippines
Boat: Catamaran Schionning Wilderness 1320, built myself
Posts: 189
Quote:
Originally Posted by GPS-Marco View Post
Hello.
I've succesfully tested on:

- OpenCPN
- SeaClear/MapCal
- NOAA chart reprojector
- PolarView

I'm attaching the smaller NZ chart I have and I ask you to try to check if this chart can be opened by some other SW you own or you use.

Let me know, so I can release the NZ portfolio with this new header.

Ciao, Marco
Hi Marco,
add NavPak-Pro to your list of success
Raymarine RNS negative (shows up in the list of charts to be installed, but then no more in the list of installed charts)
__________________
blubaju is offline   Reply With Quote
Old 07-02-2010, 04:22   #534
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Quote:
Originally Posted by sailorF54 View Post
Hi Marco

How does that scheme translates in practical terms for referencing say some Google Earth pic ?
How many Lat / Long georef point?
Minimal number, best number ?
Where: all along the chart border, a few nearer to the center ?
TIA
Hello,
Ok it's an "internal" processing scheme. Should be transparent to user and to georeferencer people. Anyway it may help to find ref points with high error that may be just wrong.

How many Lat / Long georef point? ....

It depends: if the image is an electronic print of an electrinic produced chart (as in the new New Zealand charts) I'd say:
A small plan of a port? 4 points at the corners
A medium chart of a bay? 9 points in a grid 3x3
A large chart of a region (say 100 miles)? 16 points in a grid 4x4 (or 20, 5x4)
A large chart of a large region and up? >=20 points in a grid 5x4, 4x5, more

If the image is a scan (made with a scanner) of a chart or if it is anyway distorted (a good scan of an old chart) I'd say:
as many as you can. Even at all lat/lon grid crossing. Try to put always in grids (4x4, 5x4, nxm)

When using MapCal, always put 2 ref points at 2 opposite corners and save calibration. From that point on, every new ref point will be placed with a guess made by MapCal of the lat/long. You have only to correct the decimals.

You can also activate the grid to help you in placing (at the pixel!) the ref point: the red grid calculated by mapCal (after having placed the new ref point and having pressed "Activate Changes") shall overlap the grid of the chart. At most accept 1 pixel error...

Ciao, Marco.
__________________
GPS-Marco is offline   Reply With Quote
Old 07-02-2010, 10:26   #535
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Hi all.

I don't know how many of you have been using NONIMapViewer to capture large map areas in Google-OpenStreetMap-Yahoo and Virtual Earth format,all with terrain and satellite options but I have found it very useful and easy to use producing calibrated maps for overview purposes.

The automated process produces a .tif as well as a .map geo-referencing file making it readable by OziExplorer. You can also copy the calibration data from the .map file to enter in MapCal to produce the CHARTCAL.DIR file.

To produce an OpenCPN and SeaClear compatible .kap chart I use another automated conversion prog. called 'Chartconvert' ,inputing just the .png format map and the CHARTCAL.DIR calibration file,the rest is done automatically. The beauty of this prog is that you can also do a reverse conversion from a .kap to .png.
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 09-02-2010, 03:55   #536
Senior Cruiser
 
sailorF54's Avatar

Cruisers Forum Supporter

Join Date: Dec 2009
Location: Perros-Guirec, France
Boat: Jeanneau Sunshine 36
Posts: 829
Quote:
Originally Posted by sinbad7 View Post
Hi all.

...
The automated process produces a .tif as well as a .map geo-referencing file making it readable by OziExplorer. You can also copy the calibration data from the .map file to enter in MapCal to produce the CHARTCAL.DIR file.
Hi Simbad

I am certainly a little dumb, but I cannot figure out how to copy the .map file into MapCal.
__________________
sailorF54 is offline   Reply With Quote
Old 09-02-2010, 04:06   #537
Registered User

Join Date: Nov 2009
Location: Berlin Germany
Posts: 23
Quote:
Originally Posted by sailorF54 View Post
Hi Simbad

I am certainly a little dumb, but I cannot figure out how to copy the .map file into MapCal.
Hi
you can use the map file with the convert routine Map in Dir to WCI.

Leo12305
__________________
Leo12305 is offline   Reply With Quote
Old 09-02-2010, 06:08   #538
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Quote:
Hi Simbad

I am certainly a little dumb, but I cannot figure out how to copy the .map file into MapCal.
Use Notepad to copy the four map corner geo ref's in CHARTCAL.DIR and use them in ChartCal to enter new corner calibrations,then save. Then enter the next step in ChartCal to automatically set the four corner calibrations. This is half automatic as you only click on each of the four location lines and confirm each one before finally saving again to CHARTCAL.DIR.

You now have a new CHARTCAL.DIR plus your .png chart which is all that the 'Chartconvert' prog needs to produce a calibrated .kap chart compatible with OpenCPN as well as SeaClear.

Note. You have to convert the original bitmap to 127 colours and to the .png format. I usually do it in the free Gimp2 prog.

Quote:
OziExplorer Map Data File Version 2.2
NEW YORK BAY
NEW YORK BAY.jpg
1 ,Map Code,
WGS 84,, 0.0000, 0.0000,WGS 84
Reserved 1
Reserved 2
Magnetic Variation,,,E
Map Projection,Mercator,PolyCal,No,AutoCalOnly,No,BSBU seWPX,No
Point01,xy,0,0,in, deg,41,49.01238,N,73,49.25491,W, grid,,,,N
Point02,xy,9792,0,in, deg,41,49.01238,N,70,27.54593,W, grid,,,,N
Point03,xy,9792,3792,in, deg,40,50.35612,N,70,27.54593,W, grid,,,,N
Point04,xy,0,3792,in, deg,40,50.35612,N,73,49.25491,W, grid,,,,N

Projection Setup,,,,,,,,,,
Map Feature = MF ; Map Comment = MC These follow if they exist
Track File = TF These follow if they exist
Moving Map Parameters = MM? These follow if they exist
MM0,No
MMPNUM,4
MMPXY,1,0,0
MMPXY,2,9792,0
MMPXY,3,9792,3792
MMPXY,4,0,3792
MMPLL,1,-73.820915,41.816873
MMPLL,2,-70.459099,41.816873
MMPLL,3,-70.459099,40.839269
MMPLL,4,-73.820915,40.839269
MOP,Map Open Position,0,0
IWH,Map Image Width/Height,9792,3792
MM1B,28.6036
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 09-02-2010, 08:28   #539
Sponsoring Vendor
 
brak's Avatar

Community Sponsor
Cruisers Forum Supporter

Join Date: Jan 2009
Location: East of West
Posts: 252
Quote:
Originally Posted by GPS-Marco View Post
As promised and as described in post #485 , here you can now find a new mc2bsbh. It is not for "production" but just for alpha testing.

This new mc2bsbh-poly has the new capability to calculate the georeferencing polynomials. Just add a -p switch and this new piece of code will add to the kap header the polinomials.
Marco, I read your posts with interest. But if I understand you correctly, once you apply this process - you basically have to use these polynomials to apply actual transformations to go from chart image to screen?
brak is offline   Reply With Quote
Old 09-02-2010, 10:44   #540
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Quote:
Originally Posted by brak View Post
Marco, I read your posts with interest. But if I understand you correctly, once you apply this process - you basically have to use these polynomials to apply actual transformations to go from chart image to screen?
Well, this process adds the 4 polynomials to the KAP header. Those polys are one of the ways to go from chart X/Y to geographic Lat/Lon and viceversa.

Those polys are calculated (as brifly described in the previous posts) from the ref points. But of course any application can decide to ignore them and to use directly the ref points to make an internal process to go from chart XY to Lat/Long and viceversa. Polys are anyway widely used since BSB charts version 3.0 foresee as an option theese kind of polynomials precalculated and placed in the KAP headed.

Unfortunately those polys are not always optimal. As I wrote they fail on charts with high extention in latitude/longitude (ten(s) of degrees) since they cannot reproduce the complex formulas that are behind the projections.

So, at the end, the objective of my work is another: it is to develop a process that can become the internal process of OCPN to calculate from Ref Points the Georef tansformation functions. And the code I posted is just the rough implementation of such ideas and (partly) of such process.

Ciao, Marco.
__________________

__________________
GPS-Marco is offline   Reply With Quote
Reply

Tags
charts, kml, raster2bsb, tiff2bsb, bsb

Thread Tools
Display Modes Rate This Thread
Rate This 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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Charts on CD stxboy Navigation 43 28-01-2014 11:40
Charts for BC Charlie Navigation 11 19-04-2007 04:39
Used Charts daven Navigation 2 28-11-2006 17:47
Looking at charts - where to go to next Rippy Other 19 10-03-2006 05:27



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 03:35.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.