0

Windows 10

OpenCV works, SimpleCV "runs"

Python2.7, SimpleCV1.3, OpenCV2.3 (x86)

The program is from the main site. I use SimpleCV on my Linux distros for robotics. I've never had to install SimpleCV for Windows, but I have Windows on my workstation because I use Steam. I would like to get SimpleCV to show my webcam. OpenCV works completely fine, but it's too much programming for my schedule.

from SimpleCV import Camera
# Initialize the camera
cam = Camera()
# Loop to continuously get images
while True:
    # Get Image from camera
    img = cam.getImage()
    # Make image black and white
    ##img = img.binarize()
    # Draw the text "Hello World" on image
    ##img.drawText("Hello World!")
    # Show the image
    img.show()

Shell output:

Traceback (most recent call last):
  File "C:\Python27\newfile4py27_camtest.py", line 13, in <module>
    img.show()
  File "C:\Python27\lib\site-packages\SimpleCV\ImageClass.py", line 5447, in show
    d = Display(self.size())
  File "C:\Python27\lib\site-packages\SimpleCV\Display.py", line 158, in __init__
    scvLogo = SimpleCV.Image("simplecv").scale(32,32)
  File "C:\Python27\lib\site-packages\SimpleCV\ImageClass.py", line 787, in __init__
    self._pil = pil.open(self.filename).convert("RGB")
  File "C:\Python27\lib\site-packages\PIL\Image.py", line 2766, in open
    fp = builtins.open(filename, "rb")
IOError: [Errno 2] No such file or directory: 'C:\\Python27\\lib\\site-packages\\SimpleCV\\sampleimages\\simplecv.png'
>>> 

Result:

  • A black window appears on screen. I guess it's about 200x200.
  • The title says pygame window. The icon is snake.
  • Nothing happens, so I click on it. The window freezes.
  • The window crash error appears. I cancel it and pygame closes.
  • I also can't get any of the examples to work. Such as calling logo = Image("simplecv") Output is Traceback (most recent call last): File "", line 1, in logo = Image("simplecv") NameError: name 'Image' is not defined – Daff Hartsough Feb 24 '20 at 05:46
  • >>> imp.find_module("Image") (, 'C:\\Python27\\lib\\site-packages\\Image.py', ('.py', 'U', 1)) – Daff Hartsough Feb 24 '20 at 05:55
  • That's not even the "right" directory. The name is Lib not lib. I changed that... I have like every Pil extension... SimpleCV doesn't even have "sampleimages" – Daff Hartsough Feb 24 '20 at 06:30

1 Answers1

0

I found the png file on the github from reading another forum. When I fixed the folder and adding the image, it worked. This still doesn't solve my other problem now. The most basic lines don't work. I have an entire OpenCV library working. SimpleCV is broke on windows.

Forum-answer

png logo that made the camera work