Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Control and Autofocus Software for Chip-Level Microscopy (bunniestudios.com)
3 points by todsacerdoti on April 14, 2024 | hide | past | favorite | 1 comment


I truly appreciate these blog posts. I am building my own microscopes for different purposes and got into many of the same situations as bunnie did. It's nice to see other smart people tripping over the same issues.

opencv and pyqt5 work fine together if you delete a single file that gets installed by one or the other pip (I can't recall which). Ah- I see you found a slightly different solution but in the same area:

envpath = '/home/bunnie/.local/lib/python3.10/site-packages/cv2/qt/plugins/platforms' os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = envpath

I ended up writing a standalone program just for OpenCV testing: in the control thread, I use opencv to read from the camera or a video file, and then pass those frames with qt signals to the GUI thread. But before I do that, in the control thread, I do various image processing algorithms that use parameters set by Qt GUI elements. For example, for exposure time, make a QDoubleSpinBox (I use Qt Designer to quickly design nice GUI) and then the user can just adjust it up/down. I use this a lot for tuning parameters for hough circle detection.

It's absolutely worth it to get deep proficiency in PyQt, especially the QGraphicsView framework. if you're not uing that, you should be.

One more suggestion- I like PyChart and Qt Charts rather than doing data vis with OpenCV or matplotlib.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: