The base formulapi code that was tested seems to work fine, but since it was only the basic code it didn't want to avoid stationary cars.
It was recommended to look at adjusting some of the data in the numpy file.
Can anyone provide me with a location of where the numpy file is specifically please?
I've been told it's part of the python libraries, but since there's several libraries installed, I just don't have a clue where to begin.
I've tried find searches in the file explorer, but it doesn't show up. I can only assume it's a hidden file. :(
Hi Paxo,
numpy
(NumPy) is one of the very common libraries that you will come across with Python: it defines an extra object type ofarray
. In particular it allows you to do (multi-dimensional) array maths.The library itself is hidden away with all the other general libraries are is not generally for modifying.
cv2
(Computer Vision v2) is a second library that works with arrays. Older versions used to use different array types, but now the two array types are essentially the same. This means that you can do calculations on the arrays using numpy and put the results into cv2.Caveat: cv2 needs arrays working in integers, numpy can work with floats as well, so it may be necessary to perform a conversion after doing numpy calculations.
All the code that you might want to alter is in
ImageProcessor.py
, particularly in the function namedProcessImage
.Hint:
image
is an array to start you off. :)I hope that helps.
Geoff
As Geoff says above, NumPy is a very standard library for Python used by a lot of programs.
It adds the array data type and a lot of very useful mathematical processing functions.
We would not recommend altering the NumPy code at all.
I think the confusion is probably that we are using NumPy quite a bit in the processing code.
It might be a good idea to take a look at this as a crash-course in using NumPy:
https://docs.scipy.org/doc/numpy-dev/user/quickstart.html
Before changing the code I would suggest you take a look at our blog post: Detecting traffic.
This is more or less a quick example of what the real code does.
The detection code itself is all in
ImageProcessor.py
.The parts you are looking for are:
unknownPointCount
value which is used to make the decision.This is towards the end of
ProcessImage
in theStreamProcessor
class.unknownPointCount
and decides if it should overtake.This is in the
if checkForOverrides:
section ofPerformOverrides
in theControlLoop
class.This is also in
PerformOverrides
in theControlLoop
class.Okay, got you now. When I was told to look at numpy, I was looking for a specific file called numpy.
Add new comment