<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Good Day:</p>
    <p>I would have a look at the masked raster and confirm the no data
      value (-999) is written to the header so that it is recognized by
      the segmentation routine. Another option would be to delete the
      segmented polygons from your result layer (if your result is a
      vector) or using the raster calculator to reset these pixels to
      -999.     <br>
    </p>
    <p>Kirk Schmidt<br>
    </p>
    <div class="moz-cite-prefix">On 6/13/2025 8:12 AM, celati Laurent
      via QGIS-User wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAHByMH1=0_=ma32nsaXcG73gPmv32vEKhQ+WJwmcDc-G4_WZxw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div><span class="gmail-HwtZe" lang="en"><span
              class="gmail-jCAhz gmail-ChMk0b"><span
                class="gmail-ryNqvb">Hello again,</span></span></span></div>
        <div><span class="gmail-HwtZe" lang="en"><span
              class="gmail-jCAhz gmail-ChMk0b"><span
                class="gmail-ryNqvb">Following to my previous own post
                I'm taking the liberty to do a first reaction/addition.</span></span>
            <span class="gmail-jCAhz gmail-ChMk0b"><span
                class="gmail-ryNqvb">I tried clipping my multispectral
                SPOT6 image with my BD FORET mask (clip a raster with a
                masking extent coverage) by setting the value -999
                (16-bit signed output) for the no data values during
                clipping.</span></span><span
              class="gmail-jCAhz gmail-ChMk0b"><span
                class="gmail-ryNqvb">
                This worked.</span></span> <span
              class="gmail-jCAhz gmail-ChMk0b"><span
                class="gmail-ryNqvb">But when I try segmentation with
                the OTB GRM tool on this image, the process isn't
                ignored in the areas for which I had assigned no data
                values.</span></span> <span
              class="gmail-jCAhz gmail-ChMk0b"><span
                class="gmail-ryNqvb">The tool segmented the entire
                image.</span></span> <span
              class="gmail-jCAhz gmail-ChMk0b"><span
                class="gmail-ryNqvb">I sharean additional screenshot
                showing the pixel values in an area of no data values.</span></span>
            <span class="gmail-jCAhz"><span class="gmail-ryNqvb">The
                values are indeed set on no data values for the
                multispectral SPOT6 input image.</span></span> <span
              class="gmail-jCAhz"><span class="gmail-ryNqvb">And you can
                clearly see that it assigned a value to my segmentation
                result. The process has been done for no data values
                also : <br>
              </span></span></span><img
            src="cid:part1.dYd2Y782.fS9wHGS8@nortekresources.com"
            alt="SS_raster_segmentation_spot6_nodatavalues.jpg" class=""
            width="306" height="171"><br>
        </div>
        <div>Thanks.</div>
      </div>
      <br>
      <div class="gmail_quote gmail_quote_container">
        <div dir="ltr" class="gmail_attr">Le ven. 13 juin 2025 à 11:58,
          celati Laurent <<a href="mailto:laurent.celati@gmail.com"
            moz-do-not-send="true" class="moz-txt-link-freetext">laurent.celati@gmail.com</a>>
          a écrit :<br>
        </div>
        <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">
            <div>Dear all,</div>
            <div>I'm working in a QGIS environment (graphical
              interface). Specifically, I'm using a QGIS modeler. Thanks
              to the processing toolbar provides, i have access to QGIS,
              Grass, Saga, and Orfeo toolbox tools algo. My goal is to
              generate a segmentation for geographic area. For the
              segmentation, I use the OTB tool via QGIS "Generic region
              merging": <a
href="https://www.orfeo-toolbox.org/CookBook-7.0/Applications/app_GenericRegionMerging.html"
                target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">https://www.orfeo-toolbox.org/CookBook-7.0/Applications/app_GenericRegionMerging.html</a></div>
            <br>
            The complexity comes from the fact that I want to
            contextualize/differentiate the parameters and input data
            required for the segmentation step,within my study area
            based on a land use layer/mask layer. So i want to define
            specific parameters/input data for the segmentation
            generated on forest areas. And other input data/segmentation
            parameters generated for non-forest areas (urban,
            agricultural). I therefore have a vector data set, "Forest
            DB mask," which allows me to locate/mask forest areas.<br>
            <br>
            <div>I therefore want to :</div>
            <div>
              <ol>
                <li>Generate an initial "raster segmentation" from an
                  aerial/satellite image with specific parameters for
                  forest areas (segmentation calculation only for raster
                  pixels that overlap my forest DB mask). Therefore, the
                  calculation must NOT be performed/ be ignored for
                  pixels not covered by this mask layer (agricultural,
                  urban, etc.).</li>
                <li>Then generate a second "raster segmentation" for the
                  rest of the study area that was ignored/skiped during
                  the first segmentation (segmentation calculation only
                  for raster pixels that do not overlap my forest DB
                  mask: agricultural, urban, etc.).</li>
                <li>Then, once these two raster segmentations are
                  complete, the idea is to merge them into a single
                  raster. Then, generate a polygonization (raster to
                  vector).</li>
              </ol>
            </div>
            This little workflow isn't really complicated. But I'm
            wondering if it's possible to do it in a QGIS
            modeling/graphical interface environment. I'd be interested
            in advice/ideas. Do I must to  clip input rasters with the
            forest DB masking layer? With a management/assignment of "no
            data values" to ignore the segmentation processing on areas
            not covered by the mask layer?<br>
            <br>
            I've attached below a screenshot that allows you to display
            an input raster image (here a multispectral Spot6/7
            satellite image) and the mask layer (vector forest DB mask)
            to better visualize the context.<br>
            <div><br>
            </div>
            <div><img
                src="cid:part2.3T90hMsn.59W2YcVp@nortekresources.com"
                alt="SS_MS_masque_bd_foret.jpg"
                style="margin-right: 0px;" class="" width="346"
                height="491"><br>
              <br>
            </div>
            <div>Thanks so much.</div>
            <div><br>
            </div>
            <br>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
QGIS-User mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-User@lists.osgeo.org">QGIS-User@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Kirk Schmidt, MScF, BScF, RPF
General Manager
Nortek Resource Solutions Inc.
26 Church Road
Sutherlands River, NS
B0K 1W0
Tel (902) 922.3607
Email: <a class="moz-txt-link-abbreviated" href="mailto:kirk@nortekresources.com">kirk@nortekresources.com</a>
Web: <a class="moz-txt-link-abbreviated" href="http://www.nortekresources.com">www.nortekresources.com</a></pre>
  </body>
</html>