When I was asked to make various things, I wanted to touch it myself, so I started studying on holidays
Dig up what was bought and left for the time being Raspberry Pi4 ModelB Rev1.2 and Raspberry Pi Camera v2 Raspbian 10 buster
Maybe I'll get stuck with the same thing after a while, so record my steps
Reference URL
http://igarashi-systems.com/sample/translation/raspberry-pi/usage/python-camera.html
IDE thonny? So move the copy of the sample program → Can be done without problems
Pip install python-opencv without thinking → Import cv2 cannot be done and hell begins
Reference URL
https://www.souichi.club/raspberrypi/python3-default/
$ sudo unlink python
$ sudo ln -s python3 python
I was just sick of hitting python3 because I was touching the terminal to see if it could be imported properly. After all, I couldn't touch it with the terminal, so it might be meaningless.
---
### Something is wrong with the keyboard, so fix it
Reference URL
> https://qiita.com/sukinasaki/items/426068d6e87169fa3d88
> ```
$ sudo raspi-config
From the same feeling
The name was different only at the beginning of config, but the fourth one is the same I wonder if it's not good to connect the keyboard with a USB switch, which sometimes returns to the original when I think I was able to set it. It returns to the original when switching the connection between the main PC and Raspberry Pi Addendum) I'm not sure, but did the original settings change to the Japanese layout? I deleted the English keyboard where the input methods are lined up and changed it to a Japanese keyboard, and it got better. Why was it made once in a while?
python3 + openCV
import cv2 cannot be used
Reference URL
https://creepfablic.site/2020/04/10/python-opencv-error/
Manage what seems to be related
ImportError: libjasper.so.1: cannot open shared object file: No such file or directory
$ sudo apt-get install libjasper-dev
$ sudo apt-get install libqt4-test
ImportError: libcblas.so.3: cannot open shared object file: No such file or directory
$ sudo apt-get install libatlas-base-dev
export LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1
Added
I didn't know how to use the command (I just misunderstood the contents of the opened file as a lot of errors) I opened .bashrc in / home / pi with a text editor and copied and pasted the above sentence to the bottom line and saved it. I also put it in the .profile Which is the correct answer?
Here import cv2 passes in the terminal
Try adding import cv2 to the sample program of the IDE → ImportError appears again
I don't want to worry about the one that was included as standard, so switch to software that I have touched a little
Reference URL
https://qiita.com/optimisuke/items/1cd7440442f7420e6b99
It was easy to put in.
→ Did you get an error because you used the same picamera as the one that imports the name as the working folder of VS Code? There is such a relationship
The sample program works safely and the image can be saved. import cv2 also passes
Alright, start line
Recommended Posts