File size: 4,254 Bytes
d131efd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f2a6147
d131efd
 
 
 
 
f2a6147
d131efd
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import streamlit as st
import pandas as pd
import numpy as np

# Custom CSS for styling
custom_css = """
<style>
    html, body, [data-testid="stAppViewContainer"] {
        background-image: linear-gradient(
            rgba(0, 0, 0, 0.6), 
            rgba(0, 0, 0, 0.6)
        ), 
        url("https://www.istockphoto.com/photo/tech-or-space-background-abstract-3d-illustration-gm1367865109-437999705?utm_source=pixabay&utm_medium=affiliate&utm_campaign=SRP_photo_sponsored&utm_content=https%3A%2F%2Fpixabay.com%2Fphotos%2Fsearch%2Fbackground%2520datascience%2F&utm_term=background+datascience.jpg");
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        color: white;  /* Ensures all text is readable */
    }
    h2, h3 {
        color: #FFD700; /* Gold color for headings */
    }
    p {
        color: #FFFFFF; /* White text for paragraphs */
    }
</style>
"""

# Inject the CSS into the app
st.markdown(custom_css, unsafe_allow_html=True)

st.markdown("<h2 style='text-align: left; color: Black;'>What is Video</h2>", unsafe_allow_html=True)
st.markdown(
    "<p style='font-size: 16px; color: White; font-style: italic;'>"
   "A video is a series of images (frames) shown in quick succession to create the perception of motion. Each frame is a static image, and the frame rate (e.g., 24, 30, or 60 frames per second) specifies the number of frames displayed per second."
    "</p>", 
    unsafe_allow_html=True
)

# Features of an videos using opencv
st.markdown("<h2 style='text-align: left; color: Black;'>Featrures of video using opencv</h2>", unsafe_allow_html=True)
st.markdown(
    "<p style='font-size: 16px; color: White; font-style: italic;'>"
    "OpenCV (Open Source Computer Vision Library) is a powerful tool for video processing. Using OpenCV, Python can perform a variety of operations on video files and streams."
    "</p>", 
    unsafe_allow_html=True
)
st.markdown("<h2 style='text-align: left; color: Black;'>Common Methods Video Processing with OpenCV:</h2>", unsafe_allow_html=True)
st.markdown(
    "<p style='font-size: 16px; color: White; font-style: italic;'>"
   "Reading Videos: cv2.VideoCapture: Opens and reads video files or streams."
    "Writing Videos: cv2.VideoWriter: Saves video frames into a file."
    "Displaying Video: Use cv2.imshow to display video frames as they are read."
    "Apply real-time frame manipulation, such as applying filters or transformations."
    "Convert video frames to grayscale: cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)"
   "</p>", 
    unsafe_allow_html=True
)
st.markdown("<h2 style='text-align: left; color: Black;'>Accessing WebCam with OpenCV:</h2>", unsafe_allow_html=True)
st.markdown(
    "<p style='font-size: 16px; color: White; font-style: italic;'>"
    "Accessing a webcam in Python is simple and efficient using OpenCV. The library provides the cv2.VideoCapture() function, which allows you to capture live video feed from your webcam."
    "</p>", 
    unsafe_allow_html=True
)
st.markdown("<h2 style='text-align: left; color: Black;'>Steps to Access Webcam:</h2>", unsafe_allow_html=True)
st.markdown(
    "<p style='font-size: 16px; color: White; font-style: italic;'>"
    "Import OpenCV: Ensure OpenCV is installed (pip install opencv-python) and import it."
    "Initialize Webcam: Use cv2.VideoCapture(0) to access the default webcam (replace 0 with the device index for other cameras)."
    "Read Frames: Use read() method to grab individual frames from the webcam feed."
    "Display Frames: Use cv2.imshow() to view the frames in a window."
    "Close Webcam: Release the webcam and close all OpenCV windows using cv2.VideoCapture.release() and cv2.destroyAllWindows()."
    "</p>", 
    unsafe_allow_html=True
)

# Adding the link to the code without showing the complete URL
st.markdown(
    "<h2 style='text-align: left; color: Black;'>Link to Full Code:</h2>", unsafe_allow_html=True
)
st.markdown(
    "<p style='font-size: 16px; color: White;'>"
    "You can view the full code for video processing using OpenCV on [this GitHub link](https://github.com/Sathwik4119/IMAGE/blob/main/video_using.cv2.ipynb)."
    "</p>", 
    unsafe_allow_html=True
)