RCNN-Vehicle-Tracking-Lane-Detection icon indicating copy to clipboard operation
RCNN-Vehicle-Tracking-Lane-Detection copied to clipboard

TypeError: expected non-empty vector for x

Open yuyijie1995 opened this issue 6 years ago • 6 comments

Are there any requirements about input image?because when I use my own image to test ,there is error image

yuyijie1995 avatar May 08 '18 10:05 yuyijie1995

Refer config.py for the image dimension (IMAGE_MAX_DIM, IMAGE_MIN_DIM)

tj27-vkr avatar Aug 14 '18 19:08 tj27-vkr

I tried changing the dimension config over a variety of ranges (min-max), but that didn't work for me and I'm not sure what config is exactly expected for this to be robust and working for all image sizes.

For example, what would be the dimension config for input/test4.jpg? In my specific case, I have images of dimension 640x480.

athityakumar avatar Sep 10 '18 23:09 athityakumar

Ping @tj27-vkr - Sorry, forgot to mention you ^ 😅

athityakumar avatar Sep 10 '18 23:09 athityakumar

The problem is with the crop points to get the area of interest, which is currently hardcoded in process_image.py file. For now, you can modify the crop points with Y min to be 2/3rd of image height and X min, max to be 2/5th and 3/5th of the image width respectively. Will update with the patch soon.

tj27-vkr avatar Sep 11 '18 16:09 tj27-vkr

Hi, I want to change the size of the input picture but I cannot! I changed the process image file and config file as you said and I will receive the following errors: Traceback (most recent call last): File "main.py", line 137, in <module> a, img_result = findLane(img_arr) File "main.py", line 104, in findLane left_fit, right_fit, _ = ip.slidingWindow(masked_image) File "/home/mojzar/Desktop/RCNN-Vehicle-Tracking-Lane-Detection-master/process_image.py", line 140, in slidingWindow left_fit = np.polyfit(lefty, leftx, 2) File "/usr/local/lib/python3.6/dist-packages/numpy/lib/polynomial.py", line 550, in polyfit raise TypeError("expected non-empty vector for x") TypeError: expected non-empty vector for x

It means your code would not able to work with images which have different size but 1280 720 pixels?

The problem is with the crop points to get the area of interest, which is currently hardcoded in process_image.py file. For now, you can modify the crop points with Y min to be 2/3rd of image height and X min, max to be 2/5th and 3/5th of the image width respectively. Will update with the patch soon.

Mojzaar avatar Nov 12 '18 17:11 Mojzaar

That's correct once the matrix is adjusted, we can use different size pictures. Thank you.

robogeekcanada avatar Jan 09 '19 12:01 robogeekcanada