I'm currently working on a Python script named bilin_intpol.py which is located in the /HW directory on my system. The script needs to read an image file named lenna.png that is located in the /code directory.
I attempted to load the image using OpenCV with the following line of code:
img = cv2.imread('../code/lenna.png')
However, I'm encountering an issue where the image cannot be read using this relative path. I'm not sure why this is happening.
Following is my directory:

And here is the code:

Has anyone faced a similar issue or does anyone know why the relative path might not be working in this context? Any insights or suggestions would be greatly appreciated.