Computer Vision, Statistics & Python
Programming
Welcome to this comprehensive guide designed for students and beginner programmers exploring the exciting
world of computer vision, statistical analysis with Orange, and Python programming. This document will walk you
through essential concepts, practical applications, and hands-on programming examples to build your
foundational skills in these interconnected domains.
Understanding Computer
Vision Tasks
Computer vision enables machines to interpret and understand visual
information from the world. Let's explore the fundamental tasks that
form the backbone of this technology, from simple image classification
to complex segmentation techniques.
Classification
Determining what object appears in an image. For example,
identifying whether an image contains a cat or a dog.
Classification + Localization
Not only identifying the object but also drawing a bounding box
around its location in the image.
Object Detection
Finding and classifying multiple objects within a single image, each
with its own bounding box.
Image Segmentation
Classifying every pixel in an image, creating precise boundaries
around objects for detailed analysis.
Images: Pixels, Resolution & Color
Understanding Digital Images
Digital images are composed of tiny squares called
pixels. Each pixel contains color information that,
when combined with thousands or millions of other
pixels, creates the complete image you see on screen.
Resolution refers to the dimensions of an image,
measured in pixels (width × height). Higher resolution
means more detail and larger file sizes. Common
resolutions include 1920×1080 (Full HD) and
3840×2160 (4K).
Pixel values determine the color and brightness of
each pixel. In grayscale images, values typically range
from 0 (black) to 255 (white), with values in between
representing different shades of gray.
Color Representations
Grayscale Images use a single channel with values
from 0-255, perfect for tasks where color isn't
necessary, reducing computational complexity.
RGB Images use three channels (Red, Green, Blue),
each with values from 0-255. Combining these
channels creates millions of possible colors, enabling
full-color photography and displays.
Statistical Analysis: Core Concepts
Statistics provides the mathematical foundation for understanding and interpreting data. These concepts are
essential for data science, machine learning, and making informed decisions based on information.
1 2
Descriptive Statistics Data Visualization
Measures that summarize data: mean (average), Graphical representations like histograms, scatter
median (middle value), mode (most frequent), and plots, and box plots that reveal patterns and
standard deviation (spread of data). relationships in your data.
3 4
Correlation & Causation Probability Distributions
Understanding how variables relate to each other Mathematical functions describing how data
and distinguishing between mere association and values are distributed, including normal (bell
actual cause-effect relationships. curve), uniform, and binomial distributions.
These fundamental concepts enable you to extract meaningful insights from raw data, identify trends, and make
predictions based on statistical evidence.
Orange Data Mining Tool
Orange is a powerful, visual programming tool for data analysis,
machine learning, and data mining. Its intuitive drag-and-drop
interface makes it perfect for beginners while offering advanced
capabilities for experienced users.
Key Features
Visual workflow design with pre-built widgets
Interactive data visualization and exploration
Machine learning algorithms without coding
Real-time data analysis and model evaluation
Add-ons for specialized domains like bioinformatics and text
mining
01 02
Load Data Explore & Visualize
Import datasets from files, databases, or URLs Use charts and plots to understand patterns
03 04
Preprocess Model & Evaluate
Clean and transform data for analysis Apply algorithms and assess performance
AI Project Cycle in Orange
The AI project cycle provides a structured approach to solving problems with machine learning. Orange's visual
interface makes each phase accessible and intuitive for learners.
Problem Definition
Identify the question you want to answer or the problem you want to solve with AI.
Data Acquisition
Collect relevant datasets that will help train your model effectively.
Data Exploration
Analyze data characteristics, identify patterns, and prepare for modeling.
Modeling
Select and train appropriate machine learning algorithms on your data.
Evaluation
Test model performance and refine until results meet your requirements.
Python Basics: Input,
Output & Math
Let's start your Python journey with fundamental programs that handle
user input, perform calculations, and display results. These building
blocks are essential for every programmer.
Basic Calculator
# Add two numbers
num1 = float(input("First number: "))
num2 = float(input("Second number: "))
print(f"Sum: {num1 + num2}")
print(f"Difference: {num1 - num2}")
print(f"Product: {num1 * num2}")
Rectangle Area Calculator
# Calculate area of rectangle
length = float(input("Enter length: "))
width = float(input("Enter width: "))
area = length * width
print(f"Area: {area} square units")
These simple programs demonstrate how to accept user input with
input(), convert strings to numbers with float(), perform calculations, and
display formatted output with print().
Control Flow: Conditions & Loops
Conditional Statements Loops for Repetition
Make decisions in your code based on conditions: Execute code multiple times efficiently:
# Check number sign # Multiplication table
num = int(input("Enter a number: ")) num = int(input("Enter number: "))
if num > 0: for i in range(1, 11):
print("Positive") print(f"{num} × {i} = {num * i}")
elif num < 0:
print("Negative") # Print first n natural numbers
else: n = int(input("How many numbers? "))
print("Zero") for i in range(1, n + 1):
print(i, end=" ")
# Leap year checker
year = int(input("Enter year: ")) # Print even numbers
if (year % 4 == 0 and year % 100 != 0) or (year % 400 for i in range(2, n + 1, 2):
== 0): print(i, end=" ")
print(f"{year} is a leap year")
else:
print(f"{year} is not a leap year")
Functions, Strings & Lists
Functions help organize code into reusable blocks, while strings and lists allow you to work with text and
collections of data effectively.
Functions String Operations Working with Lists
def simple_interest(principal, # Count vowels in string # Student names
rate, time): text = input("Enter a string: ") students = []
"""Calculate simple vowels = "aeiouAEIOU" n = int(input("Number of
interest""" count = 0 students: "))
interest = (principal * rate for char in text: for i in range(n):
* time) / 100 if char in vowels: name = input(f"Student
return interest count += 1 {i+1} name: ")
print(f"Number of vowels: [Link](name)
# Usage {count}")
p = float(input("Principal: ")) print("\nClass roster:")
r = float(input("Rate: ")) for name in students:
t = float(input("Time (years): print(f"- {name}")
"))
si = simple_interest(p, r, t)
print(f"Simple Interest:
${si:.2f}")
NumPy & Matplotlib Visualization
NumPy provides powerful array operations for numerical computing, while Matplotlib enables you to create
professional visualizations of your data.
NumPy Arrays Data Visualization
import numpy as np import [Link] as plt
# Create array from 1 to 20 # Patient temperature over time
arr = [Link](1, 21) days = [1, 2, 3, 4, 5, 6, 7]
print(f"Array: {arr}") temp = [98.6, 99.1, 100.2, 101.5,
100.8, 99.5, 98.8]
# Perform operations
print(f"Sum: {[Link](arr)}") [Link](days, temp, marker='o',
print(f"Average: {[Link](arr)}") color='#1B54DA')
print(f"Max: {[Link](arr)}") [Link]('Day')
print(f"Min: {[Link](arr)}") [Link]('Temperature (°F)')
[Link]('Patient Temperature Over Time')
# Array operations [Link](True, alpha=0.3)
squared = arr ** 2 [Link]()
print(f"Squared: {squared}")
These libraries transform raw numbers into insights. NumPy's efficient array operations handle large datasets
quickly, while Matplotlib turns your data into clear, compelling visualizations that communicate findings
effectively.