def test_normal_mode():
 img = data.coins()
 keypoints = corner_peaks(corner_harris(img), min_distance=5, threshold_abs=0, threshold_rel=0.1)
 extractor = BRIEF(descriptor_size=8, sigma=2)
 extractor.extract(img, keypoints[:8])
 expected = np.array([[False, True, False, False, True, False, True, False], [True, False, True, True, False, True, False, False], [True, False, False, True, False, True, False, True], [True, True, True, True, False, True, False, True], [True, True, True, False, False, True, True, True], [False, False, False, False, True, False, False, False], [False, True, False, False, True, False, True, False], [False, False, False, False, False, False, False, False]], dtype=bool)
 assert_array_equal(extractor.descriptors, expected)

def test_normal_mode ( ) : img = data . coins ( ) keypoints = corner_peaks ( corner_harris ( img ) , min_distance = 5 , threshold_abs = 0 , threshold_rel = 0.1 ) extractor = BRIEF ( descriptor_size = 8 , sigma = 2 ) extractor . extract ( img , keypoints [ : 8 ] ) expected = np . array ( [ [ False , True , False , False , True , False , True , False ] , [ True , False , True , True , False , True , False , False ] , [ True , False , False , True , False , True , False , True ] , [ True , True , True , True , False , True , False , True ] , [ True , True , True , False , False , True , True , True ] , [ False , False , False , False , True , False , False , False ] , [ False , True , False , False , True , False , True , False ] , [ False , False , False , False , False , False , False , False ] ] , dtype = bool ) assert_array_equal ( extractor . descriptors , expected )
verify the computed brief descriptors with expected for normal mode .