Error when remapping BW image to RGB after applying filter
Show older comments
Hi All,
I get the following message when trying to turn 3 colour images into RGB after applying a filter.
Warning: Error occurred while executing the listener callback for event POST_REGION defined for class matlab.internal.editor.RegionEvaluator:
Error using getByteStreamFromArray
Error during serialization
Error in matlab.internal.editor.WorkspaceUtilities.serializeArray
Error in matlab.internal.editor.figure.SerializedFigureState/serialize
Error in matlab.internal.editor.FigureProxy/createWebFigureSnapshot
Error in matlab.internal.editor.FigureManager
Error in matlab.internal.editor.FigureManager
Error in matlab.internal.editor.FigureManager.saveSnapshot
Error in matlab.internal.editor.FigureManager.snapshotAllFigures
Error in matlab.internal.editor.OutputsManager/postRegionCallback
Error in matlab.internal.editor.OutputsManager>@(varargin)obj.postRegionCallback(varargin{:})
Error in matlab.internal.editor.RegionEvaluator/postRegion
Error in matlab.internal.editor.RegionEvaluator>@(varargin)obj.postRegion(varargin{:})
Error in matlab.internal.editor.Evaluator/doPostEval
Error in matlab.internal.editor.Evaluator/evaluateCodeForFile
Error in matlab.internal.editor.RegionEvaluator/evaluateRegions
Error in matlab.internal.editor.evaluateRegions
Error in matlab.internal.editor.EvaluationOutputsService.evalRegions
This is my code:
%Image reading and filter section
I = imread('29_11_2019_132519Mosaix.jpg');
rmat = I(:,:,1);
gmat = I(:,:,2);
bmat = I(:,:,3);
binaryImageR = rmat < 50;
rmat(binaryImageR) = 0;
binaryImageG = gmat < 50;
gmat(binaryImageG) = 0;
binaryImageB = bmat < 50;
bmat(binaryImageB) = 0;
%RGB reconstruction section
imgSum1 = (binaryImageR & binaryImageG & binaryImageB);
imgSum2 = (rmat & gmat & bmat);
rgbImage = cat(3,binaryImageR,binaryImageG,binaryImageB); % Make the RGB image after filter
%Plots
figure;
subplot(2,3,1), imshow(rmat);
title('Red Plane');
subplot(2,3,2), imshow(gmat);
title('Green Plane');
subplot(2,3,3), imshow(bmat);
title('Blue Plane');
subplot(2,3,4), imshow(I);
title('Original');
subplot(2,3,5), imshow(rgbImage);
title('Summed Image');
uicontrol('Visible','off')
imgSum1 and imgSum2 are me playing with 2 different outputs.
Any thoughts would be most appreciated!
Accepted Answer
More Answers (0)
Categories
Find more on ROI-Based Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!