Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 15-06-2017, 08:04   #1
Marine Service Provider

Join Date: May 2017
Boat: Pearson 10M
Posts: 20
Lightbulb imgkap - front end / gui for linux

Hi there!
I'm happy to a nonce you that I finish first working version of my app called gimgkap. It is a simple front end for imgkap.
Now you can in graphic interface in linux edit your existing kap files or make new one from scan / jpg / png
App have all'so build in perspective correction if you are making photo of paper charts weary useful.

looking forward for feedback.

https://github.com/yOyOeK1/gimgkap/releases/tag/1.0
yOyOeK1 is offline   Reply With Quote
Old 15-06-2017, 09:00   #2
Marine Service Provider

Join Date: May 2013
Location: Norway
Posts: 719
Re: imgkap - front end / gui for linux

A small introduction on how to run and use under ubuntu 16.04 would be great.
Quote:
Originally Posted by yOyOeK1 View Post
Hi there!
I'm happy to a nonce you that I finish first working version of my app called gimgkap. It is a simple front end for imgkap.
Now you can in graphic interface in linux edit your existing kap files or make new one from scan / jpg / png
App have all'so build in perspective correction if you are making photo of paper charts weary useful.

looking forward for feedback.

https://github.com/yOyOeK1/gimgkap/releases/tag/1.0
petter5 is offline   Reply With Quote
Old 15-06-2017, 11:30   #3
Marine Service Provider

Join Date: May 2017
Boat: Pearson 10M
Posts: 20
Re: imgkap - front end / gui for linux

Quote:
Originally Posted by petter5 View Post
A small introduction on how to run and use under ubuntu 16.04 would be great.
really good idea
if you have fresh ubuntu maybe you can help me establish the dependent library.
- Download it from link in post from github
- extract zip file
- make gimgkap.py executable
# chmod +x ./gimgkap.py
- run app (good idea to run it from terminal) then you / I will see what is missing or wrong
# ./gimgkap.py

As far I know python2.7, python-gi, python-pil, python-numpy
yOyOeK1 is offline   Reply With Quote
Old 16-06-2017, 00:18   #4
Registered User

Join Date: Aug 2016
Posts: 150
Re: imgkap - front end / gui for linux

@yOyOeK1 Thank You. It could be very usefull app ( in the future)

I'm trying gimgkap under Debian 8 (Jessie). My usecase is:Cut out blackborder from KAP files .
gimgkap starts without problem. I'm setting topleft and rightbottom corner (s. Attachment). And I don't know what is a next action....
Attached Thumbnails
Click image for larger version

Name:	gimgkap.jpg
Views:	136
Size:	197.5 KB
ID:	149979  
BlackSea is offline   Reply With Quote
Old 16-06-2017, 00:40   #5
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 510
Re: imgkap - front end / gui for linux

You still have some bugsIf I load an image (jpg or png) I only get a black screen and a notice "img loaded Now you need to setup the corners." , but I can't on just a black screen.
For small images it seems to work however, but the fullsize charts I have (abt 10Mb jpg) don't.
__________________
Navigation is know where you are and what to do to get where you want.
But also: Know where you don't want to be and what to do to don't get there.
rooiedirk is online now   Reply With Quote
Old 16-06-2017, 04:47   #6
Marine Service Provider

Join Date: May 2017
Boat: Pearson 10M
Posts: 20
Re: imgkap - front end / gui for linux

Quote:
Originally Posted by BlackSea View Post
@yOyOeK1 Thank You. It could be very usefull app ( in the future)

I'm trying gimgkap under Debian 8 (Jessie). My usecase is:Cut out blackborder from KAP files .
gimgkap starts without problem. I'm setting topleft and rightbottom corner (s. Attachment). And I don't know what is a next action....
After setting up the corners you can click on top right button "save as" and select target file. but!
If you set up top left and bottom right (two crossys) it is only for setting reference point it will not "crop" or cut out black stuff. For that you need to use the icon whit not strate squer (correct perspective on image)
click it and then set up for + as the info is showing on top bar left, right,..... and if you done click again perspective correction button.
That will "crop" your image.
And then you can set up yours reference point on two corners and click save as
yOyOeK1 is offline   Reply With Quote
Old 16-06-2017, 04:50   #7
Marine Service Provider

Join Date: May 2017
Boat: Pearson 10M
Posts: 20
Re: imgkap - front end / gui for linux

Quote:
Originally Posted by rooiedirk View Post
You still have some bugsIf I load an image (jpg or png) I only get a black screen and a notice "img loaded Now you need to setup the corners." , but I can't on just a black screen.
For small images it seems to work however, but the fullsize charts I have (abt 10Mb jpg) don't.
hymm bugs all ways
I didn't try so big images. Can you say what the resolution is of that jpg ? I have only weak laptop whit 512MB of ram and I have limited RAM to test so big images.
THX for feedback !
yOyOeK1 is offline   Reply With Quote
Old 16-06-2017, 05:01   #8
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: imgkap - front end / gui for linux

The weatherfax plugin can already make kap files with a gui interface. It can also re-project the chart.



why not make a raster chart editor plugin? The edited chart could be overlay on the other charts with partial transparency, and then allow adding or removing reference points with drag and drop. This allows you to align to the other charts.
seandepagnier is offline   Reply With Quote
Old 22-06-2017, 00:46   #9
Registered User

Join Date: Aug 2016
Posts: 150
Re: imgkap - front end / gui for linux

Quote:
Originally Posted by yOyOeK1 View Post
After setting up the corners you can click on top right button "save as" and select target file. but!
If you set up top left and bottom right (two crossys) it is only for setting reference point it will not "crop" or cut out black stuff. For that you need to use the icon whit not strate squer (correct perspective on image)
click it and then set up for + as the info is showing on top bar left, right,..... and if you done click again perspective correction button.
That will "crop" your image.
And then you can set up yours reference point on two corners and click save as
Thanks for your reply.
I made this flow. Crop works fine. But if I trying to "save", I bekame an error: "Somthing went wrong "
Code:
File selected: /home/oleg/segeln/tools/gimgkap/test.kap
saveAs
    target file [/home/oleg/segeln/tools/gimgkap/test.kap]
    cmd
    ------------------------------------
    imgkap "/tmp/gimgkap_transform.png" "None" "None" "0;0" "None" "None" "748;648" "/home/oleg/segeln/tools/gimgkap/test.kap"
    ------------------------------------
chkPossibleErrors [ERROR - Usage: imgkap [option] [inputfile] [lat0 lon0 [x0;y0] lat1 lon1 [x1;y1] | headerfile] [outputfile]

Usage of imgkap Version 1.13 by M'dJ + H.N

Convert kap to img :
  >imgkap mykap.kap myimg.png
    -convert mykap into myimg.png
  >imgkap mykap.kap mheader.kap myimg.png
    -convert mykap into header myheader (only text file) and myimg.png

Convert img to kap : 
  >imgkap myimg.png myheaderkap.kap
    -convert myimg.png into myresult.kap using myheader.kap for kap informations
  >imgkap mykap.png lat0 lon0 lat1 lon1 myresult.kap
    -convert myimg.png into myresult.kap using WGS84 positioning
  >imgkap mykap.png lat0 lon0 x0;y0 lat1 lon1 x1;y1 myresult.kap
    -convert myimg.png into myresult.kap
  >imgkap -s 'LOWEST LOW WATER' myimg.png lat0 lon0 lat1 lon2 -f
    -convert myimg.png into myimg.kap using WGS84 positioning and options

Convert kml to kap : 
  >imgkap mykml.kml
    -convert GroundOverlay mykml file into kap file using name and dir of image
  >imgkap mykml.kml mykap.kap
    -convert GroundOverlay mykml into mykap file

WGS84 positioning :
    lat0 lon0 is a left,top point
    lat1 lon1 is a right,bottom point
    lat to be between -85 and +85 degree
    lon to be between -180 and +180 degree
        different formats are accepted : -1.22  1°10'20.123N  -1d22.123 ...
    x;y can be used if lat lon is not a left, top and right, bottom point
        lat0 lon0 x0;y0 must be in the left, upper third of the image
        lat1 lon1 x1;y1 must be in the right, lower third of the image
Options :
    -w  : no image size extension to WGS84 because image is already WGS84
    -r x0f;y0f-x1f;y1f  "2 pixel points -> 4 * PLY"
        : define a rectangle area in the image visible from the .kap
    -r x0f;y0f-x1f;y1f-x2f;y2f-x3f;y3f... "3 to 10 pixel points -> PLY"
        : define a up to 10 edges polygon visible from the .kap
    -n  : Force compatibility all KAP software, max 127 colors
    -f  : fix units to FATHOMS
    -s name : fix sounding datum
    -t title : change name of map
    -p color : color of map
       color (Kap to image) : ALL|RGB|DAY|DSK|NGT|NGR|GRY|PRC|PRG
         ALL generate multipage image, use only with GIF or TIF
       color (image or Kap to Kap) :  NONE|KAP|MAP|IMG
         NONE use colors in image file, default
         KAP only width KAP or header file, use RGB tag in KAP file
         MAP generate DSK and NGB colors for map scan
           < 64 colors: Black -> Gray, White -> Black
         IMG generate DSK and NGB colors for image (photo, satellite...)
]--------------------------
BlackSea is offline   Reply With Quote
Old 22-06-2017, 01:31   #10
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 510
Re: imgkap - front end / gui for linux

Quote:
Originally Posted by yOyOeK1 View Post
hymm bugs all ways
I didn't try so big images. Can you say what the resolution is of that jpg ? I have only weak laptop whit 512MB of ram and I have limited RAM to test so big images.
THX for feedback !
I have some full paper charts scans. resolutions say 30 000 x 20 000
My workflow:
As I have multiple charts and I want to 'look' all charts the same, I start with making a (png) picture (size 1 x 16) and drop in here the 16 corlors I want to use for the chart. I named this file colorchart16/png.
Then use Imagemagick convert to convert to a 16 color pallete size
Code:
convert $filename -quality 0  +dither +antialias -type palette -remap colorchart16.png -colors 16 $foldername/${filename%.*}.png
This will give me a png picture with 16 colors and with some improvements in quality.
Then I use mapcal for calibration. (Runs fine under wine). Then a
Code:
mc2bsbh CHARTCAL.DIR
to get a header file. For some reason I need to rename the headerfile to a .txt extension.
Then use imgkap to make the final .kapfile
Code:
imgkap -p MAP $filename  headerfile.txt  $filename.KAP
I did a lot of tweaking in the workflow in order to get a reasonable sized chartfile.

Here Iyou can find a bigger file example https://drive.google.com/open?id=0B-...045Vkw3Vm1UbGs
__________________
Navigation is know where you are and what to do to get where you want.
But also: Know where you don't want to be and what to do to don't get there.
rooiedirk is online now   Reply With Quote
Old 22-06-2017, 08:42   #11
Marine Service Provider

Join Date: May 2017
Boat: Pearson 10M
Posts: 20
Re: imgkap - front end / gui for linux

@BlackSea
ok I think I know what you where trying to do.
That bug what you send appeared because you didn't hate a lat and lon defined for corners.
If you did.
open file "kap" and then "crop" using "correct perspective" then save as
and it crash then I have solution!
on git there is a update for that. I implement a code to preserve lat and lon. And now if you make a correction now lat and lon will be recalculate for new corner position (only if they where in 0,0 and max bottom right)


@rooiedirk
nice !
I think yours kungfu in using command line imgkap is to good to use my app

but still I will try to make it working whit so big images
yOyOeK1 is offline   Reply With Quote
Reply

Tags
linux


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
Imgkap - kap File Converter Tool MdJ OpenCPN 318 01-07-2020 05:43
GE and Image to BSB/KAP Using Imgkap Eric. Navigation 11 28-02-2012 08:29
Gui's thread form the Chicago Strictly Sail bene505 Monohull Sailboats 4 12-02-2009 14:32

Advertise Here


All times are GMT -7. The time now is 05:56.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.