element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sci Fi Your Pi
  • Challenges & Projects
  • Design Challenges
  • Sci Fi Your Pi
  • More
  • Cancel
Sci Fi Your Pi
Blog Meditech: The imaging component settings and the data sharing strategy
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: balearicdynamics
  • Date Created: 11 May 2015 9:51 PM Date Created
  • Views 1206 views
  • Likes 1 like
  • Comments 7 comments
  • meditech_project
  • nfs_sharing
  • image_analysis
  • camera
  • rasperry_pi
  • sci_fi_your_pi
  • camera_probe
  • streaming
Related
Recommended

Meditech: The imaging component settings and the data sharing strategy

balearicdynamics
balearicdynamics
11 May 2015

    • Introduction and usage
    • Setting the capture side
      • startcam.sh
      • stopcam.sh
    • The sharing strategy
    • The still image streaming process
      • The streamer application
    • The streaming command
Introduction and usage

One of the most versatile probes of Meditech is the camera that cover a meaningful wide range of applications shortly described below

 

  • Screening of areas, like skin or injuries detail for post-intervention documentation or to describe particular environmental characteristics
  • Series of short timed shootings to see reaction to some kind of stimulations (e.g. allergy test, eye reaction and so on)
  • Image details extraction to enhance some specific characteristics
  • False-color representation and low-contrast images enhancement
  • Image measurement
  • More

 

The camera probe should be relatively small and lightweight, battery operated and - despite the other parts of the Meditech "block" (the main case) needs to be managed independently, eventually near the patient. Accordingly with these specifications the "camera probe", not yet sure what other associated probes can contain, should have the following charactristics

 

  • Waterproof impermeabilised (not for liquid immersion but should not be damaged by rain, water drops and so on)
  • Flip-up camera lenses enabling an automatic time-lapse image shooting
  • Battery operated so when the probe fits its housing in the Meditech main case it is automatically put in charge ready when it is extracted
  • One or two button(s) to control the required features
  • 16x2 alphanumeric LCD controlled by a 74HC595 Shift Register
  • A white light ring Led set around the camera lens
  • Battery charger

 

Setting the capture side

To capture the images in the different conditions that are needed the raspistill has all the needed features: shooting time settings, single repeated image or different named frames, frequency, duration, resolution and a lot of other controls. So a couple of commands for starting and stopping the camera has been created; these will evolve in a more complex one managing all the features the camera can do as mentioned above, controlled by the button.

 

startcam.sh

#!/bin/sh
# Start still frame and stream to the server

echo "`date +%y/%m/%d_%H:%M:%S`: stream_start" 1>>/home/pi/stream.log
# Mount remote share
sudo mount 192.168.1.99:/home/pi/stream /home/pi/stream >>/home/pi/stream.log

# Image numbering
# for test only
#raspistill -w 640 -h 480 -q 10 -o /home/pi/stream/pic%04d.jpg -tl 200 -t 9999999 -th 0:0:0 -n >>/home/pi/stream.log 2>>/dev/null &

#Fixed name
raspistill -w 640 -h 480 -q 10 -o /home/pi/stream/pic.jpg -tl 50 -t 9999999 -th 0:0:0 -n >>/home/pi/stream.log 2>>/dev/null &

 

stopcam.sh

#!/bin/sh
# Stop still frame

echo "`date +%y/%m/%d_%H:%M:%S`: stream_stop" 1>>/home/pi/stream.log
sudo killall raspistill >>/home/pi/stream.log 2>>/home/pi/stream.log
sudo umount /home/pi/stream

 

These commands append a status log to the file stream.log

To start the camera still sequence you can see that before a remote folder has been mounted: this was the problem s that required most the time to test due the way the streamer interpret the new files added.

For a continuous still capture, to save disk space and avoid problems the command use always the same name for every frame. The result is that every new shoot the same file is rewritten.

A more detailed description of the file sharing strategy over the net for both the client and server will be discussed in the next paragraph.

 

The sharing strategy

The question of sharing files over the network Meditech is based on (it uses three different Raspberry PI has been solved using the NFS file system The entire installation procedure will be discussed in a separate post.

The principle is that the RPIMaster Raspi device includes a large storage: 1Tb USB hard disk so one of the roles of this unit is to collect and store all the data that are produced for any reason by the entire system. Adopting this kind of centralised architecture give the possibility to increase the number of future optional probes without altering the system in any way.

The approach is the following:

 

RPIMaster is the centralised device with the large storage system

RPISlave2 is the device dedicated to manage the camera features

 

The still image streaming process

  1. RPISlave2 starts capturing images and storing them to the folder ~/stream that is a shared folder on the RPIMaster
  2. SPIMaster runs the program mjpg-streamer that sends to the IP address of RPImaster via http on the port 8090 every net image detected
  3. The Display control device (the Android tablet) access the image

 

The streamer application

A note it is the worth on the mjpg-streamers application. It is a lightweight linux utility that manages all the streaming process with several options: can send the files to a folder, on the http output and so on.The problem is that the plugin of the application that detect the image, when a new frame is detected but then for some reason id deleted of changed it stops the acquisition and the streaming port become unresponsive. This event occurs randomly the streamer on RPImaster does not need to be synched with the remote device that shares the images. So in come cases some millisecond after the images has beed reconised by the streamer on the RPImaster, the same image is replaced by a new frame in the RPIslave2 sequence.

To avoid this psoblem I had to modify the plugin so that - only for testing purposes - when this event occur it is only noticed on a log file. As soon as the streamer has been definitely tested the updated version will be shared on a post to be available to other users with the same problem.

 

The streaming command

Also in this case a bash simplified command has beed created to start the streaming process when needed.

 

#!/bin/bash
#Start streaming

echo "`date +%y/%m/%d_%H:%M:%S`: stream_start" 1>>/home/pi/stream.log
/home/pi/mjpg-streamer/mjpg_streamer -i "/home/pi/mjpg-streamer/input_file.so -f /home/pi/stream" -o "/home/pi/mjpg-streamer/output_http.so -p 8090 -w /home/pi/mjpg-streamer/www" 0>>/home/pi/stream.log 1>>/home/pi/stream.log 2>>/home/pi/stream.log >>/home/pi/stream.log 2>>/dev/null &

 

The following video shows how this architecture works

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply

Top Comments

  • Former Member
    Former Member over 10 years ago in reply to balearicdynamics +1
    Im really enjoying seeing how this project developes, Im used to approaching projects from a lower level but you have an approach that is more resemblant of a project manager utilising higher level technologies…
  • Former Member
    Former Member over 10 years ago in reply to balearicdynamics +1
    Hey, Going back to the communications strategy that you chose to adopt, there were many people, myself included who would have chosen to create a unique spi communications strategy utilising low level…
  • amgalbu
    amgalbu over 10 years ago +1
    Great video and... what a magnificent lab you have!!! I really like it!
Parents
  • amgalbu
    amgalbu over 10 years ago

    Great video and... what a magnificent  lab you have!!! I really like it!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to amgalbu

    image Thanks Ambrogio.

     

    You saw a small part, the studio desk where work me and my wife. Then there are many other parts, including the terrace image What I am not yet sure is if it is a lab+home or a home-lab imageimage

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to amgalbu

    image Thanks Ambrogio.

     

    You saw a small part, the studio desk where work me and my wife. Then there are many other parts, including the terrace image What I am not yet sure is if it is a lab+home or a home-lab imageimage

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube