Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
image processing
  • Loading branch information
redashu authored Jun 22, 2018
1 parent 6051c0d commit 8708cc0
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
19 changes: 19 additions & 0 deletions camera_take.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/python

import cv2

# to start web or external web camera
capture=cv2.VideoCapture(0)


if capture.isOpened() :
print "camera is ready to take picture"
# current camera data , after frame take camera status
frame,status=capture.read()
cv2.imshow("framm1",frame)
cv2.waitKey(0)
capture.release()
else :
print "check your camera drivers with OS"


39 changes: 39 additions & 0 deletions image_action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/python

import cv2
# all functions of cv2 that is opencv model
#print dir(cv2)

# reading image
# image name , imaeg features
# we can write cv2.IMREAD_COLOR instead of 1
# we can write cv2.IMREAD_BGR2GRAY instead of 0
# we can write cv2.IMREAD_UNCHANGE_COLOR instead of -1

img=cv2.imread("dog1.jpeg")
# to draw a line im dog image
# imagedata , start point , end point , color , line width
cv2.line(img,(0,0),(100,100),(100,120,255),3)
#
cv2.rectangle(img,(20,20),(100,100),(255,255,255),-1)
cv2.circle(img,(100,100),30,(12,45,200),-1)
# deciding font type
#font=cv2.FONT_HERSHEY_SIMPLEX
# putting text in image
# data, text , starting point , fontype , size , color
#cv2.putText(img,"DOGGG",(10,10),font,3,(100,23,200),lineType=cv2.LINE_AA)
cv2.imshow("lineimg",img)
cv2.imwrite("dogline.jpeg",img)
cv2.waitKey(0)












30 changes: 30 additions & 0 deletions image_process.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/python

import cv2
# all functions of cv2 that is opencv model
#print dir(cv2)

# reading image
# image name , imaeg features
# we can write cv2.IMREAD_COLOR instead of 1
# we can write cv2.IMREAD_BGR2GRAY instead of 0
# we can write cv2.IMREAD_UNCHANGE_COLOR instead of -1

img=cv2.imread("dog1.jpeg",1)
img1=cv2.imread("dog1.jpeg",0)
img2=cv2.imread("dog1.jpeg",-1)
# checking rows and cols
print img.shape
print img1.shape
# to show original data of image
print img
# to show images
cv2.imshow("windowname",img)
cv2.imshow("bwimg",img1)
cv2.imshow("newok",img2)

# save black and white (GRAY) image
cv2.imwrite("bac.jpeg",img1)

# to hold upper window
cv2.waitKey(0)
25 changes: 25 additions & 0 deletions image_read.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/python2

import cv2

# laoding image
img=cv2.imread('dog1.jpeg')
img1=cv2.imread('dog1.jpeg',0)

# Print height and width
print img.shape

# to display that image
cv2.imshow("dog",img)
cv2.imshow("dognew",img1)

# image window holder activate
cv2.waitKey(0)
# waitkey will destroy by using q button
cv2.destroyAllWindows()






0 comments on commit 8708cc0

Please sign in to comment.