Menu

#55 Camera Data Generator

open
nobody
1
2025-04-08
2025-03-21
xlance
No

Camera Data Generator

The SweetHome3D Camera Data Generator is a Java-based auxiliary tool designed to create camera settings files for use in the SweetHome 3D software. This tool allows users to generate detailed camera configurations, including location (X, Y, Z), angles (Pitch, Yaw), Field of View (FOV), time zones, and more. The generated data can be exported as a CSV file and imported into SweetHome 3D to automate camera setups for rendering or visualization purposes.

This tool provides several modes of operation to cater to different camera configuration needs:

  1. Cycle Time: Automates the generation of camera data over a range of days.
  2. Cycle FOV: Iterates through a range of Field of View (FOV) values.
  3. Cycle YAW: Iterates through a range of Yaw (horizontal angle) values.
  4. Create Circular PATH: Generates camera positions along a circular path.

Below is a detailed description of the program's functionality, commands, and operational modes.


User Guide and Command Help

Main Features

  • Input Fields:
  • Start Day / End Day: Define the range of days for which camera data will be generated.
  • Location (X, Y, Z): Set the camera's position in 3D space.
  • Angles (Pitch, Yaw, FOV): Configure the camera's orientation and field of view.
  • Date / Time: Specify the timestamp for the camera data.
  • Time Zone: Select the time zone for accurate time stamping.
  • Circular Path Parameters (Radius, Height): Define the radius and height of a circular camera path.

  • Output:

  • The generated camera data is saved as a CSV file on the user's desktop (Cameras-List.csv).

  • Progress Bar:

  • A progress bar visually tracks the generation process.

Operational Modes

1. Cycle Time
  • Description: Automates the generation of camera data over a specified range of days.
  • How It Works:
  • The user specifies a start day and an end day.
  • The program generates camera data for each day within the range.
  • If the interval spinner is enabled, the program divides each day into intervals (e.g., every 60 minutes).
  • Use Case:
  • Useful for creating time-lapse animations or rendering sequences over multiple days.
  • Settings:
  • Enable the "Cycle TIME (Start Day > End Day)" checkbox.
  • Adjust the Start Day, End Day, and Interval spinners.

2. Cycle FOV
  • Description: Iterates through a range of Field of View (FOV) values, generating camera data for each step.
  • How It Works:
  • The program cycles the FOV from 0.25° to 180° and back to 0.25° in increments of 0.25°.
  • Each FOV value corresponds to a unique camera configuration.
  • Use Case:
  • Ideal for testing how different FOV settings affect the rendered scene.
  • Settings:
  • Enable the "Cycle FOV angle (0.25° > 180° > 0.25°)" checkbox.
  • Set the desired Pitch, Yaw, and other parameters.

3. Cycle YAW
  • Description: Iterates through a range of Yaw (horizontal angle) values, generating camera data for each step.
  • How It Works:
  • The program cycles the Yaw angle from 0° to 360° in increments of 0.25°.
  • Each Yaw value corresponds to a unique camera orientation.
  • Use Case:
  • Useful for creating panoramic views or testing horizontal camera rotations.
  • Settings:
  • Enable the "Cycle YAW angle (0° > 360°)" checkbox.
  • Set the desired Pitch, FOV, and other parameters.

4. Create Circular PATH
  • Description: Generates camera positions along a circular path.
  • How It Works:
  • The user specifies the radius and height of the circular path.
  • The program calculates camera positions at evenly spaced points around the circle.
  • Yaw angles are automatically adjusted to align with the circular path.
  • Use Case:
  • Perfect for creating smooth camera movements along a curved trajectory.
  • Settings:
  • Enable the "Create a Circular PATH" checkbox.
  • Adjust the Radius and Height spinners.
  • Set the center coordinates (X, Y) for the circular path.

General Workflow

  1. Launch the Program:
  2. Open the application, and the main window will appear with input fields, checkboxes, and buttons.

  3. Configure Settings:

  4. Fill in the required fields (e.g., X, Y, Z, Pitch, Yaw, FOV).
  5. Select the desired operational mode (Cycle Time, Cycle FOV, Cycle YAW, or Create Circular PATH).

  6. Generate Data:

  7. Click the OK button to validate inputs and generate the camera data.
  8. A progress bar will indicate the status of the generation process.

  9. Save Output:

  10. Once the process is complete, the program will save the data as a CSV file on the desktop.
  11. A confirmation message will appear.

  12. Import into SweetHome3D:

  13. Use the generated CSV file to import camera settings into SweetHome 3D for rendering or visualization.

Additional Notes

  • Time Zone Handling:
  • The program includes a comprehensive list of time zones and their offsets.
  • The selected time zone affects the timestamp in the generated data.

  • Image Display:

  • A world time zones map is displayed for reference when selecting time zones.

  • Validation:

  • The program validates user inputs to ensure consistency (e.g., Start Day cannot exceed End Day).

  • Hardcoded Output Path:

  • The program saves the generated CSV file to the user's Desktop

Conclusion

The SweetHome3D Camera Data Generator is a powerful tool for automating camera configurations in SweetHome3D. By leveraging its various operational modes, users can efficiently create complex camera setups for rendering, animation, or visualization projects. Whether you need to cycle through time, FOV, Yaw, or create circular paths, this tool provides the flexibility and precision required for professional-quality results.

4 Attachments

Discussion

  • xlance

    xlance - 2025-03-21

    Screenshot!

     
  • Oliver Martínez

    Hi xlance, you forgot to upload sh3p file

     
  • Olivier

    Olivier - 2025-03-23

    Hi xlance,
    Great idea,
    I did try and this is what I found at first test :
    Didn't found 'cycle time' checkbox
    Date / time imput changed and not taken in account
    Fuzzed with start day , end day and date/time , will be more simple and explicit to give a start day with a date-time (local) and end day in the same way (date-time local)
    Longitude & Latitude not relevant (you are not going to change the compass parameters in SH3D)
    Cheers

     
    • xlance

      xlance - 2025-03-23

      ...

       

      Last edit: xlance 2025-03-23
  • xlance

    xlance - 2025-03-23

    Hi :-)
    Didn't found 'cycle time' checkbox
    Cycle time checkbox is at the very top and is always ON (default)

    Date / time input changed and not taken in account
    Please clarify more !
    Cheers

     
  • Olivier

    Olivier - 2025-03-25

    Hi,
    On my iMac , I still don't find this cycle time checkbox, however I don't see also the map on the right side as shown in your jpg.
    If I input for Date / Time as example today ; the csv is still produced with 2024-02-29 ...
    On another hand (fuzzed), if I want to generate a serie of (13) point of view as for today at each hour between 8AM and 8PM : what/where I should input ?
    Lon and Lat are linked to time Zone , so dont show them ... (otherwise one can think he can change them ...)
    I understand that Time Zone should be the same as in SH3D compass parameter to generate coherent POV timestamp, so if user gives Time Zone, Date/time can be given local as for example 2025-03-25T12:53 without 'greenwich' add on
    BR

     
  • xlance

    xlance - 2025-03-25

    @Olivier

    I still don't find this cycle time checkbox

    "Cycle time checkbox" is Grayed, that's inactive (refer to attached Screenshot1.jpg) and serves only as visual representation of the default operation of "Cycle through time from Start day to End day ". As for why it does not show on Mac OS, this needs some digging !

    I don't see also the map on the right side as shown in your jpg

    Download "World-Time-Zones-Map.png" file and put it in the same folder as *.jar file

    if I input for Date / Time as example today ; the csv is still produced with 2024-02-29

    Program defaults to 2024-02-29 or any DATE in Date/Time field for operation modes:
    Cycle FOV
    Cycle RAW
    Circular PATH
    but not in default mode, Cycle TIME from Start day to End day

    if I want to generate a serie of (13) point of view as for today at each hour between 8AM and 8PM : what/where I should input ?

    Refer to attached "Screenshot2.jpg" for requested Values
    Refer to attached "Cameras-List.csv" to examine generated *.csv file

    Please note that generated values will be from 00:00 to 23:00 and not from 8:00am
    to 8:00pm. Actually it's a good idea to add an option for selecting start and end hour :-)

    Time Zone should be the same as in SH3D compass parameter to generate coherent timestamp

    Indeed Time Zones and Date/Time Formats MUST the same as in SH3D, however if you change the City/Region, say from Paris to Fiji, the local indicator (+02:00) changes accordingly.

     

    Last edit: xlance 2025-03-25
  • Olivier

    Olivier - 2025-03-26

    The World-Time-Zones-Map.png was in the same folder ...
    This is the screen that I get on Mac.

     
  • xlance

    xlance - 2025-03-26

    @Olivier

    • World-Time-Zones-Map is now embedded inside the .jar file
    • Added some Tooltips for clarification
    • Added some Mac OS specific code to adjust Look and Feel, which will hopefully fix the issue with not visible UI elements
    • Source is included
     
  • Olivier

    Olivier - 2025-03-26

    @xlance
    Ok now I can see the map & cycle time button ( However I still wonder what the map and button are for ... )
    In att input screen I've tried with some parameters and corresponding camera list output.
    As you will see many inconsistencies in csv (y, pitch, yaw , fov, time (and not cycling), ...
    Cheers

     
  • xlance

    xlance - 2025-03-26

    @Olivier
    Try this please :-)

     
  • Olivier

    Olivier - 2025-03-27

    Hi xlance,
    Each day it becomes a little better ... :-) , thanks
    Apart my previous remarks this is what I found for today

    • Bad end limit of cycling time : just try with interval values as 44 or 57 —> missing the last line
    • No check of Date / Time : Suppress the entry or set only 2024-02-29 or type directly a date as 2025-03-27T11:00 or even 2025-03-27T11:00+01:00 , then time is not correctly managed in csv . Remark : In my opinion in this entry the only data that matters is the time (see next)
    • Time not taken in account : If I want a csv on 9 days at 08:00 (to see how the sun differs from one day to another, same hour), I’ve tried the following : end day at 9 , Interval at 1440 however in the output I’m at midnight all days
    • By the way , what if I want to do the same on 9 months (a line by month): I can’t as interval is limited to 1440 (one day) - one can argue that user can still develop an XL macro to suppress unnecessary lines :-)
    • Cycle FOV , what if I want to cycle but at 16:00 (for sun shade), same remark for cycle YAW or circular path
    • Circular path : missing csv header
     
  • xlance

    xlance - 2025-03-28
    • Numerous code adjustments !

    • Added two Calendars to select Start day, End day

    • Added "Fix on specific Hour" function @Olivier

    • Added Validation mechanisms for the sensitive Date / Time field

    • Output files are merely .txt files but with .csv extension (no header needed) @Olivier

    • Names of output files now are unique for each mode:
      Cameras-List-T.txt (TIME)
      Cameras-List-F.txt (FOV)
      Cameras-List-Y.txt (YAW)
      Cameras-List-P.txt (PATH)

    • For Time Cycle:
      Single Day operation ---> gets input from Date/Time Field
      More than one Day operation ---> gets input from Start Day & End Day spinners / calendars
      1 = 1 January
      2 = 2 January
      3 = 3 January
      ...
      366 = 31 December (for leap years)

     

    Last edit: xlance 2025-03-28
  • xlance

    xlance - 2025-03-28

    New INTERACTIVE Map with red Crosshair which Auto position based on Longitude and Latitude inputs (x, y coordinates)

    • Positioning is instantaneous without pressing Enter, either by direct input or choosing a location from the drop-down menu

    • Fixed an issue with Euro digital separator ( , )

     
  • Olivier

    Olivier - 2025-03-29

    Hereunder some findings about last version (h):

    • Give also possibility to generate for Aerial view (topview)
    • FOV : possibility to choose the interval and min/max (1440 Pov lines generated is really too much)
    • YAW : same as FOV
    • cameratype : choice among : PINHOLE - Default ; NORMAL - Depth of field ; FISHEYE - Fisheye ; SPHERICAL - Spherical
    • Possibility to cycle time with 1 month interval missing (ideally user can choose any interval given in month, day, minute)
      -Cameras-List-P.csv : missing header

    Better than a list of textual remarks, please find a fac-similé for Camera Data Generator interface, that I’ld like to have. (Logic behind is self-explained , otherwise just ask)
    Cheers
    Olivier

     
  • xlance

    xlance - 2025-03-30

    @Olivier
    The New functions requested are very comprehensive and took a lot of time and effort :-)

    COMPLETE + Give possibility to generate for Aerial view (topview) in addition to (observer)

    COMPLETE + FOV : possibility to choose the interval and min / step / max / step / min

    COMPLETE + YAW : possibility to choose the interval and min / step / max

    COMPLETE + Camera types : PINHOLE, NORMAL (Depth of field) ; FISHEYE, SPHERICAL

    COMPLETE + Cameras-List-P.csv : Added header

    and the really TRICKY one:

    COMPLETE + Possibility to cycle time within 1 month interval or any number of days, also
    taking into consideration variable lengths of Months (28, 29, 30, 31), so
    output will be consistent
    Input 31 days ---> 1 Jan, 1 Feb, 1 Mar ...
    Input 16 days --->1 Jan, 17 Jan, 1 Feb, 17 Feb, 1 Mar, 17 Mar ...

    + On every startup, the program will randomly select a different destination and jumps to it !

    Cheers

     

    Last edit: xlance 2025-03-30
  • Olivier

    Olivier - 2025-03-30

    Hi xlance, Thanks again for your work and efforts !
    I've had a look at last version and this is what I found

    • Start 1 ; End 4 ; Fix Num days 2 Output message wrong or misleading (Total days 4) whilst Output is correct with 2 days generated (1 & 3)
    • Haven’t seen how to have interval of x months (only Num of days proposed)
    • Don’t understand why for Cycle Fov you go up and then down (data down are same that data up )
    • For Circular path Height is useless as you can take Z value, in the output : point 005 is useless as identical to point 001
    • Globally I find interface fuzzy (Map not needed as well as X/Y coordinates) ; how to have data for one day, each hour between 09:00 and 19:00 (without having the whole day 00:00 - 23:00) ; How to have a circular path with 12 positions (30° step) ; Date / Time not needed and can leads to error if you change for example the time; visual presentation arrangement of X,Y,Z, Pinhole, Observer not evident or cristal clear ...
      Cheers
     
  • xlance

    xlance - 2025-03-30

    Start 1 ; End 4 ; Fix Num days 2 Output message wrong or misleading (Total days 4) whilst Output is correct with 2 days generated (1 & 3)
    Behavior is intentional, to indicate the Total days processed

    Haven’t seen how to have interval of x months (only Num of days proposed)
    Input 31 and it will correctly output 12 Months

    Don’t understand why for Cycle FOV you go up and then down (data down are
    same that data up )
    Behavior is intentional, for Aesthetic reasons :-)

    For Circular path Height is useless as you can take Z value, in the output
    Some users requested it

    Point 005 is useless as identical to point 001
    It is crucial for closing the Path

    How to have a circular path with 12 positions (30° step) ;
    Only 5 are needed for creating a Path, refer to "Create Video" in PhotoVideoRenderer Plugin

    Map not needed
    Actually it's the crown jewel of the program ;-)

    Cheers

     
  • xlance

    xlance - 2025-04-08

    1.1Q

    • Added a second Radius field to be able to define Elliptical paths
      (Circles have radius 1 = radius 2)
      .
    • Added a New field to define Number of Interpolation points on a any path
      (Circular or Elliptical)
      .
    • Cleaned *.jar file
      .
    • Added a new function / checkbox to switch CSV separator from ( , ) to ( ; ) for Euro OS
      .
      Note:
      CameraBagPlugin-1.8 plugin now supports importing CSV files with ( ; ) separator
     

    Last edit: xlance 2025-04-08

Log in to post a comment.

MongoDB Logo MongoDB