Hello everyone, I hope someone can help me,
My program is to build a puzzle, regardless of the order in which the piece is read, I am trying to do a test, with the images of each segmented piece, for example I have two images, one is from piece 1 and piece 2 out of a total of 12 pieces, that is 12 positions, I want them to be detected (I am trying to do so with an if but I don't know what arguments to add to read an image) are added to my background (A matrix of zeros ), this is my code.
P1 = imread ([path, '/ Piece1.jpg']);
P2 = imread ([path, '/ Piece2.jpg']);
[r, c, n] = size (P1);
matchs = zeros (r, c, n, 'uint8');
for i = 1: r
for j = 1: c
matchs (i, j,:) = P1 (i, j,:) + P2 (i, j, :);
figure, imshow (matchs)
This works to add images
but I want the program through some cycle to say if it is piece 1, if piece 2 is added, regardless of the order, and the puzzle is built.