Skip to content

Commit

Permalink
deploy: fd04d36
Browse files Browse the repository at this point in the history
  • Loading branch information
nekiwo committed Oct 8, 2024
1 parent befcf4d commit a1f611e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions dev/PreseasonTraining/OpenCV_ColorSegmentation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,14 @@ <h3>Camera stream<a class="headerlink" href="#camera-stream" title="Permalink to
</pre></div>
</div>
</section>
<section id="showing-image">
<h3>Showing image<a class="headerlink" href="#showing-image" title="Permalink to this heading"></a></h3>
<p>Use the <code class="docutils literal notranslate"><span class="pre">cv.imshow</span></code> function to show image with the first argument corresponding to window title and the second being the frame. Make sure this is inside your while loop so it keeps updating.</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="n">cv</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="s2">&quot;Mask&quot;</span><span class="p">,</span> <span class="n">mask</span><span class="p">)</span>
<span class="n">cv</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="s2">&quot;Feed&quot;</span><span class="p">,</span> <span class="n">final_image</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="numpy-arrays">
<h3>NumPy arrays<a class="headerlink" href="#numpy-arrays" title="Permalink to this heading"></a></h3>
<p>In Python, you can initiate an array using this syntax:</p>
Expand Down Expand Up @@ -395,14 +403,6 @@ <h3>Contours<a class="headerlink" href="#contours" title="Permalink to this head
</pre></div>
</div>
</section>
<section id="showing-image">
<h3>Showing image<a class="headerlink" href="#showing-image" title="Permalink to this heading"></a></h3>
<p>Use the <code class="docutils literal notranslate"><span class="pre">cv.imshow</span></code> function to show image with the first argument corresponding to window title and the second being the frame. Make sure this is inside your while loop so it keeps updating.</p>
<div class="highlight-py notranslate"><div class="highlight"><pre><span></span><span class="n">cv</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="s2">&quot;Mask&quot;</span><span class="p">,</span> <span class="n">mask</span><span class="p">)</span>
<span class="n">cv</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="s2">&quot;Feed&quot;</span><span class="p">,</span> <span class="n">final_image</span><span class="p">)</span>
</pre></div>
</div>
</section>
</section>
</section>

Expand Down Expand Up @@ -474,11 +474,11 @@ <h3>Showing image<a class="headerlink" href="#showing-image" title="Permalink to
<li><a class="reference internal" href="#instructions">Instructions</a></li>
<li><a class="reference internal" href="#importing-packages">Importing packages</a></li>
<li><a class="reference internal" href="#camera-stream">Camera stream</a></li>
<li><a class="reference internal" href="#showing-image">Showing image</a></li>
<li><a class="reference internal" href="#numpy-arrays">NumPy arrays</a></li>
<li><a class="reference internal" href="#converting-frames">Converting frames</a></li>
<li><a class="reference internal" href="#masking">Masking</a></li>
<li><a class="reference internal" href="#contours">Contours</a></li>
<li><a class="reference internal" href="#showing-image">Showing image</a></li>
</ul>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ cap.release()
cv.destroyAllWindows()
```

### Showing image

Use the `cv.imshow` function to show image with the first argument corresponding to window title and the second being the frame. Make sure this is inside your while loop so it keeps updating.

```py
cv.imshow("Mask", mask)
cv.imshow("Feed", final_image)
```

### NumPy arrays

In Python, you can initiate an array using this syntax:
Expand Down Expand Up @@ -111,13 +120,4 @@ To visualize our mask on top of the existing imaage, we can get the countours of
```py
contours, _ = cv.findContours(mask, cv.RETR_EXTERNAL, cv.CHAIN_APPROX_SIMPLE)
cv.drawContours(your_frame, contours, -1, (0, 255, 0), 3)
```

### Showing image

Use the `cv.imshow` function to show image with the first argument corresponding to window title and the second being the frame. Make sure this is inside your while loop so it keeps updating.

```py
cv.imshow("Mask", mask)
cv.imshow("Feed", final_image)
```
Loading

0 comments on commit a1f611e

Please sign in to comment.