OpenCV and MATLAB gray scale values differ for the same image

前端 未结 3 605
粉色の甜心
粉色の甜心 2021-01-27 00:10

In MATLAB, i read a color video , extract a certain frame and convert it to a gray scale image using the rgb2gray function.But when I load the same video with OpenC

3条回答
  •  既然无缘
    2021-01-27 00:36

    First, all color images in OpenCV are BGR and not RGB so maybe one of the problems could be that OpenCV is making the transformation wrong. You should use BGR2GRAY. And second, If I remember well in matlab yo should specify which are the ranges of values in your image. You have to put between 0 and 255 for a gray image.

    I hope this can help you.

提交回复
热议问题