Ask Your Question

how to find glcm of an image in OpenCV or numpy?

asked 2013-10-23 22:56:29 -0600

raj8 gravatar image

I have to find texture based features of an image like correlation,energy,homogeneity,contrast in python. i am using python-opencv to do other operations.since python opencv returns image as an numpy array.but i don't found any good resource to find glcm using either opencv or numpy. also the i have to extract feature for d=1 and angle=[0,45,135,90] and then use this feature in svm.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-10-24 00:50:56 -0600

Immi gravatar image

Implement your own GLCM algorithm. You have:

  1. Get the value of the actual pixel and its neighbour
  2. Take those two values to adress the pixel in the GLCM-image
  3. Increment that chosen pixel
edit flag offensive delete link more


thank you :)

raj8 gravatar imageraj8 ( 2013-10-24 02:21:52 -0600 )edit

I hope it will help you.

Immi gravatar imageImmi ( 2013-10-24 02:56:01 -0600 )edit

answered 2013-10-25 08:05:51 -0600

raj88 gravatar image
edit flag offensive delete link more

Question Tools


Asked: 2013-10-23 22:56:29 -0600

Seen: 6,653 times

Last updated: Oct 25 '13