Camera MUX 2x2

When you reference image boots, by default, the Camera MUX 2x2 application runs immediately, but exits if you don't have four cameras connected to your board. If you want the application to run with a less than four cameras, use the -n parameter.

The application also requires that the board has four connected and configured as CAMERA_UNIT_1, CAMERA_UNIT_2, CAMERA_UNIT_3, and CAMERA_UNIT_4. The default camera configuration file on the reference image is configured to use four FPD-Link III interface cameras.

You can run the Camera MUX 2x2 with this parameter:
-n numberofcameras
You can use this optional parameter to run the application using 1–3 cameras. When this parameter isn't specified, four cameras are required for this application to run; otherwise it exits. For example, if you want to run this application with one camera, you would run this command:
camera_mux2x2 -n 1
The 2x2 grid shows an image buffer from each camera starting. The video streams from the cameras start are arranged in the following manner: Here's what the screen looks like:


Figure 1. Camera MUX 2x2 application
If you have the Camera MUX 2x2 application running, you should stop it before you run other applications. To stop it, use the slay camera_mux2x2 command.

If you don't have four cameras to connected to your board, you can run this application by using file cameras. For more information about how to configure file cameras, seeConfiguration for file cameras.

Run the application

By default, the Camera MUX 2x2 requires four cameras to run. If you don't have four cameras, the application exits immediately.
  1. Connect to the target board using a serial connection, terminal via a network connection (telnet or ssh), or via a terminal in the QNX Momentics IDE.
  2. Type camera_example to run the Camera MUX 2x2 example.

Build the Camera MUX 2x2 application

On your host computer, the source code is provided for Camera MUX 2x2 example. You can build the source and deploy the binary on to your target.

Before you start, you should create an environment variable called HOME. The environment should be set to a directory where you want to work with the files and it shouldn't have any spaces within the path. In addition, the directories should be delimited using a forward-slash ("/"). For example, on Windows, don't use C:\Documents and Settings\Administrator. Instead, use something such as C:\qnx_install\adas because the space in the name doesn't work with the provided Makefiles.
  1. In a command prompt, copy camera_mux2x2_ADAS1.0_[buildstamp].zip, where buildstamp is a numeric value representing an internal build number to location on your computer, such as %HOME%/qnx_install/adas.
  2. If you are running on a Windows host, type bash in your command prompt.
  3. Navigate to the location that you copied the ZIP file, and type unzip camera_mux2x2_ADAS1.0_[buildstamp].zip.
  4. A directory should be created called camera_mux2x2, navigate into that directory, and type make all.
  5. Navigate to nto/arm/o.le.v7 and transfer the camera_mux2x2 file to your the /usr/bin/ directory on the target. For example, you can use the IDE to transfer the file.
    Note: Ensure that you can create a backup of the original camera_mux2x2 executable before you deploy your newly built version of the Camera MUX 2x2 application.
  6. On your target, in a terminal connection, type camera_mux2x2 to run the application. Keep in mind, the Camera MUX 2x2 application may run, but exits immediately if it doesn't detect that there are four cameras available.