summaryrefslogtreecommitdiff
path: root/macros/roifill.sci
blob: b69288a56a57feed8d0f37b3c32a961c981872a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function new_image = roifill(image, mask_orig, varargin)
	
	[ lhs, rhs ] = argn(0)
	
	if rhs < 2 then
		error(msprintf("Too less input arguments"))
	elseif rhs > 3 then
		error(msprintf("Too many input arguments"))
	end
	
	
	image_list = mattolist(image)
	
	
	select rhs
		case 2
			out = opencv_roifill(image_list, mask_orig)
		
		case 3
			out = opencv_roifill(image_list, mask_orig, varargin(1))
	end
	
	sz = size(out)
	for i=1 : sz
		new_image(:, :, i) = out(i)
	end 
	
endfunction