Skip to content

Instantly share code, notes, and snippets.

@Praveen76
Created April 15, 2022 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Praveen76/40b7dff82d603ee95645f98381a54759 to your computer and use it in GitHub Desktop.
Save Praveen76/40b7dff82d603ee95645f98381a54759 to your computer and use it in GitHub Desktop.
img=cv.imread('D:\park.jpg')
cv.imshow('park',img)
gray=cv.cvtColor(img,cv.COLOR_BGR2GRAY)
cv.imwrite('gray_park.jpg',gray)
cv.imshow('gray park',gray)
#BGR to HSV
HSV=cv.cvtColor(img,cv.COLOR_BGR2GRAY)
cv.imwrite('HSV_park.jpg',HSV)
cv.imshow('HSV park',HSV)
#BGR to LAB
LAB=cv.cvtColor(img,cv.COLOR_BGR2LAB)
cv.imwrite('LAB_park.jpg',LAB)
cv.imshow('LAB park',LAB)
#BGR to RGB
RGB=cv.cvtColor(img,cv.COLOR_BGR2RGB)
cv.imwrite('RGB_park.jpg',RGB)
cv.imshow('RGB park',RGB)
cv.waitkey(0)
cv.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment