Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide the blurring generation code? #13

Closed
KengChiLiu opened this issue Nov 28, 2017 · 7 comments
Closed

Provide the blurring generation code? #13

KengChiLiu opened this issue Nov 28, 2017 · 7 comments

Comments

@KengChiLiu
Copy link

Hi, @SeungjunNah . Thanks for the work.
I'm working on experiment which need to generate blurring effect.
Do you think it is OK for you to provide the code of blurring generation ?
Thank you~

@SeungjunNah
Copy link
Owner

SeungjunNah commented Dec 4, 2017

Hi @KengChiLiu,
I don't have the exact blur generation code from provided GOPRO_Large_all dataset, as I generated the dataset directly from videos.
However, it is quite easy to generate blurry images.
Here is an example with torch.

require 'image'
img1 = image.load(filename1)
img2 = image.load(filename2)

signal1 = torch.pow(img1, 2.2)
signal2 = torch.pow(img2, 2.2)

signal_blur = (signal1 + signal2)/2
img_blur = torch.pow(signal_blur, 1/2.2)

Practically, it would be enough to assume linear CRF. In that case, followings would suffice.

require 'image'
img1 = image.load(filename1)
img2 = image.load(filename2)
img_blur = (img1 + img2)/2

@ghost
Copy link

ghost commented Jan 15, 2018

hi , so the sharp image in the dataset are with linear crf?
signal1 = image.load(filename1)
OR
img1 = image.load(filename1)
signal1 = torch.pow(img1, 2.2)

thanks!

@SeungjunNah
Copy link
Owner

A sharp image is taken with nonlinear CRF.
'img1' is the sharp image, and 'signal1' is the linearized value by applying inverse CRF.

@ghost
Copy link

ghost commented Jan 21, 2018

thanks!
when you mention your psnr and ssim results: the blurry dataset is with gamma = 2.2 or linear crf?
thanks!

@hazirbas
Copy link

hazirbas commented Mar 7, 2018

Hi @SeungjunNah ,
I would like to blur my videos and I have seen your code above. Is this how I should use my every consecutive frames to blur a video?

Thanks,
Caner

@SeungjunNah
Copy link
Owner

@SivanDoveh
Sorry, I missed your question. For the GOPRO dataset the PSNR is measured from gamma=2.2 blurry images. For the Kohler dataset, linear CRF is assumed.

@SeungjunNah
Copy link
Owner

@hazirbas
If the motion between your video frames is not big, yes.
In case you want your generated frames to be aligned with original frames, then you should take the average of N+1 frames (N/2 from past, 1 as self, N/2 from future).
However, if the motion in your videos was too fast, then step artifacts may occur on your synthesized images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants