Record Full-Resolution Image with recamera

How do I record an image with recamera at full resolution, 2592 x 1944 @ ~ 1fps? The NodeRed camera max resolution (dropdown) is only 1920 x 1080.

Ultimately I would like to create an https endpoint to grab the current image and run the image itself through a custom cnn.

Looks like even simple things are not simple. Back to Raspberry Pi …

Hi there,

And Welcome here… (I think?)

So, I see you asked a very good question. Not sure if your last post was shade or patients related?
Anyway I searched your example.
I found this: I hope you find it useful.;

To record a 2592 x 1944 image at ~1fps, you need to access the reCamera backend terminal and modify the camera.js file to enable higher resolutions. Once in the terminal, you’ll need to navigate to the correct directory and use a command-line tool like sed to change the option value in the code, then save the file to apply the changes.

Here are the steps to record a full-resolution image:

  1. Access the terminal: Log in to the reCamera backend terminal.
  2. Navigate to the Node-RED module directory: Enter the following commands to change directories:
cd /home/recamera/.node-red/node_modules/node-red-contrib-sscma/nodes [1]

  1. Edit the camera.js file: Use the sed command to modify the camera.js file. This command will replace a specific line with a new one, enabling custom resolutions:
sudo sed -i 's/option: n.option || 0,/option: n.option !== undefined ? parseInt(n.option) : 1,/' camera.js [1]

  1. Save the changes: The sed command will modify the file in place. You can then save the file to apply the changes.
  2. Restart Node-RED: Restart the Node-RED server to make sure the changes are applied correctly. You should now have the new resolution available in your Node-RED camera nodes.
  3. Verify it works, Post your results and mark this post as the solution so others can find it and thank you in advance for the contribution :+1:

Seasons Greetings :christmas_tree:

HTH
GL :santa_claus: PJ :v:

Hi PJ_Glasso,

Helpful, but not quite working yet. The edit with sed did not match. However, camera.js already seems to set the config for “option” (should this be called camera resolution?) and fps.

node.config = {
            option: parseInt(n.option),
            fps: parseInt(n.fps),
            preview: false,
            websocket: false,
            mirror: n.mirror ? true : false,
            flip: n.flip ? true : false,
            audio: n.audio ? (isNaN(parseInt(n.volume)) ? 80 : parseInt(n.volume)) : 0,
        };

camera.html has a bit more information:

            // Ensure selects show sensible defaults if value is missing/invalid
            var optionVal = String(this.option);
            var validoption = ["0", "1", "2"]; // 1080p/720p/480p
            if (!validoption.includes(optionVal)) {
                optionVal = "0"; // default 1080p
            }
            optionInput.value = optionVal;

            var fpsVal = String(this.fps);
            var validFps = ["5", "10", "15", "30"];
            if (!validFps.includes(fpsVal)) {
                fpsVal = "30"; // default 30 FPS
            }
            fpsInput.value = fpsVal;

Apparently valid options for the camera resolution are 0, 1, 2, corresponding to 1080p/720p/480p.

I’ve tried editing camera.html, adding a new option 3 <option value="3">2592x1944 (2592p)</option> and <option value="1">1 FPS</option> (and modifying the checks), but not surprisingly this did not work: presumably option 3 and fps 1 must be declared somewhere and I have no idea where.

Hi there,

Ok , well that’s good. it was a shot in the dark. We are close then. Let’s see what Seeed Engineering has for US… :v:

HTH
GL :slight_smile: PJ :+1:

Is there a way to contact them and get help?

Hi there,

So , @Toastee0 or Parker are the folks with some real experience with it, they will see the posts and comment, Send email to [email protected] i think is the generic method.
Also have a look here :santa_claus:

see if it’s covered. :v:

HTH
GLl :slight_smile: PJ :v:

not sure may be Holiday or Vacation so… response may be slow.

Also I see this :santa_claus: :+1:

  1. Use a command to set the desired image capture resolution. The reCamera documentation indicates specific command codes for resolutions.
  • The command to set the image capture resolution is icr:<val>, where <val> is a numerical code.
  • For 2592 x 1944 resolution, the value is 6.
  • The specific command to set this resolution at runtime might be issued through a configuration tool or a script that sends the icr:6 command to the camera interface.
  1. Adjust the frame rate if needed. The command to set the FPS range is fpsr:<val_low> <val_high> (e.g., fpsr:0.5 1 for ~1fps). The low frame rate should help with stability when capturing high-resolution images.

There are two main variants of the recamera.

The first generation re-camera had a older lower resolution camera.

The new camera HQ Poe edition likely has the resolutions that you are trying to enable on the older system which is why it’s not working.

Ps

Thanks to PJ for tagging me in on this one.

1 Like

I have the 2002w with 64GB ssd. Supposedly this has 2592x1944px resolution.

@PJ_Glasso

icr:<val> where did you find this in the documentation? At any rate, this seems to be doing something at least. injecting fpsr:0.5 1 seems to lower the frame rate, and perhaps icr:6 increases the resolution.

How do I test this? save records a video, what I want is a single frame (e.g. array I can download from an http endpoint or forward to a cnn).

I’ve also posted on the github discussion forum and sent an email to seeed.

Thanks, Bernhard

1 Like

Check out the real-time http samples, they show examples of direct hardware access.

Realistically, the YOLO model needs to be run at a lower resolution that the max the camera is capable of. I’d assume that’s why the resolution isn’t exposed in node red.

The above wiki example can likely be modified to configure the camera to the resolution you’re attempting.

1 Like