Can read photo in but not process

I can take photo in using node-red-contrib-image-tools image viewer but when I try to process it nothing happens. It works small sample photos like 160x30 but when I take in 600x508 and try to prosess it, nothing happens.

Photos are from rain radar and I try to make telegam alarm when rain clouds are closing my position. Target is to read photo in and analyse RGB values in order to find values typical for rain cloud and then calculate movement and distance to my home.

I'm running NR in Raspberry Pi 3B so it can be memory issue. One choise could could be to split it to 600*1 row and analyse row by row, but so far I have not managed to do it.

Here is flow

[{"id":"ff6529a4.32df58","type":"split","z":"2ef12be.dc2abd4","name":"split all to ones","splt":",","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":true,"addname":"","x":940,"y":640,"wires":[["b83e77d5.827fd8"]]},{"id":"b83e77d5.827fd8","type":"join","z":"2ef12be.dc2abd4","name":"join 3 i.e. RGB values","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1080,"y":580,"wires":[["449cc8f.c062338"]]},{"id":"449cc8f.c062338","type":"join","z":"2ef12be.dc2abd4","name":"join 600 RGB values i.e. one row","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":";","joinerType":"str","accumulate":false,"timeout":"","count":"600","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1240,"y":640,"wires":[[]]},{"id":"fe650836.8e3198","type":"file in","z":"2ef12be.dc2abd4","name":"Read photo in RGB format","filename":"kuva.txt","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":660,"y":640,"wires":[["63706fb2.ae591"]]},{"id":"328fb30b.cb7e3c","type":"inject","z":"2ef12be.dc2abd4","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":580,"y":580,"wires":[["fe650836.8e3198"]]},{"id":"63706fb2.ae591","type":"change","z":"2ef12be.dc2abd4","name":"Remove [ and ]","rules":[{"t":"change","p":"payload","pt":"msg","from":"[","fromt":"str","to":"","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"]","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":580,"wires":[["ff6529a4.32df58"]]}]

Nothing happens? No errors? Where does it "stop" (i.e. use debug nodes after every node - what do you see?

I cant test anything for you as ...

  1. You only posted this...

  2. You provided no sample file (i.e. the kuva.txt file that "does nothing")

it stops after "Remove [ and ]" node. I had debug in all nodes but removed for simplicity

But that is an image not a txt file? as your file node is set to read.

and there is no image-tools nodes in the flow you posted.

Maybe start again - what are you trying to do? read colour data from a specific X/Y postition?

If so, then maybe this will help...

As a new user I can not upload the file

You can now.

However, answer the questions in my previous post.

Thanks I got that "exract color from location on image" flow example working. I think I can use that for my project.

By the way, what format is the output of this function?

msg.image.getPixelColor

I have tried multiple website colour tools but so far no-one shows same colour that I seen in real picture?

Also If I click colour code, it it changes from this 0xf100eff to this 252710655, are they same?

Yes.

From jimp docs...
image.getPixelColor(x, y); // returns the colour of that pixel e.g. 0xFFFFFFFF

It doesnt state which way around it is but I suspect either AARRGGBB or RRGGBBAA

So your value 252710655 is same as 0xf100eff is same as #0f100eff

So ...

  • if it is AARRGGBB then drop the alpha channel you get #100eff image
  • if it is RRGGBBAA then drop the alpha channel you get #0f100e image

Confirm that it is

RRGGBBAA

Thank you very much for fast responses and help!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.