Python error: argument -c/--conf is required
Question:   
I'm new in python, my native language is C. I'm doing a code in python for a
surveillance system triggered by motion using OpenCV. I based my code in the
one made by Adrian Rosebrock in his blog [
pyimagesearch.com](http://www.pyimagesearch.com/2015/06/01/home-surveillance-
and-motion-detection-with-the-raspberry-pi-python-and-opencv/). Originally the
code was developed for a Raspiberry Pi with a Pi Camera module attached to it,
now I'm trying to adapt to my notebook's webcam. He made a easier tutorial
about a simple code for motion detection and it worked very nicely in my PC.
But I'm having a hardtime with this other code. Probably it's a silly mistake,
but as begginer I couldn't found a specific answer to this issue.

  
This image have the part of the code that is causing the error (line 15) and
the structure of the project on the left side of the screen.  
[Image of python project for
surveillance](http://i.stack.imgur.com/fWwBZ.png).

  
Similar part, originall code:

    
    
    # import the necessary packages
    from pyimagesearch.tempimage import TempImage
    from dropbox.client import DropboxOAuth2FlowNoRedirect
    from dropbox.client import DropboxClient
    from picamera.array import PiRGBArray
    from picamera import PiCamera
    import argparse
    import warnings
    import datetime
    import imutils
    import json
    import time
    import cv2
    
    # construct the argument parser and parse the arguments
    ap = argparse.ArgumentParser()
    ap.add_argument("-c", "--conf", required=True,
        help="path to the JSON configuration file")
    args = vars(ap.parse_args())
    
    # filter warnings, load the configuration and initialize the Dropbox
    # client
    warnings.filterwarnings("ignore")
    conf = json.load(open(args["conf"]))
    client = None
    

  
Until now I only change these things:  

  * Exclude the imports relatives to pi camera.
  * Change `camera = PiCamera()` by `camera = cv2.VideoCapture(0)`. This way I use notebook's webcam.
  * Exclude:
    
        camera.resolution = tuple(conf["resolution"])
    camera.framerate = conf["fps"]
    rawCapture = PiRGBArray(camera, size=tuple(conf["resolution"]))
    

  * Substitute the line `for f in camera.capture_continuous(rawCapture, format="bgr", use_video_port=True):` by `while True:`.
  * Exclude two lines in program that was `rawCapture.truncate(0)`.

  
Probably there is more things to repair, if you now please tell me, but first
I'd like to understand how solve that mensage error. I use PyCharm in Windows
7 with Python 2.7 and OpenCV 3.1. Sorry for not post the entire code, but once
that this is my first question in the site and I have 0 reputation, apparently
I can just post 2 links. The entire originall code is in the
pyimagesearch.com. Thank you for your time!


Answer: I think you probably not running it properly. Error message is clear. You are
adding argument that means you need to provide them while running which you
are not doing.

Check this how he ran this in tutorial link you provided

<http://www.pyimagesearch.com/2015/06/01/home-surveillance-and-motion-
detection-with-the-raspberry-pi-python-and-
opencv#crayon-56d3c5551ac59089479643>

