What does the equation do in the 2 images to combine it to one image

A
Azariah · Sep 29, 2020 · 2.1K views
Question
Please can someone explain what happens in the below code cb and cr are chrominance in red and blue channels bmean and rmean is the mean value of cb and cr x = [(cb − bmean), (cr − rmean)] how is becomes a single image, what does that comma do there?
Expert Answer
Profile picture of John Michell
John Michell PhD Expert
Answered Nov 20, 2025
Actually this gives two images representing one image twice one of which is darker than the other. The comma "," just a separates two data sets. You can skip "," and leave blank space that gives the same output. Or if you use ";" then the two image will be displayed one above another in a vertical form.
In order to get or see one image, just to use:
 
x1 = (cb − bmean); x2= (cr − rmean); subplot(211), imshow(x1); subplot(212);imshow(x2)
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!