CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 07:53:18 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=6654b68fcfeb374c5aded2d90ca19c28cb9501c3fefedfd9aca49cea394e813da%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22gBE678uQw5sh7gt304BZpoPwZL79hCZO%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d505cd7e23741b-BLR
rawToRGB_BooleanMatrixSelection.m - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [redPixels, greenPixels, bluePixels] = rawToRGB_BooleanMatrixSelection(cfaPatternDimensions, cfaPatternExif, imgData)
- timeStart = time();
- %%
- %% Returns boolean matrix with values set to one corresponding to pixels in
- %% imgData that correspond to pixels of the specified cfaColor
- %%
- function pixelColorBooleanTable = genPixelColorBooleanTable(cfaColor)
- %% generate boolean table of M x N with values equal to 1 for pixels of color we want
- table = logical(cfaPatternAsMatrix == cfaColor);
- %% scale (repeat) table so its large enough to cover the entire image data. this
- %% requires rounding up the repeat count to an even multiple of the CFA dimensions
- pixelColorBooleanTable = repmat(table, floor ((imgHeight+cfaPatternRows-1)/cfaPatternRows),
- floor ((imgWidth+cfaPatternCols-1)/cfaPatternCols));
- %% round size of table down if necessary to exactly fit the size of the image data
- pixelColorBooleanTable = pixelColorBooleanTable(1:imgHeight, 1:imgWidth);
- end
- CFA_RED = 0;
- CFA_GREEN = 1;
- CFA_BLUE = 2;
- imgHeight = size(imgData, 1);
- imgWidth = size(imgData, 2);
- %%
- %% build three boolean matricies, one per color, that will be used to select
- %% values out of the image data corresponding to the CFA location of those
- %% colors
- %%
- cfaPatternRows = cfaPatternDimensions(1);
- cfaPatternCols = cfaPatternDimensions(2);
- cfaPatternAsMatrix = reshape(cfaPatternExif, [cfaPatternRows cfaPatternCols])';
- redBooleanTable = genPixelColorBooleanTable(CFA_RED);
- greenBooleanTable = genPixelColorBooleanTable(CFA_GREEN);
- blueBooleanTable = genPixelColorBooleanTable(CFA_BLUE);
- %% extract pixel data for each of the colors we want
- redPixels = imgData(redBooleanTable);
- greenPixels = imgData(greenBooleanTable);
- bluePixels = imgData(blueBooleanTable);
- printf("Execution time: %.4f\n", time() - timeStart);
- end
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐⭐⭐MAKE $900 INSTANTLY⭐⭐
Java | 4 sec ago | 0.10 KB
-
⭐⭐⭐MAKE $1000 INSTANTLY⭐⭐
Java | 15 sec ago | 0.10 KB
-
⭐⭐⭐GMAIL Logs (2FA disabled)⭐⭐
Java | 30 sec ago | 0.10 KB
-
⭐⭐⭐Make $1500 in 20 minutes⭐⭐
Java | 41 sec ago | 0.10 KB
-
⭐⭐⭐MAKE $900 INSTANTLY⭐⭐
Java | 52 sec ago | 0.10 KB
-
⭐⭐⭐Make $1500 in 20 minutes⭐⭐
Java | 1 min ago | 0.10 KB
-
⭐⭐⭐Instant Profit Method⭐⭐
Java | 1 min ago | 0.10 KB
-
Free Crypto Method (NEVER SEEN BEFORE)⭐⭐ 3
JavaScript | 1 min ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand