Cody

# Problem 2897. Image Series 3 Complementary

Solution 1706239

Submitted on 11 Jan 2019 by HH
• Size: 9
• This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
A=imread('http://www.mathworks.com/matlabcentral/profiles/3374772.jpg'); A=rgb2gray(A); o=[63 63 63 63 63 63 63 63 64 64 63 63 63 63 63 63 63 63 64 64 63 63 63 63 63 63 63 63 64 64 63 63 63 63 63 63 63 63 64 64 63 63 63 63 63 63 63 63 64 64 63 63 63 63 63 63 63 63 64 64 63 63 63 63 63 63 63 63 64 64 63 63 63 63 63 63 63 63 64 64 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62]; assert(isequal(image_complementary(A(1:10,1:10)),o))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In image_complementary (line 2) In ScoringEngineTestPoint1 (line 14) In solutionTest (line 3)]

2   Pass
A=imread('http://www.mathworks.com/matlabcentral/profiles/3374772.jpg'); A=rgb2gray(A); o=[62 62 62 62 62 62 62 63 63 63 63 62 62 62 62 62 62 62 62 62 62 62 63 63 63 63 63 63 63 62 62 62 62 63 63 63 63 63 63 63 62 62 62 62 64 64 64 64 64 64 64 63 63 63 63 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 66 66 66 66 66 66 66 66 66 66 66]; assert(isequal(image_complementary(A(10:20,10:20)),o))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.net.internal.validateCertificateFile (line 10) In matlab.internal.webservices.HTTPConnector/set.CertificateFilename (line 408) In matlab.internal.webservices.HTTPConnector>setProperties (line 687) In matlab.internal.webservices.HTTPConnector (line 150) In openHTTPConnection (line 27) In websave (line 98) In getFileFromURL (line 18) In imread (line 349) In ScoringEngineTestPoint2 (line 1) In solutionTest (line 5)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In websave>validateFileAccess (line 152) In websave (line 104) In getFileFromURL (line 18) In imread (line 349) In ScoringEngineTestPoint2 (line 1) In solutionTest (line 5)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In websave>validateFileAccess (line 172) In websave (line 104) In getFileFromURL (line 18) In imread (line 349) In ScoringEngineTestPoint2 (line 1) In solutionTest (line 5)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In image_complementary (line 2) In ScoringEngineTestPoint2 (line 15) In solutionTest (line 5)]

3   Pass
A=imread('http://www.mathworks.com/matlabcentral/profiles/3374772.jpg'); A=rgb2gray(A); o=[133 122 85 117 125 192 134 151 100 120 162 211 144 179 110 126 177 206 155 174 88 118 150 195 155 162 86 146 165 213 166 172 110 162 162 193]; assert(isequal(image_complementary(A(100:105,100:105)),o))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.net.internal.validateCertificateFile (line 10) In matlab.internal.webservices.HTTPConnector/set.CertificateFilename (line 408) In matlab.internal.webservices.HTTPConnector>setProperties (line 687) In matlab.internal.webservices.HTTPConnector (line 150) In openHTTPConnection (line 27) In websave (line 98) In getFileFromURL (line 18) In imread (line 349) In ScoringEngineTestPoint3 (line 1) In solutionTest (line 7)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In websave>validateFileAccess (line 152) In websave (line 104) In getFileFromURL (line 18) In imread (line 349) In ScoringEngineTestPoint3 (line 1) In solutionTest (line 7)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In websave>validateFileAccess (line 172) In websave (line 104) In getFileFromURL (line 18) In imread (line 349) In ScoringEngineTestPoint3 (line 1) In solutionTest (line 7)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In image_complementary (line 2) In ScoringEngineTestPoint3 (line 10) In solutionTest (line 7)]

### Community Treasure Hunt

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

Start Hunting!