How do I change the pixel values of an image #3117
-
I'm having trouble editing the pixel values of an image, what am I doing wrong? From my testing, it seems that I can't actually set the values for the pixels because the changes aren't taking affect. I've tried printing out the rgb values of the pixels in the image and they return blank, not a zero integer, just blank. The yarp viewer returns a gray image as shown in the bottom picture (in the picture, there are 0 frames coming in from the port because it is disconnected, yarp viewer returns the same image even when connected to the input port with frames coming in). The code is below as well. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @Bettygeuse From what you posted, it seems you're manipulating the pixel correctly. I can point you at some code snippet that is doing pretty much what you're looking for: |
Beta Was this translation helpful? Give feedback.
The setExternal() method was the solution! I had the bgra bytes of my image and I just needed to pass them into the method. Thank you for the help!