Search code examples
matlabcatsobel

How create image overlays? change edges color


How create an image overlays? change edges color: For changing edges to green, at first I used 'sobel' however the overlay part have is an error: "IMG must be an array of either grayscale or RGB images: writeVideo(writer,double(out));" Why?

    out_red(BW)=0;
    out_green(BW)=255;
    out_blue(BW)=0;


    writeVideo(writer,double(uint8(out)));


close(writer);

Solution

  • you set by mistake the entire img as each color channel, it should be like that instead:

    out_red=img(:,:,1);
    out_green=img(:,:,2);
    out_blue=img(:,:,3);
    

    and the end do writeVideo(writer, uint8(out));