Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 错误:(-209)操作既不是';数组操作数组'-(Python 3.4、opencv、picamera)_Arrays_Opencv_Python 3.4_Video Processing_Raspberry Pi3 - Fatal编程技术网

Arrays 错误:(-209)操作既不是';数组操作数组'-(Python 3.4、opencv、picamera)

Arrays 错误:(-209)操作既不是';数组操作数组'-(Python 3.4、opencv、picamera),arrays,opencv,python-3.4,video-processing,raspberry-pi3,Arrays,Opencv,Python 3.4,Video Processing,Raspberry Pi3,我想提供一个输入,一个从picamera(.h264)拍摄到我电脑中python代码的视频,[因为我的raspbian操作系统中没有安装opencv python] 我将.h264中的视频转换为mp4,并将其作为输入视频文件,得到以下错误 OpenCV Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have the same size an

我想提供一个输入,一个从picamera(.h264)拍摄到我电脑中python代码的视频,[因为我的raspbian操作系统中没有安装opencv python]

我将.h264中的视频转换为mp4,并将其作为输入视频文件,得到以下错误

OpenCV Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array') in arithm_op, file /io/opencv/modules/core/src/arithm.cpp, line 659

Traceback (most recent call last):

  File "/home/ramakrishna/PycharmProjects/Lanedect/driving-lane-departure-warning-master/main.py", line 36, in <module>

    clip = clip1.fl_image(process_frame) #NOTE: it should be in BGR format

  File "/home/ramakrishna/.local/lib/python3.4/site-packages/moviepy/video/VideoClip.py", line 533, in fl_image

    return self.fl(lambda gf, t: image_func(gf(t)), apply_to)

  File "/home/ramakrishna/.local/lib/python3.4/site-packages/moviepy/Clip.py", line 136, in fl

    newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))

  File "<decorator-gen-57>", line 2, in set_make_frame
 File "/home/ramakrishna/.local/lib/python3.4/site-packages/moviepy/decorators.py", line 14, in outplace

    f(newclip, *a, **k)

  File "/home/ramakrishna/.local/lib/python3.4/site-packages/moviepy/video/VideoClip.py", line 694, in set_make_frame

    self.size = self.get_frame(0).shape[:2][::-1]

  File "<decorator-gen-14>", line 2, in get_frame
  File "/home/ramakrishna/.local/lib/python3.4/site-packages/moviepy/decorators.py", line 89, in wrapper

    return f(*new_a, **new_kw)

  File "/home/ramakrishna/.local/lib/python3.4/site-packages/moviepy/Clip.py", line 95, in get_frame

    return self.make_frame(t)

  File "/home/ramakrishna/.local/lib/python3.4/site-packages/moviepy/Clip.py", line 136, in <lambda>

    newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))

  File "/home/ramakrishna/.local/lib/python3.4/site-packages/moviepy/video/VideoClip.py", line 533, in <lambda>

    return self.fl(lambda gf, t: image_func(gf(t)), apply_to)

  File "/home/ramakrishna/PycharmProjects/Lanedect/driving-lane-departure-warning-master/lane.py", line 619, in process_frame

    output = create_output_frame(offcenter, pts, img_undist_, fps, curvature, curve_direction, binary_sub)

  File "/home/ramakrishna/PycharmProjects/Lanedect/driving-lane-departure-warning-master/lane.py", line 486, in create_output_frame

    output = cv2.addWeighted(undist_ori, 1, newwarp_, 0.3, 0)

cv2.error: /io/opencv/modules/core/src/arithm.cpp:659: error: (-209) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function arithm_op

Process finished with exit code 1

我终于更改了视频文件的尺寸..使用手刹应用程序。现在工作正常..)我终于更改了视频文件的尺寸..使用手刹应用程序。现在工作正常..)
left_lane = Lane()

right_lane = Lane()

frame_width = 1280

frame_height = 720

LANEWIDTH = 3.7  # highway lane width in US: 3.7 meters

input_scale = 4

output_frame_scale = 4

N = 4 # buffer previous N lines

# fullsize:1280x720

x = [194, 1117, 705, 575]

y = [719, 719, 461, 461]

X = [290, 990, 990, 290]

Y = [719, 719, 0, 0]