Skip to content

Commit

Permalink
Change location of files
Browse files Browse the repository at this point in the history
  • Loading branch information
toshan-luktuke committed Aug 26, 2022
1 parent dca3eee commit 52888d5
Show file tree
Hide file tree
Showing 60 changed files with 1,733 additions and 890 deletions.
16 changes: 16 additions & 0 deletions blockDocs/Blocks/Blur.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,22 @@ <h1>Block Description</h1>

<p>Outputs the blurred image through the <code>share_image()</code> function</p>
</div>

<div class="docstring">
<h2> Example Usage </h2>
<img src="../assets/bulr-usage.png" width="80%" height="70%" />
<h3> Output </h3>
<table>
<tr>
<th>Normal</th>
<th>After Median Blur</th>
</tr>
<tr>
<td><img src="../assets/lenna.png"/></td>
<td><img src="../assets/lenna-blur.png"/></td>
</tr>
</table>
</div>



Expand Down
46 changes: 0 additions & 46 deletions blockDocs/search.js

This file was deleted.

6 changes: 6 additions & 0 deletions Blocks/Blur.py → docs/Blocks/Blur.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ def main(inputs, outputs, parameters, synchronise):
It is enabled by default but can be disabled by passing in 0 through the enable wire.
Outputs the blurred image through the `share_image()` function
**Inputs**: BGR Image
**Outputs**: BGR Image
**Parameters**: BlurType
"""
# Blur Type
blur_type : str = parameters.read_string("BlurType")
Expand Down
6 changes: 6 additions & 0 deletions Blocks/Camera.py → docs/Blocks/Camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ def main(inputs, outputs, parameters, synchronise):
`while` loop is the part of the program that is executed continuously.
It is enabled by default but can be disabled by passing in 0 through the enable wire.
**Inputs**: None
**Outputs**: BGR Image
**Parameters**: None
'''
cap = cv2.VideoCapture(0)
auto_enable = False
Expand Down
6 changes: 6 additions & 0 deletions Blocks/ColorFilter.py → docs/Blocks/ColorFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ def main(inputs, outputs, parameters, synchronise):
Here the image is tranformed from `BGR` to `HSV` and then the filter is applied through the `cv2.inRange()`
function. Finally the filtered image is overlayed on the orignal by the means of the
`cv2.bitwise_and()` function. This filtered image is then shared through the `share_image()` function.
**Inputs**: BGR Image
**Outputs**: BGR Image
**Parameters**: LowerHSV, UpperHSV
'''
lower_rgb = np.array([int(x.strip()) for x in parameters.read_string('LowerRGB').split(',')])
upper_rgb = np.array([int(x.strip()) for x in parameters.read_string('UpperRGB').split(',')])
Expand Down
6 changes: 6 additions & 0 deletions Blocks/ContourDetector.py → docs/Blocks/ContourDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ def main(inputs, outputs, parameters, synchronise):
It is enabled by default but can be disabled by passing in 0 through the enable wire.
[Further reading](https://docs.opencv.org/4.x/d4/d73/tutorial_py_contours_begin.html)
**Inputs**: BGR Image
**Outputs**: Array [x, y, width, height, angle of rotation], BGR Image
**Parameters**: None
'''
auto_enable = False
try:
Expand Down
6 changes: 6 additions & 0 deletions Blocks/Cropper.py → docs/Blocks/Cropper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ def main(inputs, outputs, parameters, synchronise):
`while` loop is the part of the program that is executed continuously.
It is enabled by default but can be disabled by passing in 0 through the enable wire.
Output is shared via `share_image()`
**Inputs**: BGR Image
**Outputs**: Resized BGR Image
**Parameters**: x, y, width, height
'''
x, y, w, h = np.array([int(x.strip()) for x in parameters.read_string("xywh").split(",")])

Expand Down
6 changes: 6 additions & 0 deletions Blocks/Dilation.py → docs/Blocks/Dilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ def main(inputs, outputs, parameters, synchronise):
Finaly we convert from `GRAY` back to `BGR` and output the image through the `share_image()` function.
[Further reading](https://docs.opencv.org/4.x/d9/d61/tutorial_py_morphological_ops.html)
**Inputs**: BGR Image
**Outputs**: BGR Image
**Parameters**: Kernel, Iterations
'''
kernel = np.array([int(x.strip()) for x in parameters.read_string("Kernel").split(",")])
kernel = np.ones(kernel, np.uint8)
Expand Down
6 changes: 6 additions & 0 deletions Blocks/EdgeDetector.py → docs/Blocks/EdgeDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ def main(inputs, outputs, parameters, synchronise):
`cv2.Canny()` function. The resulting image is then converted back to `BGR`.
This image is then shared to the wire via the `share_image()` function.
**Inputs**: BGR Image
**Outputs**: BGR Image
**Parameters**: Lower, Upper (Threshold values)
'''
lower = int(parameters.read_string("Lower"))
upper = int(parameters.read_string("Upper"))
Expand Down
6 changes: 6 additions & 0 deletions Blocks/Erosion.py → docs/Blocks/Erosion.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ def main(inputs, outputs, parameters, synchronise):
Finaly we convert from `GRAY` back to `BGR` and output the image through the `share_image()` function.
[Further reading]([Further reading](https://docs.opencv.org/4.x/d9/d61/tutorial_py_morphological_ops.html))
**Inputs**: BGR Image
**Outputs**: BGR Image
**Parameters**: Kernel, Iterations
'''
kernel = np.array([int(x.strip()) for x in parameters.read_string("Kernel").split(",")])
kernel = np.ones(kernel, np.uint8)
Expand Down
6 changes: 6 additions & 0 deletions Blocks/FaceDetector.py → docs/Blocks/FaceDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ def main(inputs, outputs, parameters, synchronise):
a face is detected. Image is shared through the `share_image()` function.\n
Else if `box` is given, the output is the co-ordinates of the bounding box in the form of an array. It
is chared through the `share_array()` function.
**Inputs**: BGR Image
**Outputs**: BGR Image with Bounding Boxes
**Parameters**: BoxOrImage ('box' for Bounding Boxes, 'image' for Image with Detections)
'''
choice = parameters.read_string("BoxOrImage")

Expand Down
8 changes: 7 additions & 1 deletion Blocks/IMU.py → docs/Blocks/IMU.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def callback(msg):
We convert these radian values to degrees to get the orientation of the body.
Aside from these values the IMU also gives us the angular velocity of the body.\n
All of these values are stored in the global data variable of the block.
All of these values are stored in the global `data` variable of the block.
'''
global data
# Get the orientation list from the IMU sensor
Expand All @@ -40,6 +40,12 @@ def main(inputs, outputs, parameters, synchronise):
This data is sent to the callback function which converts the orientation list obtained into roll, pitch and yaw for the
robot that the IMU is present on. Alongwith orientation, it also gives the angular velocity of the robot.
This data is shared in the form of an array using the `share_array()` function.
**Inputs**: None
**Outputs**: Array [Roll, Pitch , Yaw, Angular Velocity in X, Angular Velocity in Y, Angular Velocity in Z]
**Parameters**: ROSTopic
'''
global data
auto_enable = False
Expand Down
6 changes: 6 additions & 0 deletions Blocks/ImageRead.py → docs/Blocks/ImageRead.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ def main(inputs, outputs, parameters, synchronise):
This box reads an image from a given file path. The path to be specified is written in the parameter
`ImagePath`.\n
It is read through the `cv2.imread()` function and shared through the `share_image()` function.
**Inputs**: None
**Outputs**: BGR Image
**Parameters**: ImagePath
'''
path = parameters.read_string("ImagePath")
image = cv2.imread(path)
Expand Down
6 changes: 6 additions & 0 deletions Blocks/MotorDriver.py → docs/Blocks/MotorDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ def main(inputs, outputs, parameters, synchronise):
This data is then converted into a Twist() message with the `linear.x = linear_velocity` and `angular.z = angular_velocity`
The data is then published continuously
**Inputs**: `cmd_vel` (Linear Velocity, Angular Velocity)
**Outputs**: None
**Parameters**: ROSTopic
'''
rospy.init_node("motordriverVC", anonymous=True)

Expand Down
6 changes: 6 additions & 0 deletions Blocks/ObjectDetector.py → docs/Blocks/ObjectDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ def main(inputs, outputs, parameters, synchronise):
tag to it, a bounding box is also drawn over it.
This image is then shared to the output wire using the `share_image()` function.
**Inputs**: BGR Image
**Outputs**: BGR Image with Bounding Boxes
**Parameters**: None
'''
auto_enable = True
try:
Expand Down
6 changes: 6 additions & 0 deletions Blocks/Odometer.py → docs/Blocks/Odometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ def main(inputs, outputs, parameters, synchronise):
It then initializes a Subscriber to subscribe to that ROSTopic, once the data is obtained through the callback
function, it is formatted into an array with the format: `[ x, y, yaw ]`\n
This data is then shared to the wire using the `share_array()` function.
**Inputs**: None
**Outputs**: Array [X, Y, Yaw]
**Parameters**: ROSTopic
'''
rospy.init_node("odometerVC", anonymous=True)
rostopic_name = parameters.read_string("ROSTopic")
Expand Down
6 changes: 6 additions & 0 deletions Blocks/PID.py → docs/Blocks/PID.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ def main(inputs, outputs, parameters, synchronise):
Once there it applies the PID technique to the error variable in order to minimize it.
The resulting values are shared through the `share_array()` function.
**Inputs**: Error
**Outputs**: `cmd_vel` (Linear Velocity, Angular Velocity)
**Parameters**: Kp, Ki, Kd
'''
auto_enable = True
try:
Expand Down
6 changes: 6 additions & 0 deletions Blocks/ROSCamera.py → docs/Blocks/ROSCamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ def main(inputs, outputs, parameters, synchronise):
The image message is converted to OpenCV compatible format via the `imgmsg_to_cv2()` function.
This is then shared ahead using the `share_image()` function.
**Inputs**: None
**Outputs**: BGR Image
**Parameters**: ROSTopic
'''
auto_enable = False
try:
Expand Down
6 changes: 6 additions & 0 deletions Blocks/Screen.py → docs/Blocks/Screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ def main(inputs, outputs, parameters, synchronise):
Takes an image as an input and displays it on the user's screen.
The `cv2.imshow()` function is used in order to display the image.
**Inputs**: BGR Image
**Outputs**: None
**Parameters**: None
'''
auto_enable = False
try:
Expand Down
6 changes: 6 additions & 0 deletions Blocks/Teleoperator.py → docs/Blocks/Teleoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ def main(inputs, outputs, parameters, synchronise):
The output data is a list of the format: `[ linear_velocity, angular_velocity ]`\n
This is then shared to the output wire using the `share_array()` function.
**Inputs**: Bounding Box (x, y, width, height)
**Outputs**: `cmd_vel` (linear velocity, angular velocity)
**Parameters**: Linear(Linear Velocity)
'''
auto_enable = True
try:
Expand Down
6 changes: 6 additions & 0 deletions Blocks/Threshold.py → docs/Blocks/Threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ def main(inputs, outputs, parameters, synchronise):
`share_image()` function.
[Further reading](https://docs.opencv.org/4.x/d7/d4d/tutorial_py_thresholding.html)
**Inputs**: BGR Image
**Outputs**: BGR Image
**Parameters**: LowerThreshold, UpperThreshold
'''
lower = parameters.read_number("LowerThreshold")
upper = parameters.read_number("UpperThreshold")
Expand Down
6 changes: 6 additions & 0 deletions Blocks/VideoStreamer.py → docs/Blocks/VideoStreamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ def main(inputs, outputs, parameters, synchronise):
Capturing begins using the `cv2.VideoCapture()` function.
The video is then read frame by frame and each frame is shared to the output wire using the
`share_image()` function.
**Inputs**: None
**Outputs**: BGR Image
**Parameters**: PathToFile
'''
filepath = parameters.read_string("PathToFile")
auto_enable = False
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}

%}
{% set parent = 'docCode' %}
{% set parent = 'Blocks' %}

{% block body %}
{% set currentblock = module.modulename.split(".")[-1].replace("%20", "") %}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions docs/_pages/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ sidebar:

## Project

### New Documentation
To access the new documentation, visit this link. [Visual Circuit 3.x Block Documentation](/blockDocs/index.html)

### Definition

Version: 1.0.
Expand Down
Loading

0 comments on commit 52888d5

Please sign in to comment.