-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added frame capture methods #22
base: master
Are you sure you want to change the base?
Conversation
self.select = select | ||
|
||
def next(self): | ||
if (len(select) > index_of_select): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to check len(videos) - 1
|
||
class Video_Stream_Capture: | ||
|
||
select = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field seems unnecessary
@@ -0,0 +1,26 @@ | |||
import cv2 as cv2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you name the folder ui
instead of Frame Capture
|
||
def frames(self): | ||
#for i in range(0, 5, 1): | ||
self.frame = cv2.VideoCapture(index_of_select) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to get the video object from videos
. Also this should be returning the frame we want.
@@ -0,0 +1,6 @@ | |||
import cv2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this needs a test script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put the video files in the images
folder of the repository.
vision/ui/video_stream_capture.py
Outdated
ret, frame = video.read() | ||
if ret == False: | ||
break | ||
captures.append(cv.2.imwrite('frame' + str(i) + '.jpg', frame)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just do captures.append(frame)
.
vision/ui/video_stream_capture.py
Outdated
break | ||
captures.append(cv.2.imwrite('frame' + str(i) + '.jpg', frame)) | ||
i+=1 | ||
videos.release() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to release the VideoCapture objects.
vision/ui/video_stream_capture.py
Outdated
captures.append(cv.2.imwrite('frame' + str(i) + '.jpg', frame)) | ||
i+=1 | ||
videos.release() | ||
return captures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then have return captures[index_of_select]
to get the camera we want.
vision/ui/video_stream_capture.py
Outdated
self.file_paths = file_paths | ||
for path in file_paths: | ||
videos.append(cv2.VideoCapture(file_paths)) | ||
self.select = select |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The select
variable isn't doing anything.
vision/ui/.vs/ProjectSettings.json
Outdated
@@ -0,0 +1,3 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add /.vs/
to the gitignore so these aren't pushed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the video file to the images directory?
index_of_select = 0 | ||
|
||
def frames(self): | ||
i=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable isn't getting used anywhere
Hi.