Ask Your Question
0

I get all features 0, i.e., hist in my example program are all 0.0

asked 2017-12-12 05:09:35 -0500

aibrain gravatar image

updated 2017-12-13 00:55:08 -0500

import cv2

image = cv2.imread("D:\\skhan\\research\\data\\face\\test.2.jpg",cv2.IMREAD_COLOR)
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
winSize = (64,64)
blockSize = (16,16)
blockStride = (8,8)
cellSize = (8,8)
nbins = 9
derivAperture = 1
winSigma = 4.0
histogramNormType = 0
L2HysThreshold = 2.0000000000000001e-0
gammaCorrection = 0
nlevels = 64
hog=cv2.HOGDescriptor(winSize,blockSize,blockStride,cellSize,nbins,derivAperture,winSigma,histogramNormType,L2HysThreshold,gammaCorrection,nlevels)
winStride = (8,8)
padding = (8,8)
locations = ((10,20),)
hist = hog.compute(image,winStride,padding,locations)

image description

edit retag flag offensive close merge delete

Comments

1

can you try again with the formatting ? (there is a "10101" button for that)

also, seing your image would be helpful.

berak gravatar imageberak ( 2017-12-12 05:16:53 -0500 )edit

@eshirima, -- heroic job at reformatting !

berak gravatar imageberak ( 2017-12-12 15:05:27 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-12-13 03:53:32 -0500

supra56 gravatar image

updated 2017-12-13 04:18:37 -0500

berak gravatar image

Remove comma

locations = ((10,20),)
to
locations = ((10,20))
edit flag offensive delete link more

Comments

supra: TypeError: locations

berak gravatar imageberak ( 2017-12-13 04:28:33 -0500 )edit

tried, it gives an error.

aibrain gravatar imageaibrain ( 2017-12-14 10:02:33 -0500 )edit

@albrain, the positions list acts like a mask, use an empty one, like:

locations = ()
berak gravatar imageberak ( 2017-12-14 10:26:08 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-12-12 05:09:35 -0500

Seen: 70 times

Last updated: Dec 13 '17