# Problem 60551. Jigsaw 002: Intro 2x2 square. Local Cody images

This challenge is to re-assemble camerman.tif and other grayscale images from four 128x128 pieces into a 256x256 image. The proposed method is best fitting edges to line m=1 and b=0 for 100, 90, and 80 percentiles.
Jigsaw001 was to show how data fitting can achieve results but is not a good general method. Tim used an elegant anonymous function of f=@(u)norm(diff(u))/std(mean(u)); along with a couple other methods incorporated into Jigsaw002.
Jigsaw is similar to the real world task of In-Scene-Calibration of a scanning sensor which was best solved by smoothing and usage of RobustFit. The template tries to simulate robustfit with edge smoothing to account for gradients
The pointer layout of the image is [1 3; 2 4]. Return a four value vector that remaps the scrambled image into an original form. The displayed scramble is [2 4 1 3] making the solution [3 1 4 2].The four pieces will be provided as matrices in a cell array, along with size of puzzle in pieces and piece size.
Assertion is adjacent Chan and Row pairs will best match m=1 and b=0 for 100P,90P,80P of error.
Using 100/90/80p gives 88% of chans having >95% valid adjacent channel determination. Using 90/70/50p gives 93% of chans having >95% valid adjacent channel determination. Bordered images fail spectacularly.
Scoring function 10*abs(m-1)+abs(b/10) used at 100/90/80p with 4 out of 6 voting to determine best. Tie 3/3 leads to a best mean comparison.
Separation of Vertical and Horizontal performances is consequential. This was also gleaned from Tim.

### Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Jun 30, 2024

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!