m_out = mean([J_out_1(:); J_out_2(:)])
would be one way to do it assuming the image has only one colour channel. If they are RGB images:
m_out = mean([reshape(J_out_1, 1, , 3), reshape(J_out_2, 1, , 3)])
Note that if the two regions are the same size, you could just concatenate them without any reshaping (by colon or reshape).