Good day.
I am new with OpenCV
I want to use Smartek Giganetix GC1291MP camera for my project, but don’t know how to setup it.
I use code below, but it returns isOpened = False
I assume, I didn’t setup connection properly, but I can’t find any information how to establish a connection with none webcam.
Could someone help me?
def connecting_to_cam():
device = cv2.CAP_GIGANETIX
cap = cv2.VideoCapture(device)
if cap.isOpened() is False:
print("Can't open camera!")
quit()
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
writer = cv2.VideoWriter("Video/test_video1.mp4", cv2.VideoWriter_fourcc(*'DVIX'), 25, (width, height))
while True:
ret, frame = cap.read()
writer.write(frame)
#gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
writer.release()
cv2.destroyAllWindows()
please check cv2.getBuildInformation() (the VideoIO section),
to see if your cv2 has builtin support for this
(most likely - not so, you need to build it locally, with the resp. GigE sdk installed)
doesnt that already have it’s own python bindings ?
otherwise, you’'d have to build from github src build instructions are unfortunately slightly outdated and overcomplicated (sigh…) well the gist of it is:
get source code (zip will do), cmake, and a c++ compiler (VS or mingw)
make a build folder and cd into it
run cmake-gui, make sure it finds compiler,python and the sdk
build the INSTALL project(VS) or run mingw32-make install in the build folder
it’s probably a good idea, to report back the cmake output here, as most problems happen there !