Fast gaussian blur appears brighter when blurred object's only partly visible #25543

Closed
opened 2011-01-08 14:56:33 +01:00 by Thomas Fehrenbach · 8 comments

%%%There seems to be a problem with the fast gaussian blur (blur node). As long as the object's only partly visible, the blur appears much brighter. Just render the blend file enclosed. There are two (sun alike) objects (duplicates) on the same render layer, the partly visible one shows the issue.

Blender version is 2.56a beta on ubuntu 10.04, graphic card is intel gm45.
Thanks in advance....
Greets
Tom%%%

%%%There seems to be a problem with the fast gaussian blur (blur node). As long as the object's only partly visible, the blur appears much brighter. Just render the blend file enclosed. There are two (sun alike) objects (duplicates) on the same render layer, the partly visible one shows the issue. Blender version is 2.56a beta on ubuntu 10.04, graphic card is intel gm45. Thanks in advance.... Greets Tom%%%

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%Issue confirmed; unfortunately this "fast gauss" code has a mathematically weak side on borders, as noted in our code.

What we use is Recursive Gabor Filtering" by Young/VanVliet, with "border correction" from Triggs/Sdika:
http://ljk.imag.fr/membres/Bill.Triggs/pubs/Triggs-tsp05.pdf

These edge cases seem to be common, and definitely are interesting for research... it's even possible our code has bugs, but the code was provided by a developer "as is", without any maintenance or support. For your interest I've put a piece of this border-correction code here below, this is quite un-debuggable :)
I'll note this on our todo, with link to this report. An image-processing guru might be feeling invited to help here.

sc = (1.1668 + q)*(3.203729649  + (2.21566 + q)*q);
cf- [x] = q*(5.788961737 + (6.76492 + 3.0*q)*q)/ sc;
cf- [x] = -q2*(3.38246 + 3.0*q)/sc;
cf- [x] = q2*q/sc;
cf- [x] = 1.0 - cf- [x] - cf- [x] - cf[3];

sc = cf- [x]/((1.0 + cf- [x] - cf- [x] + cf- [x])*(1.0 - cf- [x] - cf- [x] - cf- [x])*(1.0 + cf- [x] + (cf- [x] - cf- [x])*cf[3]));
tsM- [x] = sc*(-cf- [x]*cf- [x] + 1.0 - cf- [x]*cf- [x] - cf[2]);
tsM- [x] = sc*((cf- [x] + cf- [x])*(cf- [x] + cf- [x]*cf[1]));
tsM- [x] = sc*(cf- [x]*(cf- [x] + cf- [x]*cf[2]));
tsM- [x] = sc*(cf- [x] + cf- [x]*cf[2]);
tsM- [x] = sc*(-(cf- [x] - 1.0)*(cf- [x] + cf- [x]*cf[1]));
tsM- [x] = sc*(-(cf- [x]*cf- [x] + cf- [x]*cf- [x] + cf- [x] - 1.0)*cf[3]);
tsM- [x] = sc*(cf- [x]*cf- [x] + cf- [x] + cf- [x]*cf- [x] - cf- [x]*cf[2]);
tsM- [x] = sc*(cf- [x]*cf- [x] + cf- [x]*cf- [x]*cf- [x] - cf- [x]*cf- [x]*cf- [x] - cf- [x]*cf- [x]*cf- [x] - cf- [x]*cf- [x] + cf[3]);
tsM- [x] = sc*(cf- [x]*(cf- [x] + cf- [x]*cf[2]));

%%%

%%%Issue confirmed; unfortunately this "fast gauss" code has a mathematically weak side on borders, as noted in our code. What we use is Recursive Gabor Filtering" by Young/VanVliet, with "border correction" from Triggs/Sdika: http://ljk.imag.fr/membres/Bill.Triggs/pubs/Triggs-tsp05.pdf These edge cases seem to be common, and definitely are interesting for research... it's even possible our code has bugs, but the code was provided by a developer "as is", without any maintenance or support. For your interest I've put a piece of this border-correction code here below, this is quite un-debuggable :) I'll note this on our todo, with link to this report. An image-processing guru might be feeling invited to help here. sc = (1.1668 + q)*(3.203729649 + (2.21566 + q)*q); cf- [x] = q*(5.788961737 + (6.76492 + 3.0*q)*q)/ sc; cf- [x] = -q2*(3.38246 + 3.0*q)/sc; cf- [x] = q2*q/sc; cf- [x] = 1.0 - cf- [x] - cf- [x] - cf[3]; sc = cf- [x]/((1.0 + cf- [x] - cf- [x] + cf- [x])*(1.0 - cf- [x] - cf- [x] - cf- [x])*(1.0 + cf- [x] + (cf- [x] - cf- [x])*cf[3])); tsM- [x] = sc*(-cf- [x]*cf- [x] + 1.0 - cf- [x]*cf- [x] - cf[2]); tsM- [x] = sc*((cf- [x] + cf- [x])*(cf- [x] + cf- [x]*cf[1])); tsM- [x] = sc*(cf- [x]*(cf- [x] + cf- [x]*cf[2])); tsM- [x] = sc*(cf- [x] + cf- [x]*cf[2]); tsM- [x] = sc*(-(cf- [x] - 1.0)*(cf- [x] + cf- [x]*cf[1])); tsM- [x] = sc*(-(cf- [x]*cf- [x] + cf- [x]*cf- [x] + cf- [x] - 1.0)*cf[3]); tsM- [x] = sc*(cf- [x]*cf- [x] + cf- [x] + cf- [x]*cf- [x] - cf- [x]*cf[2]); tsM- [x] = sc*(cf- [x]*cf- [x] + cf- [x]*cf- [x]*cf- [x] - cf- [x]*cf- [x]*cf- [x] - cf- [x]*cf- [x]*cf- [x] - cf- [x]*cf- [x] + cf[3]); tsM- [x] = sc*(cf- [x]*(cf- [x] + cf- [x]*cf[2])); %%%
Member

%%%Added a patch to (hopefully) make the code easier understand. Border correction will eliminate issues arising from the original Young and van Vliet algorithm, but the filter still has no information about the image outside its borders. I think the aim of the border correction here, is that, in the absence of other information it maintains the status quo i.e. it makes sure that the blurred result on the border is no brighter or dimmer than the unblurred image.%%%

%%%Added a patch to (hopefully) make the code easier understand. Border correction will eliminate issues arising from the original Young and van Vliet algorithm, but the filter still has no information about the image outside its borders. I think the aim of the border correction here, is that, in the absence of other information it maintains the status quo i.e. it makes sure that the blurred result on the border is no brighter or dimmer than the unblurred image.%%%
Member

%%%Andrew: thanks! Will reopen report now. Don't have time or energy to do it today, but it's on the active list again :)%%%

%%%Andrew: thanks! Will reopen report now. Don't have time or energy to do it today, but it's on the active list again :)%%%
Member

%%%Andrew: took a while, sorry. I've applied the patch now. The math you've provided seems to differ, but the result on rendering the attached sample is identical... was it meant to solve the brightness overflowing?%%%

%%%Andrew: took a while, sorry. I've applied the patch now. The math you've provided seems to differ, but the result on rendering the attached sample is identical... was it meant to solve the brightness overflowing?%%%
Member

%%%Ton: It won't change the result, but the original implementation did not seem consistent with the paper it was based on, even though it gave the correct result. It was really just to improve the readability and confirm that it was giving the result that the paper predicted. That way, hopefully if there are any problems, I (or someone else for that matter) can understand the code better. The brightness issue reported here is the expected behaviour, the border correction is used to improve the result as it is even worse without the correction. Let me know if there are any areas of the code which need better explaination.%%%

%%%Ton: It won't change the result, but the original implementation did not seem consistent with the paper it was based on, even though it gave the correct result. It was really just to improve the readability and confirm that it was giving the result that the paper predicted. That way, hopefully if there are any problems, I (or someone else for that matter) can understand the code better. The brightness issue reported here is the expected behaviour, the border correction is used to improve the result as it is even worse without the correction. Let me know if there are any areas of the code which need better explaination.%%%
Member

%%%Hi Andrew,

I'll mark this as a todo item now, with link to this report. Assuming the implementation for fast gauss is correct (compliant to paper) we better note is as a known limit.
Fast gauss probably shouldn't be used at all... with new compositor (opencl) things might get a good speedup anyway.%%%

%%%Hi Andrew, I'll mark this as a todo item now, with link to this report. Assuming the implementation for fast gauss is correct (compliant to paper) we better note is as a known limit. Fast gauss probably shouldn't be used at all... with new compositor (opencl) things might get a good speedup anyway.%%%
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#25543
No description provided.