Go to Post I have no clue. All I know is that every year the riddle in the clue has confused me but this year it is the lack of confusion that confuses me. - hallk [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 09-05-2016, 02:21
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: OpenCV: findContours() messing with images?

Quote:
Originally Posted by OpenCV Docs
If you want to keep the unmodified image, create a copy before calling findContours:

Code:
import cv2 as cv
import numpy as np
img = cv.imread("29.jpg")#Sample image of Field
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) #Convert to gray...just to try

edges = cv.Canny(gray, 200, 300)
#Finds the contours
scratch = edges.copy()
image, contours, hierarchy = cv.findContours(scratch,cv.RETR_EXTERNAL,cv.CHAIN_APPROX_NONE)
#Draws
cv.drawContours(img, contours, 1, (0, 255,255), 3)
#Shows
cv.imshow("edges!", edges)
cv.imshow("mask!", gray)
cv.imshow("frame!", img)

k = cv.waitKey(0) 
cv.destroyAllWindows()
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 23:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi