dahtah / imager

R package for image processing
GNU Lesser General Public License v3.0
187 stars 43 forks source link

Is there a way to enter RGB values and pixel location rather than using a JPEG file? #151

Open ehand622 opened 3 years ago

ehand622 commented 3 years ago

Hi,

I am working on an image recognition project on Arduino. Pretty much it is a robot and as it walks around it identifies things. I want to eliminate the use of an SD card for the project. Would there be a way to manually enter the image data coming from the camera directly? For example for one pixel entering in:

for(j = 0; j < 320; j++) { enterPixel(1, 1, 250, 0, 0) //1, 1 is for the pixel location on a bitmap, and 250, 0, 0 is the RGB data. }

Would there be a way to do something like this?

ShotaOchi commented 3 years ago

You can input values into image with at function. An example is shown below.

a <- imfill(10, 10, val = c(0, 0, 0))
for (i in seq(10))  at(a, i, 3, cc = 1:3) <- c(i, 0, i)