Latest YouTube Video
Saturday, August 19, 2017
Ravens: John Harbaugh says he's interested in keeping newly retired LB Zach Orr around organization (ESPN)
via IFTTT
Arcadia Dunks 2017
from Google Alert - anonymous http://ift.tt/2ieWaFD
via IFTTT
Total Solar Eclipse of 1979
Friday, August 18, 2017
▶ #SCtop10: Manny Machado caps three-homer game with walk-off grand slam to give Orioles 9-7 win over Angels (ESPN)
via IFTTT
Grad Show: Anonymous
from Google Alert - anonymous http://ift.tt/2wZn9Z8
via IFTTT
Anonymous on Charlottesville
from Google Alert - anonymous http://ift.tt/2wpVNO3
via IFTTT
Anonymous 4 Sings Love Songs of Francesco Landini
from Google Alert - anonymous http://ift.tt/2waDv3y
via IFTTT
Can you edit an existing gift to mark it anonymous?
from Google Alert - anonymous http://ift.tt/2vQLMqV
via IFTTT
Can I make survey results anonymous?
from Google Alert - anonymous http://ift.tt/2vPVidK
via IFTTT
Ravens: Ex-LB Zach Orr ends comeback attempt after teams wouldn't clear his congenital spine and neck condition (ESPN)
via IFTTT
Anonymous As Told To Alexa Tsoulis-Reay
from Google Alert - anonymous http://ift.tt/2w890LO
via IFTTT
ISS Daily Summary Report – 8/17/2017
from ISS On-Orbit Status Report http://ift.tt/2xaUq2T
via IFTTT
The Anonymous
from Google Alert - anonymous http://ift.tt/2vJdveq
via IFTTT
Drupal Commerce does not create a user account for anonymous checkout
from Google Alert - anonymous http://ift.tt/2wVDiPr
via IFTTT
Virtual Special Issues: Voyager Anniversary Collection
On August 20th 1977, the spacecraft Voyager 2 was launched from Cape Canaveral in Florida, followed two weeks later by its twin Voyager 1. 2017 marks the 40th anniversary of the two remarkable probesThis Virtual Special Issue, containing Elsevier’s’ most influential Voyager articles.
from Icarus http://ift.tt/2uOgzY2
via IFTTT
I have a new follower on Twitter
Vast Drive
VAST Technology International Corporation is a startup technology company driven by solutions. Innovation leads the way and new ideas are what we produce.
Syracuse, NY
https://t.co/Xy5WSPweyK
Following: 5116 - Followers: 5794
August 18, 2017 at 04:48AM via Twitter http://twitter.com/VastDriveCorp
Android Trojan Now Targets Non-Banking Apps that Require Card Payments
from The Hacker News http://ift.tt/2xagpqE
via IFTTT
[FD] NetRipper - Smart Traffic Sniffing - Support for x64
Source: Gmail -> IFTTT-> Blogger
[FD] CVE-2017-6327: Symantec Messaging Gateway <= 10.6.3-2 unauthenticated root RCE
Source: Gmail -> IFTTT-> Blogger
[FD] NoviFlow NoviWare <= NW400.2.6 multiple vulnerabilities
Source: Gmail -> IFTTT-> Blogger
Share public items when anonymous access is disabled
from Google Alert - anonymous http://ift.tt/2uW784T
via IFTTT
Review of David's Kitchen, Chiang Mai, Thailand
from Google Alert - anonymous http://ift.tt/2v6X08D
via IFTTT
Creating an Anonymous Callback Function
from Google Alert - anonymous http://ift.tt/2uNXmWr
via IFTTT
Tracking Data Relay Satellite (TDRS) Orbital Fleet Communicating with User Spacecraft 2017 - 360 video
from NASA's Scientific Visualization Studio: Most Recent Items http://ift.tt/2uMXxRM
via IFTTT
Thursday, August 17, 2017
Ravens defeat Dolphins 31-7; QB Josh Woodrum 2 TD runs, Senorise Perry 11-yard TD run (ESPN)
via IFTTT
Orioles activate SS Ryan Flaherty (shoulder) from 60-day DL; outright SS Ruben Tejada to Triple-A (ESPN)
via IFTTT
Lightweight anonymous function syntax
from Google Alert - anonymous http://ift.tt/2wk3vJv
via IFTTT
Anonymous user 348746
from Google Alert - anonymous http://ift.tt/2wTZTfh
via IFTTT
Ravens: Ryan Mallett should get good shot to rebound Thursday - Jamison Hensley (ESPN)
via IFTTT
Two Critical Zero-Day Flaws Disclosed in Foxit PDF Reader
from The Hacker News http://ift.tt/2vMxYxB
via IFTTT
Unpatchable Flaw in Modern Cars Allows Hackers to Disable Safety Features
from The Hacker News http://ift.tt/2fOzvzk
via IFTTT
Police Investigate Anonymous Call in the 1200 block of Ft. Myer Drive
from Google Alert - anonymous http://ift.tt/2vG98AS
via IFTTT
ISS Daily Summary Report – 8/16/2017
from ISS On-Orbit Status Report http://ift.tt/2uTyUPi
via IFTTT
ET Agormeda Ministries
from Google Alert - anonymous http://ift.tt/2w4Ucxm
via IFTTT
Game of Thrones and HBO — Twitter, Facebook Accounts Hacked
from The Hacker News http://ift.tt/2wcPOwI
via IFTTT
'Gravity' Helmer Alfonso Cuaron Exits Wme
from Google Alert - anonymous http://ift.tt/2wcpKSp
via IFTTT
Tune achi anony
from Google Alert - anonymous http://ift.tt/2x6GmHJ
via IFTTT
NGC 2442: Galaxy in Volans
Wednesday, August 16, 2017
8th Street, Ocean City, MD's surf is Good
8th Street, Ocean City, MD Summary
Surf: shoulder to head high
Maximum: 1.53m (5.02ft)
Minimum: 1.224m (4.02ft)
Maryland-Delaware Summary
from Surfline http://ift.tt/1kVmigH
via IFTTT
Anonymous proxy daynonymous proxy day
from Google Alert - anonymous http://ift.tt/2vK3ITQ
via IFTTT
Village of Burns Lake to allow anonymous complaints
from Google Alert - anonymous http://ift.tt/2fMZS8v
via IFTTT
Ravens would need to overlook Ryan Matthews' lack of ball security to pursue him - Jamison Hensley (ESPN)
via IFTTT
Oopss! HBO Itself Accidentally Leaked 'Game of Thrones' Season 7 Episode 6
from The Hacker News http://ift.tt/2v1Muzj
via IFTTT
8th Street, Ocean City, MD's surf is Good
8th Street, Ocean City, MD Summary
Surf: shoulder to head high
Maximum: 1.53m (5.02ft)
Minimum: 1.224m (4.02ft)
Maryland-Delaware Summary
from Surfline http://ift.tt/1kVmigH
via IFTTT
ISS Daily Summary Report – 8/15/2017
from ISS On-Orbit Status Report http://ift.tt/2vDskzk
via IFTTT
Corrupt Federal Agent, Who Stole Bitcoins From Silk Road, Pleads Guilty To Money Laundering
from The Hacker News http://ift.tt/2wakQW7
via IFTTT
8 More Chrome Extensions Hijacked to Target 4.8 Million Users
from The Hacker News http://ift.tt/2wa4dK7
via IFTTT
I have a new follower on Twitter
Fabio Moioli
#Consulting & #Services Head @Microsoft @Msft #Digital #IoT #Cloud #Mobility #GrowthMindset #Innovation prev. @McKinsey #VicePresident @Capgemini @Ericsson
Viale Pasubio, 13, 20154 Milano MI, Italia
https://t.co/sCT2GRk3MT
Following: 3490 - Followers: 101789
August 16, 2017 at 06:28AM via Twitter http://twitter.com/fabiomoioli
I have a new follower on Twitter
Rick Podolsky
Digital Marketing Consultant. Growth Hacker. Intelisis Education IT Solutions Director. Scout. “Let´s try to leave this world a little better than we found it”
Mexico City
https://t.co/Ej0Q894RNK
Following: 14538 - Followers: 18909
August 16, 2017 at 03:48AM via Twitter http://twitter.com/RickRockMex
I have a new follower on Twitter
Campaign Sift
Here to sift through all the mess in DC to bring you the cold hard facts of American Politics
Alexandria, VA
Following: 1257 - Followers: 1955
August 16, 2017 at 03:48AM via Twitter http://twitter.com/CampaignSift
I have a new follower on Twitter
FosteringExcellence
Leadership coach; M.A. University of Utah | Husband, Dad | PMP | Air Force Chief | Recovering introvert | Slays dragons with the kids on the weekends.
Utah, USA
https://t.co/rycZ197LTO
Following: 14041 - Followers: 20602
August 16, 2017 at 03:43AM via Twitter http://twitter.com/fosterxcellence
Backdoor Found in Popular Server Management Software used by Hundreds of Companies
from The Hacker News http://ift.tt/2x3gnkn
via IFTTT
I have a new follower on Twitter
Stanislas Wargny
CEO @Imoxo - L'appli qui réinvente la manière de vendre son appartement. #immobilier #achat #vente #innovation #startup
Contactez-nous 09 77 55 20 33
https://t.co/QT028xzjkk
Following: 3001 - Followers: 3214
August 16, 2017 at 02:53AM via Twitter http://twitter.com/stanwarg
Perseid by the Sea
Tuesday, August 15, 2017
Anonymous user 83b1e5
from Google Alert - anonymous http://ift.tt/2vGUKGT
via IFTTT
Anonymous - General Manager
from Google Alert - anonymous http://ift.tt/2uGygsF
via IFTTT
Anonymous user 2f683a
from Google Alert - anonymous http://ift.tt/2uZC7fG
via IFTTT
'alt-right' in 'Operation Domestic Terrorism'
from Google Alert - anonymous http://ift.tt/2uGzSlR
via IFTTT
Anonymous Flight Attendants Passenger Shaming Instagram
from Google Alert - anonymous http://ift.tt/2i3LlWG
via IFTTT
Banana Boat Song (Anonymous)
from Google Alert - anonymous http://ift.tt/2fJ37y2
via IFTTT
Ravens: John Harbaugh drops "Caddyshack" reference during rain-soaked practice - Jamison Hensley (ESPN)
via IFTTT
Faulty Firmware Auto-Update Breaks Hundreds of 'Smart Locks'
from The Hacker News http://ift.tt/2uLUGVh
via IFTTT
Ravens: John Harbaugh indicates Breshad Perriman (hamstring) could miss entire preseason (ESPN)
via IFTTT
Raped Anonymous by Trappin Anonymous
from Google Alert - anonymous http://ift.tt/2w6XIaP
via IFTTT
ISS Daily Summary Report – 8/14/2017
from ISS On-Orbit Status Report http://ift.tt/2i3S5US
via IFTTT
Warning: Two Dangerous Ransomware Are Back – Protect Your Computers
from The Hacker News http://ift.tt/2fHBvco
via IFTTT
Beautiful Stories From Anonymous People #74 Holy Moly
from Google Alert - anonymous http://ift.tt/2w9uzuX
via IFTTT
[FD] QuantaStor Software Define Storage mmultiple vulnerabilities
Source: Gmail -> IFTTT-> Blogger
I have a new follower on Twitter
Top Infos 24
Veille de l'actu sur Twitter. #digital #medias #socialmedia #news
Paris, France
Following: 4803 - Followers: 654
August 15, 2017 at 03:08AM via Twitter http://twitter.com/Top24infos
I have a new follower on Twitter
Gabriel de Montessus
CPMO @Ingenico ex-CEO @hipay; Data Driven & Innovation Enthusiast! #GrowthHacking #Payments #FinTech #ProductDevelopment #Ecommerce #UX #MCommerce #DeepLearning
Paris
https://t.co/h51xT38jCs
Following: 3681 - Followers: 4308
August 15, 2017 at 01:43AM via Twitter http://twitter.com/gdemontessus
Stars, Gas, and Dust Battle in the Carina Nebula
Monday, August 14, 2017
Anothernymous, sister guild of Anonymous (#1 on PC/Mobile)
from Google Alert - anonymous http://ift.tt/2uEio9R
via IFTTT
Far-right propaganda website Daily Stormer 'hacked' by Anonymous
from Google Alert - anonymous http://ift.tt/2uWxP8Q
via IFTTT
Anonymous proxy detected, click here.
from Google Alert - anonymous http://ift.tt/2uDPQx3
via IFTTT
How Just Opening A Malicious PowerPoint File Could Compromise Your PC
from The Hacker News http://ift.tt/2vVtJlC
via IFTTT
Ravens: Ryan Mallett isn't to blame for all offensive struggles, says OC Marty Mornhinweg (ESPN)
via IFTTT
Gmail for iOS Adds Anti-Phishing Feature that Warns of Suspicious Links
from The Hacker News http://ift.tt/2w6e6aG
via IFTTT
Ravens' banged-up 2016 draft class has reason to be superstitious - Jamison Hensley (ESPN)
via IFTTT
Anonymous tip leads to drugs, gun arrest in Atlantic City
from Google Alert - anonymous http://ift.tt/2w65PUf
via IFTTT
Long exposure with OpenCV and Python
One of my favorite photography techniques is long exposure, the process of creating a photo that shows the effect of passing time, something that traditional photography does not capture.
When applying this technique, water becomes silky smooth, stars in a night sky leave light trails as the earth rotates, and car headlights/taillights illuminate highways in a single band of continuous motion.
Long exposure is a gorgeous technique, but in order to capture these types of shots, you need to take a methodical approach: mounting your camera on a tripod, applying various filters, computing exposure values, etc. Not to mention, you need to be a skilled photographer!
As a computer vision researcher and developer, I know a lot about processing images — but let’s face it, I’m a terrible photographer.
Luckily, there is a way to simulate long exposures by applying image/frame averaging. By averaging the images captured from a mounted camera over a given period of time, we can (in effect) simulate long exposures.
And since videos are just a series of images, we can easily construct long exposures from the frames by averaging all frames in the video together. The result is stunning long exposure-esque images, like the one at the top of this blog post.
To learn more about long exposures and how to simulate the effect with OpenCV, just keep reading.
Looking for the source code to this post?
Jump right to the downloads section.
Long exposure with OpenCV and Python
This blog post is broken down into three parts.
In the first part of this blog post, we will discuss how to simulate long exposures via frame averaging.
From there, we’ll write Python and OpenCV code that can be used to create long exposure-like effects from input videos.
Finally, we’ll apply our code to some example videos to create gorgeous long exposure images.
Simulating long exposures via image/frame averaging
The idea of simulating long exposures via averaging is hardly a new idea.
In fact, if you browse popular photography websites, you’ll find tutorials on how to manually create these types of effects using your camera and tripod (a great example of such a tutorial can be found here).
Our goal today is to simply implement this approach so we can automatically create long exposure-like images from an input video using Python and OpenCV. Given an input video, we’ll average all frames together (weighting them equally) to create the long exposure effect.
Note: You can also create this long exposure effect using multiple images, but since a video is just a sequence of images, it’s easier to demonstrate this technique using video. Just keep this in mind when applying the technique to your own files.
As we’ll see, the code itself is quite simple but has a beautiful effect when applied to videos captured using a tripod, ensuring there is no camera movement in between frames.
Implementing long exposure simulation with OpenCV
Let’s begin by opening a new file named
long_exposure.py, and inserting the following code:
# import the necessary packages import argparse import imutils import cv2 # construct the argument parse and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-v", "--video", required=True, help="path to input video file") ap.add_argument("-o", "--output", required=True, help="path to output 'long exposure'") args = vars(ap.parse_args())
Lines 2-4 handle our imports — you’ll need imutils and OpenCV.
In case you don’t already have
imutilsinstalled on your environment, simply use
pip:
$ pip install --upgrade imutils
If you don’t have OpenCV configured and installed, head on over to my OpenCV 3 tutorials page and select the guide that is appropriate for your system.
We parse our two command line arguments on Lines 7-12:
-
--video
: The path to the video file. -
--output
: The path + filename to the output “long exposure” file.
Next, we will perform some initialization steps:
# initialize the Red, Green, and Blue channel averages, along with # the total number of frames read from the file (rAvg, gAvg, bAvg) = (None, None, None) total = 0 # open a pointer to the video file print("[INFO] opening video file pointer...") stream = cv2.VideoCapture(args["video"]) print("[INFO] computing frame averages (this will take awhile)...")
On Line 16 we initialize RGB channel averages which we will later merge into the final long exposure image.
We also initialize a count of the total number of frames on Line 17.
For this tutorial, we are working with a video file that contains all of our frames, so it is necessary to open a file pointer to the video capture
streamon Line 21.
Now let’s begin our loop which will calculate the average:
# loop over frames from the video file stream while True: # grab the frame from the file stream (grabbed, frame) = stream.read() # if the frame was not grabbed, then we have reached the end of # the sfile if not grabbed: break # otherwise, split the frmae into its respective channels (B, G, R) = cv2.split(frame.astype("float"))
In our loop, we will grab frames from the
stream(Line 27) and split the
frameinto its respective BGR channels (Line 35). Notice the exit condition squeezed in between — if a frame is
not grabbedfrom the stream we are at the end of the video file and we will
breakout of the loop (Lines 31 and 32).
In the remainder of the loop we’ll perform the running average computation:
# if the frame averages are None, initialize them if rAvg is None: rAvg = R bAvg = B gAvg = G # otherwise, compute the weighted average between the history of # frames and the current frames else: rAvg = ((total * rAvg) + (1 * R)) / (total + 1.0) gAvg = ((total * gAvg) + (1 * G)) / (total + 1.0) bAvg = ((total * bAvg) + (1 * B)) / (total + 1.0) # increment the total number of frames read thus far total += 1
If this is the first iteration, we set the initial RGB averages to the corresponding first frame channels grabbed on Lines 38-41 (it is only necessary to do this on the first go-around, hence the
if-statement).
Otherwise, we’ll compute the running average for each channel on Lines 45-48. The averaging computation is quite simple — we take the total number of frames times the channel-average, add the respective channel, and then divide that result by the floating point total number of frames (we add 1 to the total in the denominator because this is a fresh frame). We store the calculations in respective RGB channel average arrays.
Finally, we increment the total number of frames, allowing us to maintain our running average (Line 51).
Once we have looped over all frames in the video file, we can merge the (average) channels into one image and write it to disk:
# merge the RGB averages together and write the output image to disk avg = cv2.merge([bAvg, gAvg, rAvg]).astype("uint8") cv2.imwrite(args["output"], avg) # do a bit of cleanup on the file pointer stream.release()
On Line 54, we utilize the handy
cv2.mergefunction while specifying each of our channel averages in a list. Since these arrays contain floating point numbers (as they are averages across all frames), we tack on the
astype("uint8")to convert pixels to integers in the range [0-255].
We write the
avgimage to disk on the subsequent Line 55 using the command line argument path + filename. We could also display the image to our screen via
cv2.imshow, but since it can take a lot of CPU time to process a video file, we’ll simply save the image to disk just in case we want to save it as our desktop background or share it with our friends on social media.
The final step in this script is to perform cleanup by releasing our video stream pointer (Line 58).
Long exposure and OpenCV results
Let’s see our script in action by processing three sample videos. Note that each video was captured by a camera mounted on a tripod to ensure stability.
Note: The videos I used to create these examples do not belong to me and were licensed from the original creators; therefore, I cannot include them along with the source code download of this blog post. Instead, I have provided links to the original videos should you wish to replicate my results.
Our first example is a 15-second video of water rushing over rocks — I have included a sample of frames from the video below:
To create our long exposure effect, just execute the following command:
$ time python long_exposure.py --video videos/river_01.mov --output river_01.png [INFO] opening video file pointer... [INFO] computing frame averages (this will take awhile)... real 2m1.710s user 0m50.959s sys 0m40.207s
Notice how the water has been blended into a silky form due to the averaging process.
Let’s continue with a second example of a river, again, with a montage of frames displayed below:
The following command was used to generate the long exposure image:
$ time python long_exposure.py --video videos/river_02.mov --output river_02.png [INFO] opening video file pointer... [INFO] computing frame averages (this will take awhile)... real 0m57.881s user 0m27.207s sys 0m21.792s
Notice how the stationary rocks remain unchanged, but the rushing water is averaged into a continuous sheet, thus mimicking the long exposure effect.
This final example is my favorite as the color of the water is stunning, giving a stark contrast between the water itself and the forest:
When generating the long exposure with OpenCV, it gives the output a surreal, dreamlike feeling:
$ time python long_exposure.py --video videos/river_03.mov --output river_03.png [INFO] opening video file pointer... [INFO] computing frame averages (this will take awhile)... real 3m17.212s user 1m11.826s sys 0m56.707s
Different outputs can be constructed by sampling the frames from the input video at regular intervals rather than averaging all frame. This is left as an exercise to you, the reader, to implement.
Summary
In today’s blog post we learned how to simulate long exposure images using OpenCV and image processing techniques.
To mimic a long exposure, we applied frame averaging, the process of averaging a set of images together. We made the assumption that our input images/video were captured using a mounted camera (otherwise the resulting output image would be distorted).
While this is not a true “long exposure”, the effect is quite (visually) similar. And more importantly, this allows you to apply the long exposure effect without (1) being an expert photographer or (2) having to invest in expensive cameras, lenses, and filters.
If you enjoyed today’s blog post, be sure to enter your email address in the form below to be notified when future tutorials are published!
Downloads:
The post Long exposure with OpenCV and Python appeared first on PyImageSearch.
from PyImageSearch http://ift.tt/2uUQMbU
via IFTTT
Facebook Covertly Launches A Photo-Sharing App In China
from The Hacker News http://ift.tt/2wIKqOX
via IFTTT
Ravens make QB moves, sign Thad Lewis and waive Dustin Vaughan (ESPN)
via IFTTT
IPS as a Service Blocks WannaCry Spread Across the WAN
from The Hacker News http://ift.tt/2uC4ntm
via IFTTT