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 setup.sh for installation : Issue #129 Fixed #130

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,39 @@ This repository includes basics to :
## Installation Instructions

OpenCV library and other dependency needs to be installed on your system, so follow these steps of installation:
I'll fix the Markdown formatting in your README.md file to make it clearer and more consistent.
SanyamGarg12 marked this conversation as resolved.
Show resolved Hide resolved

* Clone SRA-VJTI's Pixel Repository on your system


# Installation Guide
SanyamGarg12 marked this conversation as resolved.
Show resolved Hide resolved

## Clone SRA-VJTI's Pixel Repository
SanyamGarg12 marked this conversation as resolved.
Show resolved Hide resolved
```sh
git clone https://github.com/SRA-VJTI/Pixels_Seminar.git
```
```

* Change terminal directory inside the cloned repository
## Change Directory
SanyamGarg12 marked this conversation as resolved.
Show resolved Hide resolved
```sh
cd Pixels_Seminar
```
* Run the installation script

## Run Installation Script
Choose one of the following options:

### Option 1 - using make command
```sh
make install
```

Installation is done successfully.
### Option 2 - using bash script
- Giving permission to execute.
```sh
chmod +x setup.sh
```
- Executing script
```sh
./setup.sh
```

After completing these steps, the installation should be successful.

26 changes: 26 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Check if OpenCV is installed
echo "Checking if OpenCV is installed..."
if pkg-config --exists opencv4 sdl2; then
echo "OpenCV is installed"
else
echo "OpenCV is not installed"
echo "Installing OpenCV..."

# Detect OS and install dependencies accordingly
if grep -qi "debian" /etc/os-release; then
echo "Detected Debian-based system"
sudo apt-get update -y
sudo apt-get install libopencv-dev libsdl2-2.0-0 libsdl2-image-dev libsdl2-dev -y
SanyamGarg12 marked this conversation as resolved.
Show resolved Hide resolved
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Detected macOS"
brew install opencv sdl2
elif grep -qi "arch" /etc/os-release; then
echo "Detected Arch Linux"
sudo pacman -Sy opencv hdf5 glew vtk fmt sdl2
else
echo "Unknown OS, cannot install OpenCV"
exit 1
fi
fi