1

I am troubleshooting a HALCON operator that is failing on single channel images, but works on color images.

What is the simplest way to convert a greyscale image to an rgb image in HALCON?

I am not picky about how the color conversion is done; copying the one channel to each channel of the rgb image is enough.

Andrew Wagner
  • 22,677
  • 21
  • 86
  • 100

3 Answers3

2

I do it (like you said) by copying the grayscale channel into all three channels of the RGB image. You can use this operator and pass the channel 3 times, it returns a 3 channel image: gen_image3

asquared
  • 370
  • 1
  • 2
  • 10
0

Hit the help file for compose3 (). Pass in the single channel image 3x.

You might also be failing because of the data type of each channel. If the RGB image is of type Byte, but single channel is int2 or real, that could be your problem.

Jim
  • 56
  • 4
0

you can to use

channels_to_image(Images : MultiChannelImage : : )

Images is an array of Images(number of channels)

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
hosein
  • 1
  • 1