Added better test image; improved parameter

This commit is contained in:
Caesar2011
2016-12-07 23:20:58 +01:00
parent 5129eb207b
commit e309f5369e
11 changed files with 16 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 KiB

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -93,12 +93,12 @@ int main(int argc, char* args[]) {
glBindFramebuffer(GL_FRAMEBUFFER, FramebufferName);
// load foreground and background textures
int lenTexFG = 10;
int lenTexFG = 1;
GLint texFGs[lenTexFG];
char buffer[50];
texBG = LoadTexture("../img/backgrounds/sky.jpg",&textw2,&texth2);
for (int i=0; i<lenTexFG; i++) {
snprintf(buffer, sizeof(buffer), "../img/foregrounds/surfing/%d.jpg", i);
snprintf(buffer, sizeof(buffer), "../img/foregrounds/original-reference/%d.jpg", i);
texFGs[i] = LoadTexture(buffer,&textw,&texth);
}

View File

@@ -21,9 +21,9 @@ int IS_FOREGROUND = 2;
int UNSET = -1;
float M_PI= 3.14159;
int suchbreich=20; //die anzahl der Pixel, die maximal in eine Richtung gegangen wird um einen Sicheren Pixel zu finden
vec4 SicheresPixel[20]; //Speichert die das nachste Sichere Pixel, Array grosse=anzahl der Richtungen
int anzahl_richtungen=20; //Speichert anzahl der Richtungen muss gleich der Array grosse von SicheresPixel sein
int suchbreich=10; //die anzahl der Pixel, die maximal in eine Richtung gegangen wird um einen Sicheren Pixel zu finden
vec4 SicheresPixel[50]; //Speichert die das nachste Sichere Pixel, Array grosse=anzahl der Richtungen
int anzahl_richtungen=50; //Speichert anzahl der Richtungen muss gleich der Array grosse von SicheresPixel sein
vec3 getTriColor(vec2 uvCoord) {
return texture(trimap, uvCoord).rgb;
@@ -58,8 +58,10 @@ vec4 suche_Pixel_nach_winkel (vec2 uv, float winkel){
int status = getState(color_sichers_Pixel);
if (status==IS_FOREGROUND) {
return vec4(getForeColor(pix), i);
//return vec4(1f, 1f, 1f, i);
} else if (status==IS_BACKGROUND) {
return vec4(getBackColor(pix), i);
//return vec4(0f, 0f, 0f, i);
}else{
i++;
}
@@ -137,11 +139,15 @@ void main(){
if (status==IS_FOREGROUND) {
color = getForeColor(UV).rgb;
//color = vec3(1.0f, 0.0f, 0.0f);
//color = vec3(1.0f);
} else if (status==IS_BACKGROUND) {
color = getBackColor(UV).rgb;
//color = vec3(0.0f, 1.0f, 0.0f);
//color = vec3(0.0f);
} else {
vec3 h=Pruefe_Pixel_in_Umgebung(UV);
//h=vec3(1.0f, 0.0f,0f);
color = h;
color = Pruefe_Pixel_in_Umgebung(UV);
//color = vec3(0.0f, 0.0f, 1.0f);
//color = Pruefe_Pixel_in_Umgebung(UV);
}
}

View File

@@ -21,9 +21,9 @@ int IS_UNDEFINED = 1;
int IS_FOREGROUND = 2;
int UNSET = -1;
vec3 greenValue = vec3(0.0f, 1.0f, 0.0f);
vec3 greenValue = vec3(73.0f/255.0f, 129.0f/255.0f, 24.0f/255.0f);
vec3 difference = vec3(40.0f/255.0f);
int radius = 3;
int radius = 2;
vec3 getColor(vec2 uvCoord) {