Home > other >  opencv
opencv

Time:10-07

Histogram. CPP: 153: error: (- 215: an Assertion failed) j & lt; Nimages function in 'CV: : histPrepareImages'
When this problem because what ah?

CodePudding user response:

I also met the same problem, is solved the building Lord, please?
The attached code:
Def transform (img) :
Hist=cv2. CalcHist ([img], [0], None,,8,8 [8], [0255,0,255,0,255]) # each channel is divided into eight groups such as histogram is calculated after
Return hist. Ravel () # will be 8 number of multidimensional x8x8 ZuZhan flat


X=np. Row_stack ([transform (img) for img] in images) # each histogram of the image feature extracting
Train_x=x [train_idx, :)
Test_x=x/test_idx, :