Group Abstract Group Abstract

Message Boards Message Boards

Solving Puzzle : 4 Pics 1 Word

Posted 7 years ago
Attachments:
POSTED BY: Kotaro Okazaki
3 Replies

Hi Kotaro,

This is a great post. I learned a lot, thank you! I have a small improvement to start automating the task of sending the screenshot by email to your pc. You can use our ServiceConnect function to connect Mathematica to your smartphone using the Pushbullet app.

Download Pushbullet to your phone and create an account. Then:

1. Take screenshot

2. Open the Pushbullet app and go to Pushing

enter image description here

3. Push the screenshot

enter image description here enter image description here

4. Connect to Pushbullet from the Wolfram Language

    pb = ServiceConnect["Pushbullet"]

This will prompt a dialog box to provide your Access Token. To get an access token, go to https://www.pushbullet.com/, log into your account > Go to the Settings option in the menu at the left > Account > Press the Create Access Token at the right > Copy the provided Access Token > Paste it in the dialog box in the Wolfram Language and agree the terms of use > Click Done

5. Import the screenshot

This will import the last pushed image from Pushbullet.

  screenshot =  Import[First[pb["PushHistory"]]["FileURL"]]

You can also import multiple images, e.g. the last 5 pushed screenshots

history = pb["PushHistory"]
Import/@(history[1 ;; 5, "FileURL"]//Normal)

Finally, this is not a suggestion but just another way to write your getWordLength function:

getWordLength[screenshot_] := 
Module[{img3, img3b}, 
 img3 = ImageTrim[screenshot, {{0, 555}, {1080, 555}}];
 img3b = Binarize[img3];
 Length[Split[PixelValuePositions[img3b, 1][[All, 1]], (#2 - #1) == 1 &]]/2 -1
];

I just like using the PixelValuePositions function ;)

Thanks for your helpful information, Christian.

I would like to take advantage of them.

POSTED BY: Kotaro Okazaki

enter image description here - Congratulations! This post is now a Staff Pick as distinguished by a badge on your profile! Thank you, keep it coming!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard