-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
image processing
- Loading branch information
Showing
4 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
|
||
|
||
|
||
|
||
|
||
|