1
- import { ImageColorModel , overlapImages } from '../..' ;
1
+ import { overlapImages } from '../..' ;
2
2
import { alignMinDifference } from '../alignMinDifference' ;
3
3
4
4
test ( '1 pixel source' , ( ) => {
@@ -29,9 +29,9 @@ test('4 pixels source', () => {
29
29
} ) ;
30
30
31
31
test ( 'twice same image' , ( ) => {
32
- const source = testUtils . load ( 'opencv/test.png' ) ;
32
+ const source = testUtils . load ( 'opencv/test.png' ) . grey ( ) ;
33
33
34
- const destination = testUtils . load ( 'opencv/test.png' ) ;
34
+ const destination = testUtils . load ( 'opencv/test.png' ) . grey ( ) ;
35
35
36
36
const result = alignMinDifference ( source , destination ) ;
37
37
expect ( result ) . toStrictEqual ( { row : 0 , column : 0 } ) ;
@@ -56,9 +56,7 @@ test('source too big', () => {
56
56
test ( 'larger image and crop' , ( ) => {
57
57
const side = 100 ;
58
58
const origin = { row : 30 , column : 30 } ;
59
- const destination = testUtils
60
- . load ( 'ssim/ssim-original.png' )
61
- . convertColor ( ImageColorModel . RGB ) ;
59
+ const destination = testUtils . load ( 'ssim/ssim-original.png' ) ;
62
60
const source = destination . crop ( { origin, width : side , height : side } ) ;
63
61
64
62
const result = alignMinDifference ( source , destination ) ;
@@ -69,9 +67,7 @@ test('larger image and crop', () => {
69
67
test ( 'larger image and crop 2' , ( ) => {
70
68
const side = 100 ;
71
69
const origin = { row : 50 , column : 100 } ;
72
- const destination = testUtils
73
- . load ( 'ssim/ssim-original.png' )
74
- . convertColor ( ImageColorModel . RGB ) ;
70
+ const destination = testUtils . load ( 'ssim/ssim-original.png' ) ;
75
71
const source = destination . crop ( { origin, width : side , height : side } ) ;
76
72
77
73
const result = alignMinDifference ( source , destination ) ;
@@ -80,8 +76,8 @@ test('larger image and crop 2', () => {
80
76
} ) ;
81
77
82
78
test ( 'id crops' , ( ) => {
83
- const destination = testUtils . load ( 'align/cropped.png' ) ;
84
- const source = testUtils . load ( 'align/croppedRef.png' ) ;
79
+ const destination = testUtils . load ( 'align/cropped.png' ) . grey ( ) ;
80
+ const source = testUtils . load ( 'align/croppedRef.png' ) . grey ( ) ;
85
81
86
82
const result = alignMinDifference ( source , destination ) ;
87
83
@@ -91,8 +87,8 @@ test('id crops', () => {
91
87
} ) ;
92
88
93
89
test ( 'other id crops' , ( ) => {
94
- const destination = testUtils . load ( 'align/cropped1.png' ) ;
95
- const source = testUtils . load ( 'align/croppedRef1.png' ) ;
90
+ const destination = testUtils . load ( 'align/cropped1.png' ) . grey ( ) ;
91
+ const source = testUtils . load ( 'align/croppedRef1.png' ) . grey ( ) ;
96
92
const result = alignMinDifference ( source , destination ) ;
97
93
98
94
const overlap = overlapImages ( source , destination , { origin : result } ) ;
0 commit comments