Sjcam sj360 usage

Hi people.
Topic for Sjcam sj360 owners.

It is cheap almost panoramic (220 degree) action camera.
Quality is not best.
It is example of raw photo original

Need to understand how it could be used for Mapillary (already asked help in support).

My first attempt was to use it as 360 (in horizontal plane) panoramic camera.
I wrote a converter to Equirectangular projection.
Here is result (original)

Quality is not enough to be published.

My current goal to use it as regular action camera, to crop a band across border ( pixel here are very low quality) and to transform some how from fish eye projection to good one for Mapillary.

I need help with latest point. Could someone suggest tool or algorithm to transform?

You wrote a converter to Equirectangular projection! :astonished:

Well, if you can manage that, I think you can manage Hugin:

This program has a bit of a steep learning curve, but is very powerful and has “batch options”

mapillary has tools to undistort fisheye projections, however they might only be limited to known cameras/lenses.
I think there was some sort of 3rd party software available to remove the distortion as well

Hi @eesger and @4004
Thank you for joining this topic!

Converter is not too complex task as I used algorithm from Internet.
I already make test in Hugin, it looks not bad but I loose top 2 floor of the building.

I cannot find how to batch. But all my searching are finishing with link to Hugin, so I will continue to research this software.

It is pity to loose panorama ability from this almost 220 degree view.

@eesger will be your man for Hugin questions. it certainly can do batch processing, but might take a while depending on your pc.
it is a shame to not have panoramic view, but consider how usable it would be for what you plan to do with it. ultimately a high res 110fov image is better than a low res 220 in my book

I agree that it more nice to see the same count of pixel in lesser FOV.
But 180° panorama could provide correct direction of object on the left and right instead of all is ahead and it could be useful, e.g. when you would like to see the photo of amenity in OsmAnd.

You want something like this?

save this as image.pto:

# hugin project file
#hugin_ptoversion 2
p f0 w3000 h1453 v160  E0 R0 n"TIFF_m c:LZW r:CROP"
m i0

# image lines
#-hugin  cropFactor=1
i w1726 h1726 f2 v194.768198522478 Ra0 Rb0 Rc0 Rd0 Re0 Eev0 Er1 Eb1 r8.10823114691033 p-5.75054971679435 y-1.69862189279197 TrX0 TrY0 TrZ0 Tpy0 Tpp0 j0 a0 b0 c0 d0 e0 g0 t0 Va1 Vb0 Vc0 Vd0 Vx0 Vy0  Vm5 n"sjcam360_preview.jpg"


# specify variables that should be optimized
v Ra0
v Rb0
v Rc0
v Rd0
v Re0
v Vb0
v Vc0
v Vd0
v


# control points

#hugin_optimizeReferenceImage 0
#hugin_blender enblend
#hugin_remapper nona
#hugin_enblendOptions 
#hugin_enfuseOptions 
#hugin_hdrmergeOptions -m avg -c
#hugin_verdandiOptions 
#hugin_outputLDRBlended true
#hugin_outputLDRLayers false
#hugin_outputLDRExposureRemapped false
#hugin_outputLDRExposureLayers false
#hugin_outputLDRExposureBlended false
#hugin_outputLDRStacks false
#hugin_outputLDRExposureLayersFused false
#hugin_outputHDRBlended false
#hugin_outputHDRLayers false
#hugin_outputHDRStacks false
#hugin_outputLayersCompression LZW
#hugin_outputImageType jpg
#hugin_outputImageTypeCompression LZW
#hugin_outputJPEGQuality 90
#hugin_outputImageTypeHDR exr
#hugin_outputImageTypeHDRCompression LZW
#hugin_outputStacksMinOverlap 0.7
#hugin_outputLayersExposureDiff 0.5
#hugin_outputRangeCompression 0
#hugin_optimizerMasterSwitch 1
#hugin_optimizerPhotoMasterSwitch 21

# hugin project file
#hugin_ptoversion 2
p f0 w3000 h1473 v144  E0 R0 n"TIFF_m c:LZW r:CROP"
m i0

# image lines
#-hugin  cropFactor=1
i w1726 h1726 f2 v194.768198522478 Ra0 Rb0 Rc0 Rd0 Re0 Eev0 Er1 Eb1 r7.88328141540465 p-5.48027908364539 y-20.047653924708 TrX0 TrY0 TrZ0 Tpy0 Tpp0 j0 a0 b0 c0 d0 e0 g0 t0 Va1 Vb0 Vc0 Vd0 Vx0 Vy0  Vm5 n"sjcam360_preview.jpg"


# specify variables that should be optimized
v Ra0
v Rb0
v Rc0
v Rd0
v Re0
v Vb0
v Vc0
v Vd0
v


# control points

#hugin_optimizeReferenceImage 0
#hugin_blender enblend
#hugin_remapper nona
#hugin_enblendOptions 
#hugin_enfuseOptions 
#hugin_hdrmergeOptions -m avg -c
#hugin_verdandiOptions 
#hugin_outputLDRBlended true
#hugin_outputLDRLayers false
#hugin_outputLDRExposureRemapped false
#hugin_outputLDRExposureLayers false
#hugin_outputLDRExposureBlended false
#hugin_outputLDRStacks false
#hugin_outputLDRExposureLayersFused false
#hugin_outputHDRBlended false
#hugin_outputHDRLayers false
#hugin_outputHDRStacks false
#hugin_outputLayersCompression LZW
#hugin_outputImageType jpg
#hugin_outputImageTypeCompression LZW
#hugin_outputJPEGQuality 90
#hugin_outputImageTypeHDR exr
#hugin_outputImageTypeHDRCompression LZW
#hugin_outputStacksMinOverlap 0.7
#hugin_outputLayersExposureDiff 0.5
#hugin_outputRangeCompression 0
#hugin_optimizerMasterSwitch 1
#hugin_optimizerPhotoMasterSwitch 21

also take a look at this:

1 Like

But I must say this looks nice, but I don’t think you have any use for this for Mapillary…

Try this:

  1. open image
  2. select circular fish eye
  3. enter 220 degrees
  4. press this icon:
    image
  5. correct your horizon via “move/drag”
  6. close that extra window
  7. in stitcher select JPG
  8. Output > stitch

result:

take a look: https://www.geoarchief.nl/test/test.html?pano.jpg

To be honest, I have no idea if Mapillary accepts this correctly!

For batch processing open PTBatcherGUI.exe
and read this: http://hugin.sourceforge.net/docs/manual/Hugin_Batch_Processor.html

(I wrote a script under linux… so I can’t help you much forther with that)

PS: image quality is not even that bad :wink:

2 Likes

Thank a lot! The panorama is looking great!

I followed your instruction some how created looking the same photo and uploaded it to Mapillary, will check later how it will be showed.

I wonder why your instruction does not contain point about Focal Length and Multiplicator factor. Were both of them replaced by Lend degree of view?

I will continue to study your post to understand better.

When you enter 220 degrees as “the range” of your fish eye camera, Hugin calculates your focal point (I believe I saw something like 7.9 mm)

PS: share a Mapillary link when it’s online!

Panorama is ready to view


It looks like quality became worse (if compare the same photo on panellum viewer).
Also there is black color on the back. Could Hugin generate not 360 panorama but partial?

Hmmm, hoped that the exif would contain 180 / 220 degrees… and/or that Mapillary would detect via the perfect black colour that it wasn’t a full 360…

I do not know if Mapillary detects this at a later point in time

Maybe send a mail to support@mapillary.com and ask for help?

Hugin can naturally not create data where there is no data! You entered one image…

You uploaded an image with resolution 1618 x 809, the resolution I showed you was 3000 x 1500, almost twice as high…

compression seems high on that uploaded image.
fov exif will probably need to be modified to cut off the back part of the image

when uploading 2:1 ratio images mapillary seems always interpret it as 360 pictures, even with my mobile phone using such resolution. I normally cut some pixels left/right to avoid perfect 2:1 ratio as I dont want to show it as 360 image

That’s correct. But you can define the viewing angle in EXIF also (among other things). So it should be possible to set a viewing angle of 180/200/220 (etc) degrees

After setting “Fit crop to images” on Sticher tab I received good photo without black area, metadata also has coorect value in GPano:CroppedAreaImageWidthPixels and GPano:CroppedAreaLeftPixels.
Now it is in processing but already could by viewed


Dimension is 3438x2825 pixel. Quality is good to see big house numbers.
Next step is apply template for several images in batch.
I created *.pto file for each images (using power shell script) and proceesed all succesful (initialy there was error

ERROR: Project file contains no images. > FATAL: (C:\Prog\Hugin\dynamic_vs2017\hugin-hg\src\hugin_base\panodata\Panorama.cpp:2177)
HuginBase::Panorama::readData(): (): Could not parse the data input successfully.

It was caused by unicode format of pto file, I fixed by adding “-Encoding ASCII” into powershell script.

Now I will continue investigate how to process a set of photo from camera to mapillary. I will post update when it will be ready.

2 Likes

@eesger please ignore my question from previous post, the reason was unicode encoding of file, it looks like Hugin could work only with ANSI, i fix it in powershell script.

Nicely done!

Please do post what and how you did it, so others can learn from it!

And share your PTO-file, it could help others owning the same camera you have (and save them the figuring out part :wink: )