The binary image comparison 'RC_Im_BW==1' compares the entire image rather than individual objects.The 'bwlabel' can be used to label connected components in the binary image which counts the number of distinct objects.
%morphological operations
RC_Im_BW_cleaned = imopen(RC_Im_BW,strel('disk', 5));
% Label connected components
[labeledImage, numRBCs] = bwlabel(RC_Im_BW_cleaned);
% Print the count of RBCs
fprintf('Number of RBCs: %d\n', numRBCs);
Refer to the below documentation of 'bwlabel' for more details.

