Ask Your Question
0

Difference between thresholding function

asked 2016-02-15 11:22:01 -0500

Dr Dre gravatar image

updated 2016-02-15 11:33:00 -0500

Hi Guys

I have two set of codes for thresholding

Code 1

import cv2
import numpy as np

Image = cv2.imread('blue.jpg')

Threshold = np.zeros(Image.shape, np.uint8)
cv2.threshold(Image, 121, 255, cv2.THRESH_BINARY, Threshold)
cv2.imshow("WindowName", Threshold )

cv2.waitKey(0)
cv2.destroyAllWindows()

and

Code 2

 import cv2
import numpy as np

Image = cv2.imread('blue.jpg')


ret, thresh = cv2.threshold(Image, 121, 255, cv2.THRESH_BINARY)
cv2.imshow("WindowName", thresh )

cv2.waitKey(0)
cv2.destroyAllWindows()

What is the difference between these two thresh functions

edit retag flag offensive close merge delete

Comments

1

There shouldn't be a difference in the resulting image. You have two possibilities in python to call the function. Do you see any differences?

FooBar gravatar imageFooBar ( 2016-02-15 13:06:09 -0500 )edit

output image has no difference. but there is little bit change in syntax

Dr Dre gravatar imageDr Dre ( 2016-02-15 18:46:50 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-02-26 08:30:27 -0500

Dr Dre gravatar image

Figured out that both are same

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-02-15 11:22:01 -0500

Seen: 116 times

Last updated: Feb 26 '16