opencv: image with grid and HIGHGUI error
Question: Hi I'm new to opencv(version 2.4.7) and using it in python 2.7.4. I always get
this error

> HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP

whenever I use the command

    
    
    cam = cv2.VideoCapture(cam_id)
    

The code works fine otherwise even with the error. I'm trying to use [this
wireless
camera](http://www.pollin.de/shop/dt/MTU4OTE0OTk-/Haustechnik/Sicherheitstechnik/Kameras/Zusatzkamera_Kanal_4.html)
and it shows an image which has a magenta and green colored grid structure. My
question is why am I getting the error and this weird image. The code gives
nice image on other system also on my system itself. gstreamer-properties also
have clear picture. The code:

    
    
    from cv2 import cv
    import cv2
    import sys
    
    def main(): 
    
    cam_id = 0
    
    # parameter
    for i, arg in enumerate( sys.argv ):
        if i == 0: continue
        else: cam_id = arg
    
    cam = cv2.VideoCapture(cam_id)
    
    cv2.namedWindow("window", cv.CV_WINDOW_AUTOSIZE)
    
    running = True
    
    while running:
        try:
            flag, img = cam.read()
            if flag:
                cv2.imshow("window", img)
                cv2.waitKey(30)
        except KeyboardInterrupt:
            running = False
    
    cv2.destroyWindow("window")
    
    main()     
    


Answer: Sorry to update so late, I had figured out solution of the issue long ago but
forgot to answer it here. It required loading a library before running the
code. Use of following commands should do the trick.

For 32bit system:

> `$ LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l2convert.so python
> filename.py`

For 64bit system:

> `$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l2convert.so python
> filename.py`

If this doesn't work then try locating the file v4l2convert.so by using
command,

> `$ locate v4l2convert.so`

As the output you'll see different paths, now try LD_PRELOAD with different
paths.

