(hist1, hist2)
| 10 | from imagepy.core.manager import ImageManager |
| 11 | |
| 12 | def like(hist1, hist2): |
| 13 | hist1 = np.cumsum(hist1)/hist1.sum() |
| 14 | hist2 = np.cumsum(hist2)/hist2.sum() |
| 15 | hist = np.zeros(256, dtype=np.uint8) |
| 16 | i1, i2, s = 0, 0, 0 |
| 17 | while i2<256: |
| 18 | while i1<256 and hist2[i2]>hist1[i1]:i1+=1 |
| 19 | hist[i2] = i1 |
| 20 | i2+=1 |
| 21 | return hist |
| 22 | |
| 23 | def match(img1, img2): |
| 24 | if img1.ndim == 2: |