Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

aranyakumar
Copy link
Contributor

Hi.

self.select = select

def next(self):
if (len(select) > index_of_select):
Copy link
Contributor

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 = []
Copy link
Contributor

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
Copy link
Contributor

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)
Copy link
Contributor

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
Copy link
Contributor

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

@aranyakumar aranyakumar closed this Dec 5, 2020
@aranyakumar aranyakumar reopened this Dec 5, 2020
Copy link
Contributor

@ryankarpuszka ryankarpuszka left a 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.

ret, frame = video.read()
if ret == False:
break
captures.append(cv.2.imwrite('frame' + str(i) + '.jpg', frame))
Copy link
Contributor

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).

break
captures.append(cv.2.imwrite('frame' + str(i) + '.jpg', frame))
i+=1
videos.release()
Copy link
Contributor

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.

captures.append(cv.2.imwrite('frame' + str(i) + '.jpg', frame))
i+=1
videos.release()
return captures
Copy link
Contributor

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.

self.file_paths = file_paths
for path in file_paths:
videos.append(cv2.VideoCapture(file_paths))
self.select = select
Copy link
Contributor

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.

@@ -0,0 +1,3 @@
{
Copy link
Contributor

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.

Copy link
Contributor

@ryankarpuszka ryankarpuszka left a 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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants