Dewarping algorithm for video images

The place to discuss development topics.
Discussions on the RICOH THETA API and SDK, image processing of spherical images, other hardware related topics, introduction of useful libraries, etc.

Re: Dewarping algorithm for video images

Postby jackiee_jacky » 09 Oct 2018, 10:03

I would be interested in the unwrapping algorithm as well.
code:
varying vec2 v_texcoord;
varying float v_pos_y;
uniform sampler2D texture;
uniform mat3 tilt;

const float M_PI = 3.14159265358979;
const float M_PI2 = M_PI / 2.0;
const float M_2PI = M_PI*2.0;
void main() {
float theta0 = M_PI2 - M_PI * v_texcoord.y;
float phi0 = M_2PI * v_texcoord.x;
float cosTheta = cos(theta0);
vec3 p = tilt * vec3(cosTheta * cos(phi0), sin(theta0), cosTheta * sin(phi0));
if (p.y > 1.0) p.y = 1.0;
if (p.y < -1.0) p.y = -1.0;
float theta = asin(p.y);
float phi = atan(p.z, p.x);
vec2 q = vec2(mod(phi / M_2PI, 1.0), 0.5 - theta / M_PI);
gl_FragColor = texture2D(texture, q);
}

varying vec2 v_texcoord;
varying float v_pos_y;
uniform sampler2D texture;
void main() {
vec4 src = texture2D(texture, v_texcoord) - vec4(0.0625, 0.5, 0.5, 0.0);
vec4 rgb;
rgb.b = 1.164383*src.r + 1.596027*src.b;
rgb.g = 1.164383*src.r - 0.391762*src.g - 0.812968*src.b;
rgb.r = 1.164383*src.r + 2.017232*src.g;
rgb.a = 1.0;
gl_FragColor = rgb;
}

varying vec2 v_texcoord;
varying float v_pos_y;
uniform sampler2D texture;

void main() {
gl_FragColor = texture2D(texture, v_texcoord);
}

varying vec2 v_texcoord;
varying float v_pos_y;
uniform sampler2D textureA;
uniform sampler2D textureB;
uniform sampler2D stitchTable;

void main() {
vec2 offset = (texture2D(stitchTable, v_texcoord).rg - vec2(0.5, 0.5))/24.0;
vec4 colA = texture2D(textureA, v_texcoord);
vec4 colB = texture2D(textureB, v_texcoord + offset);
colA.a = 1.0;
colB.a = 1.0;
float alpha = 0.5-(v_pos_y/0.02);
if (alpha<=0.0) { alpha=0.0; } else if (alpha>=1.0) { alpha=1.0; }
alpha = 1.0 - alpha;
gl_FragColor = colA*(1.0-alpha) + colB*alpha;
}

attribute vec4 position;
attribute vec2 texcoord;
varying vec2 v_texcoord;
varying float v_pos_y;

void main() {
gl_Position = position;
v_texcoord = texcoord;
v_pos_y = position.y;
}
real estate agent podcast
Latest Hindi Song Lyrics
Latest Punjabi Song Lyrics
zobeco
jkfitness
LyricsFed
real estate podcast
real estate investment usa
multifamily investing
Seo company in India | Lyrics fed
Last edited by jackiee_jacky on 18 Feb 2019, 11:32, edited 1 time in total.
jackiee_jacky
 
Posts: 31
Joined: 27 Sep 2018, 13:15

Re: Dewarping algorithm for video images

Postby JackyNautiyal » 23 Oct 2018, 15:19

Looking this video: https://www.youtube.com/watch?v=QUkt4y1idpY it seems there's yaw/pitch/roll information for each frame in the MOV file somewhere. At least that's the only plausible reason for the image tilts in the corners. This metadata would be needed, too, for successful conversion.

Shoulder Lyrics by Bohemia
Old Hindi Song Lyrics
Best real estate investing podcast
real estate podcast
english song lyrics
best web development company in india
mobile app development companies in india
JackyNautiyal
 
Posts: 25
Joined: 25 Sep 2018, 07:56

Re: Dewarping algorithm for video images

Postby KamyChaudary » 09 Feb 2019, 09:13

Hello Sir
I would be interested in the unwrapping algorithm as well.

Thanks
KamyChaudary
 
Posts: 2
Joined: 06 Feb 2019, 07:21

Previous

Return to Development



All times are UTC