1 year ago
#372603
Myriam_2189
Addition images opencv (line road detection)
I hope everyone is doing well, I am working on a road lane detection project (white marking on the road), and I need to apply a pre-processing to the images before the detection, this pre-processing is the addition of successive images (10 img for example).
My objective is: Apply an algorithm which adds the successive images of the chosen image base, then save the result in a new base. I only have one information which is: The equation used to addition successive images is: I(k)=max{ I(k-1), I(k-2), ...., I(k-p) }
I(k) is the image at time k. P is the number of successive images to be added.
I used Python programming language and OpenCV library.
Here is the first code I made to download and display the images from the database which contains 60 images: download images:
images = [cv2.imread(file) for file in glob.glob("drive/MyDrive/Test1_lane_detection_/BDD/*.png")]
Display the images:
def list_images(images, cols = 4, rows = 15, cmap='gray'):
for i in range(0, len(images), rows*cols):
plt.figure(figsize=(50,50))
for j in range(0, rows*cols):
plt.subplot(rows, cols, j+1)
plt.imshow(images[i+j], cmap = cmap)
plt.axis("off")
plt.xticks([])
plt.yticks([])
plt.tight_layout(pad=0, h_pad=0, w_pad=0)
plt.show()
list_images(images)
Here are 5 images from the database: [3]: https://i.stack.imgur.com/Z2O6A.png [4]: https://i.stack.imgur.com/5bv1w.png [5]: https://i.stack.imgur.com/4lFbL.png [6]: https://i.stack.imgur.com/Y5B7Q.png [7]: https://i.stack.imgur.com/yPUBJ.png
And here is an example that shows the result I will try to achieveso, the goal is to improve the white markings and avoid discontinuous markings : This image represents, on the left the original image and on the right after the addition of 10 successive images: [8]: https://i.stack.imgur.com/69h0K.png
python
opencv
line
detection
0 Answers
Your Answer