Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
cfry committed Jul 31, 2018
1 parent daf08d3 commit 5ffbd3e
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 9 deletions.
4 changes: 2 additions & 2 deletions doc/guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<details class="doc_details"><summary>About</summary>
This is <a href="http://hdrobotic.com/" target="_blank">Dexter</a> Development Environment<br/>
version: <span id="dde_version_id">2.4.4</span><br/>
released: <span id="dde_release_date_id">July 27, 2018</span>
version: <span id="dde_version_id">2.4.5</span><br/>
released: <span id="dde_release_date_id">July 31, 2018</span>
<p></p>
DDE helps you create, debug, and send software to a Dexter robot.
You can use any JavaScript augmented with DDE-specific functions to help find out about,
Expand Down
3 changes: 3 additions & 0 deletions doc/known_issues.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
with this DDE release. All of them are on our "do list".
<p></p>
<ul>
<li>Picture.detect_blobs: the data about each blob is inconsistent with
itself. detect_blobs <i>appears</i> to work but actual x, y locations
for each blob are wrong.</li>
<li>Picture.show_video() sometimes comes up with a blank video, not showing the
output of your webcam. Often just closing the show_window that is attempting
to display the video and starting over will work.
Expand Down
12 changes: 11 additions & 1 deletion doc/release_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@
.doc_details summary { font-weight: 600; }
</style>

<details class="doc_details"><summary>v 2.4.5, July 31, 2018</summary>
<ul>
<li> Fixed bug in display of Evaled source code in the Output pane header.
This bug was also responsible for breaking the Insert menu/Machine Vision/ demos,
and probably a bunch of other things, especially when evaling a large
amount of source code (that would likely include single quotes).
</li>
</ul>
</details>

<details class="doc_details"><summary>v 2.4.4, July 27, 2018</summary>
Highlights: Serial port robot improved greatly.<br/>
new OpenCV classifier interface for detecting objects in images.<br/>
Click help for built-in JS constructs improved.<br/>
Eval&Start button can run a robot instruction.<br/>
patch_until helps manage software patches.<br/>
Improvements to the Vector library<br/>
Improvements to the Vector library.<br/>
<ul>
<li> Removed console printouts when evaling a Job,
related to: inspect_set_new_object_onclick,
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- good html validtor: https://www.onlinewebcheck.com/check.php?adv=1 -->
<html lang="en">
<head>
<title>Dexter Development Environment 2.4.4</title>
<title>Dexter Development Environment 2.4.5</title>
<link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" />
<!-- <script type="text/javascript" src="jquery-1.11.3.min.js"></script> -->
<script>window.$ = window.jQuery = require('jquery');</script>
Expand Down
2 changes: 2 additions & 0 deletions output.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,8 @@ window.out_eval_result = function(text, color="#000000", src){
src_formatted = src_formatted.substring(0, 55)
src_formatted_suffix = "..."
}
src_formatted = replace_substrings(src_formatted, ">", "&lt;")
src = replace_substrings(src, "'", "&apos;")
src_formatted = " of <code title='" + src + "'>&nbsp;" + src_formatted + src_formatted_suffix + "&nbsp;</code>"
}
text = "<fieldset><legend><i>Eval result</i>" + src_formatted + "</legend>" + text + "</fieldset>"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "dexter_dev_env",
"productName": "dexter_dev_env",
"version": "2.4.4",
"release_date": "July 27, 2018",
"version": "2.4.5",
"release_date": "July 31, 2018",
"description": "Dexter Development Environment",
"author": "Fry",
"license": "GPL-3.0",
Expand Down
36 changes: 33 additions & 3 deletions picture1.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,16 @@ var Picture = class Picture{
let mat = cv.imread(offScreenCanvas)
return mat
}
// pixel operators, accept either a number or an array of 4 as input
static pixel_to_gray(pixel){
if (typeof(pixel) == "number") { return pixel }
else { return Math.round((pixel[0] + pixel[1] + pixel[2]) / 3) }
}

static pixel_to_color(pixel){
if (typeof(pixel) == "number") { return [pixel, pixel, pixel, 255]}
else { return pixel }
}
//____________Low level mat methods__________
// see https://docs.opencv.org/3.4.1/df/d24/tutorial_js_image_display.html
//mat.channels() => 1 if gray mat, 3 if rgb, 4 if rgba. For picture from a normal webcam, this will be 4
Expand Down Expand Up @@ -820,19 +830,30 @@ var Picture = class Picture{
let keypoints = new cv.KeyPointVector();
//var image = cv.Mat.ones(5, 5, cv.CV_8UC3);
detector.detect(mat_out, keypoints);
let key_pt_reasonable_array = Picture.keypoints_to_reasonable_array(keypoints, sort_by)
if(show_picture) {
let dst_mat2 = Picture.make_similar_mat(mat_in)
cv.drawKeypoints(mat_out, keypoints, dst_mat2,
cv.Scalar.all(-1), //draw each point in a different color
cv.DrawMatchesFlags_DRAW_RICH_KEYPOINTS //draw points at size of found point
)
for (let pt of key_pt_reasonable_array){
cv.putText(dst_mat2, "" + pt.i, new cv.Point(pt.x, pt.y),
cv.FONT_HERSHEY_PLAIN, 2.0, new cv.Scalar(255, 0, 0, 255))
//cv.addText(mat_out, "" + pt.i, new cv.Point(pt.x, pt.y), cv.FONT_HERSHEY_PLAIN)
}
Picture.show_picture({content: dst_mat2})
}
let key_pt_reasonable_array = Picture.keypoints_to_reasonable_array(keypoints, sort_by)
for (let kp of key_pt_reasonable_array){
let pix = Picture.mat_pixel(mat_in, kp.x, kp.y)
kp.gray = Picture.pixel_to_gray(pix)
kp.color = Picture.pixel_to_color(pix)
}
if(show_keypoints) {
Picture.display_keypoint_data(key_pt_reasonable_array)
}
return (opencv_result_format ? keypoints : key_pt_reasonable_array)
if (opencv_result_format) { return keypoints}
else { return key_pt_reasonable_array }
}

static detect_blobs_fill_in_args(obj){
Expand Down Expand Up @@ -908,14 +929,23 @@ var Picture = class Picture{
"<th><input type='button' name='sort_by_x' value=' x ' style='width:54px;'/></th>\n" +
"<th><input type='button' name='sort_by_y' value=' y ' style='width:62px;'/></th>\n" +
"<th><input type='button' id='sort_by_size_id' value=' size ' style='width:62px;'/></th>\n" +
"</tr>"
"<th><input type='button' id='sort_by_gray_id' value=' gray ' style='width:62px;'/></th>\n" +
"<th><input type='button' value=' color ' style='width:62px;'/></th>\n" +

"</tr>"
for(let i = 0; i < key_pt_reasonable_array.length; i++){
let kp = key_pt_reasonable_array[i]
let rgb_string = "rgb(" + kp.color[0] + ", " +
kp.color[1] + ", " +
kp.color[2] + ");"
data_html += "<tr><td>" + i +
"</td><td>" + ("" + kp.x).substring(0, 6) +
"</td><td>" + ("" + kp.y).substring(0, 6) +
//"</td><td>" + ("" + kp.angle).substring(0, 6) +
"</td><td>" + ("" + kp.size).substring(0, 6) +
"</td><td>" + ("" + kp.gray).substring(0, 6) +
"</td><td>" + "<div title='" + rgb_string + "' style='display:inline-block; width:50px; height:20px; border:1px solid #000 !important; background-color:" +
rgb_string + "'/>" +
"</td></tr>"
}
data_html += "</table>"
Expand Down

0 comments on commit 5ffbd3e

Please sign in to comment.